1

Topic: Question about Angular

Greetings
Whether has value the order in which I enumerate units in app. Module.ts?
At me this file looks so:

import {NgModule} from ' @angular/core ';
import {BrowserModule} from ' @angular/platform-browser ';
import {FormsModule} from ' @angular/forms';
import {AppComponent} from './app.component ';
import {MyAppComponent} from './myapp.component ';
@NgModule ({
imports: [BrowserModule;
FormsModule];
declarations: [AppComponent, MyAppComponent];
bootstrap: [AppComponent, MyAppComponent]
})
export class AppModule {}

Both components the such:
app.component.ts

import {Component} from ' @angular/core ';
@Component ({
selector: ' my-app ';
templateUrl:'./app.component.html'
})
export class AppComponent {name = ' Main component is here ';}

myapp.component.ts

import {Component} from ' @angular/core ';
@Component ({
selector: ' my-app1 ';
templateUrl: ' ./myapp.component.html'
})
export class MyAppComponent {name = ' Extra component name ';}

If the start page (it is a question about ASP.NET MVC) looks so all works:

<div class = "container-fluid">
<my-app> Loading Component content here... </my-app>
</div>

If so does not work, the component does not appear on the screen:

<div class = "container-fluid">
<my-app1> Loading Component content here... </my-app1>
</div>

If to change the order in app. Module.ts

declarations: [MyAppComponent, AppComponent];
bootstrap: [MyAppComponent, AppComponent]

All starts to work.
Besides, a marking with both components

<div class = "container-fluid">
<my-app> Loading Component content here... </my-app>
<my-app1> Loading Component content here... </my-app1>
</div>

Works irrespective of the announcement order.
What it for a glitch?
The other:  5.
Thanks.

2

Re: Question about Angular

Renziglov wrote:

bootstrap: [MyAppComponent, AppComponent]

You understand, what it means?

3

Re: Question about Angular

The innocent person behind a board;
Listen, get rid. Answers, instead of your questions are necessary to me. If I know all and understood, I would not set questions here.