Please use this module
RouterModule.forRoot(
[
{ path: "", component: LoginComponent}
]
)
now just replace your <login></login>
with <router-outlet></router-outlet>
thats it
More Related Contents:
- How to detect a route change in Angular?
- Angular 2 router no base href set
- How to smooth scroll to page anchor in angular 4 without plugins properly?
- Angular 2 “slide in animation” of a routed component
- Dynamic tabs with user-click chosen components
- How do I pass data to Angular routed components?
- Using Pipes within ngModel on INPUT Elements in Angular
- Angular 2 http.post() is not sending the request
- Location and HashLocationStrategy stopped working in beta.16
- Ionic 2 – global NavBar for the app
- Angular: How to correctly implement APP_INITIALIZER
- Angular 2 – 2 Way Binding with NgModel in NgFor
- Using multiple instances of the same service
- No provider for HttpClient
- How do I detect user navigating back in Angular2?
- Handling refresh tokens using rxjs
- How to call component method from service? (angular2)
- Angular2 – Setting date field on reactive form
- Creating and returning Observable from Angular 2 Service
- How to add “class” to host element?
- How can I use custom theme palettes in Angular?
- Angular 6 does not add X-XSRF-TOKEN header to http request
- Get last created document in a Firebase Firestore collection
- Angular – POST uploaded file
- angular2 observable, getting undefined in component
- Invert Angular 2 *ngFor
- How to pass object from one component to another in Angular 2?
- How to clear form after submit in Angular 2?
- Angular4 APP_INITIALIZER won’t delay initialization
- Angular load external configuration before AppModule loads