Please enable JavaScript.
Coggle requires JavaScript to display documents.
app.module.ts, Angular Route Guards, Routing Strategies, Cons, Pros, Cons,…
app.module.ts
app-routing.module.ts
import { Routes, RouterModule}
import { first ,second Componet}
const routes: Routes= [{path: '', componet: first component},{}]
app.component.html
-
app.component.ts
To get route data , we can call
-
-
-
WildCard Routes
-
{ path;'**', componet: PageNotFoundComponent }
imports: [ RouterModule.forRoot(routes) ] in NgModule
-
Angular Route Guards
-
- Allow access to certain parts of the application to specific users
- Validating the route parameters before navigating to the route
- To Confirm the navigational operation
- Asking whether to save before moving away from a view
Routing Strategies
PathLocationStrategy
-
-
-
It makes our app load faster, by rendering the pages in the server first before delivering it to the client
HashLocationStrategy
-
-
-
provider: [ { provide: LocationStrategy, useClass: HashLocationStrategy} ]
-
Server-Side Rendering is a technique that renders critical pages on the server that can greatly improve resonsiveness when the app first loads
-
-
-
-