I'm trying to learn Angular 2, after a lot of error messages i finally got the routes working and i can display the component i want. Now i want to show my homepage component, and i want this component to have a navbar component in it.
Home.ts:
import {Component, View} from 'angular2/core';
import {Navbar} from './navbar/navbar'
@Component({
selector: 'home'
})
@View({
templateUrl: '/app/home/home.html'
})
export class Home {
constructor:(public navbar: Navbar) {
}
}
home.html:
<p>NICE!</p>
<navbar></navbar>
navbar.ts:
import {Component, View} from 'angular2/core';
@Component({
selector: 'navbar'
})
@View({
template: `
<ul>
<li>This is the navbar</li>
</ul>
`
})
export class Navbar{
}
The homepage is displaying, but the tag just stays <navbar></navbar>
when i inspect it. What am i doing wrong?