May 2018
Intermediate to advanced
512 pages
11h 3m
English
Let's get started with setting up a simple route for LemonMart:
src/app/app-routing.module.ts ...const routes: Routes = [ { path: '', redirectTo: '/home', pathMatch: 'full' }, { path: 'home', component: HomeComponent },]...
We first define a path for 'home' and inform the router to render HomeComponent by setting the component property. Then, we set the default path of the application '' to be redirected to '/home'. By setting the pathMatch property, we always ensure that this very specific instance of the home route will be rendered as the landing experience.
src/app/app-routing.module.ts ...
Read now
Unlock full access