| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Simple and quick step-by-step tutorial guide for Angular application.
Uses docker (>=17.05) container setup for easy development.
Goal: Create the development docker image
docker-compose build
run_docker.sh
Goal: Default angular application using docker
run_docker.sh
/wip# ls -al
ng new angular --routing true --enableIvy true
"start:dev": "ng serve --host 0.0.0.0",
/wip/angular# npm run start:dev
http://localhost:4200/

Goal: Create simple homepage UI components: [Home, About]
Refactor the default Angular application into frame and home component. Also create a new about component to allow switching between 2 URLs that maps to the 2 components.
ng generate module homepage --module app --routing true
ng generate component homepage/home --module homepage ng generate component homepage/about --module homepage --style scss
const routes: Routes = [
{ path: 'home', component: HomeComponent },
{ path: 'about', component: AboutComponent },
];
http://localhost:4200/home http://localhost:4200/about
Goal: Use Angular Material components to build visuals
Refactor the Angular application to import Angular Material library and update the layout / components with Material visaul
ng add @angular/material
Indigo/Pink theme Set up HammerJS for gesture recognition? Yes Set up browser animations for Angular Material? Yes
import {
MatToolbarModule,
MatIconModule,
MatCardModule,
MatButtonModule,
MatProgressSpinnerModule
} from '@angular/material';
imports: [
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule,
MatToolbarModule,
MatIconModule,
MatButtonModule,
MatCardModule,
MatProgressSpinnerModule
],
<mat-toolbar color="primary">
<h1>
The Angular Store
</h1>
<button mat-button routerLink="/">Home</button>
<button mat-button routerLink="/about">About</button>
</mat-toolbar>
| Back | FazBrowse Home | New Git URL |