Skip to main content

Posts

Showing posts with the label What is Router Imports?

What Is Router Imports in Angular?

What Is Router imports? It is an optional service that presents a special component view for a given URL. It has own library package- @angular/router and It is not a part of an Angular core. The Angular package looks like this. import  { Routes ,  RouterModule ,}    from   '@angular/router' ; And    //Composability and Grouping    //imports used for composing modules together.    imports:  [      BrowserModule ,      //enableTracing enables debugging purposes only      //useHash enables the location strategy that uses the URL fragment instead of the history API.      RouterModule . forRoot ( appRoots , {  enableTracing:   true ,  useHash: true  })    ], For more detail kindly refer the link - https://www.code-sample.com/2018/05/angular-5-6-7-routing-and-navigation.html

What is Router Imports?

The Angular Router is an optional service that presents a particular component view for a given URL i.e. import { RouterModule, Routes } from '@angular/router'; Stayed Informed  -  Routing Concepts Example as, import { NgModule } from '@angular/core' ; import { RouterModule, Routes } from '@angular/router' ; import { UniversalModule } from 'angular2-universal' ; import { FormsModule, ReactiveFormsModule } from '@angular/forms' ; import { HttpModule } from '@angular/http' ; import { AppComponent } from './components/app/app.component' ; import { HomeComponent } from './components/home/home.component' ; import { HeaderComponent } from './components/shared/header/header.component' ; import { MenuComponent } from './components/menu/menu.component' ; import { LoginComponent } from './components/login/login.component' ; import { RegistrationComponent } from './components/reg...