P
P
Pogran2016-11-16 09:28:49
Angular
Pogran, 2016-11-16 09:28:49

How to make multiple templates?

I now have the app.component.html template in app.component.ts (this is the main template with its own structure). On the login page, I want to display a different template, how can I do this? you need to do something so that not app.component.html is loaded, but login.component.html

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Klusevich, 2016-11-16
@Pogran

Create a separate component and load using routing. app.component.ts is the base and nothing more. To me it looks like it usually

/**
 * Основной компонент приложения
 * @description Входная точка для основного маршрутизатора
 * */
import { Component, OnInit } from '@angular/core';

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

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

Everything else is broken down into separate components.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question