You can't have a component with two component decorators (@Component). You need to create two different classes for this:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
@Component({
selector: 'app',
template: `<h1>Title Here</h1>`
})
export class AppComponent { }
@Component({
selector: 'appTwo',
template: `<h1>Another Title Here</h1>`
})
export class AppComponent1 { }
<!-- end snippet -->
You can't have a component with two component decorators (@Component). You need to create two different classes for this:
@Component({
selector: 'app',
template: `<h1>Title Here</h1>`
})
export class AppComponent { }
@Component({
selector: 'appTwo',
template: `<h1>Another Title Here</h1>`
})
export class AppComponent1 { }
Then you can use the approach from the Gunter's answer...