Exploring the functionality of Angular, I am looking to include multiple components on a single page. How can this be achieved effectively in Angular? I envision each div representing a distinct component and view, with all components residing in separate .ts files.
Is the following approach suitable?
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!';
}