I just started an Angular app so I want to add multiple components on same page. How does this work in Angular? Let's assume each div will be a separate component as well as the view. The components must be in separate .ts files.
Would the following work?
app.component.html:
<div>APP Component1</div>
<div>App Component2</div>
app.component.ts:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent1 {
title = 'app works!';
}
export class AppComponent2 {
title = 'app works!';
}