Skip to content

AndrewJBateman/angular-website-example

Repository files navigation

⚡ Angular Website Example

  • Converts a free Namari HTML template to an Angular app
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

📄 Table of contents

📚 General info

  • Includes code from AdMISTER STUDIOs - see 👏 Inspiration below, but with changes to reduce lines of code and use latest Angular version. Some of the videos listed below are not applicable as I decided to just reproduce the Namari website and not include a blog, user login/logoff, auth guard, separate API etc.
  • Angular feature modules used for organisational best practise
  • Single service used to fetch data for all pages so this data can be accessed from an API. This meant I could not use custom interface classes. Each module should have its own service with interface class.

📷 Screenshots

Example screenshot.

📶 Technologies

💾 Setup

  • Run npm i to install dependencies.
  • Run ng serve for a dev server.
  • Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

💻 Code Examples

  • shared/services/config.service.ts function to get data from API with inputs: database name and id
getSettings(database: string, id?: number): Observable<any> {
  let url = id? `api/${database}/${id}` : `api/${database}`;
  return this.http.get<any>(url).pipe(
    catchError(this.handleError(`Error getting data from ${database}`, []))
  );
}

🆒 Features

  • Lazy-load modules used for most pages to speed up initial rendering of home page

📋 Status & To-Do List

  • Status: Working
  • To-Do: Remove unused CSS. Create separate service for each module?

👏 Inspiration

📁 License

  • N/A

✉️ Contact