I am following an Angular2 tutorial and I have to reference an extra component to the main component. I want to insert the template from the "CoursesComponent" inside the < courses > tag of the main component. For this I am using "directives: []", but it's not working. I get the error: 'courses' is not a known element'. Is directives no longer used for this, and I should do it differently?
App.component.ts
import {Component} from '@angular/core';
import {CoursesComponent} from './courses.component'
@Component({
selector: 'my-app',
template: '<h1>My first Angular2 app</h1><courses></courses>',
directives: [CoursesComponent]
})
export class AppComponent {}
Courses.component.ts
import {Component} from '@angular/core';
@Component({
selector: 'courses',
template: '<h2>Courses</h2>'
})
export class CoursesComponent {}