How can I make some templates?

I now have the app.component.ts prescribed pattern app.component.html (this is the main template with its structure) . In the login page I want to display a different template, how can I do it? need something to do app.component.html plunged and login.component.html
July 2nd 19 at 16:39
1 answer
July 2nd 19 at 16:41
Solution
Create a separate component and load with the help of routing. app.component.ts is the base, and nothing more. I have it looks like the rule
/**
 * Main application component
 * @description the entry point for the main router
 * */
import { Component, the OnInit } from '@angular/core';

@Component({
 selector: 'app',
 template: '<router-outlet></router-outlet>'
})

export class AppComponent implements OnInit {
constructor(){}
 ngOnInit() {};
}

All the rest is divided into separate components
See what I mean. I have a template main. In it, I connect some components, and then, instead , must be substituted by the component specified in the routing. Ie if I specify the routing component layout, it is not only right, because the component layout is I have nothing loaded.

For example. now input app looks like this template: ", and there is a routing path: ", component: MainLayoutComponent, and it turns out that I now have the layout loaded which has this content prntscr.com/d7wpks

And I need to instead of - podruzhilsya HomeComponent, but I can't ask, because I have the router set MainLayoutComponent - dahlia_Bog commented on July 2nd 19 at 16:44
Use the nested routing. - Shaina commented on July 2nd 19 at 16:47
: Yes thanks, already did, just didn't know what - dahlia_Bog commented on July 2nd 19 at 16:50

Find more questions by tags Angular