I am trying to create a simple angular2 component and I have an error while binding the directive to my own DOM element.
For instance:
/// <reference path="../../typings/_custom.d.ts" /> import { Component, View } from 'angular2/angular2'; import { RouterLink } from 'angular2/router'; @Component({ selector: 'my-component', directives: [RouterLink] }) @View({ template: ` <a [router-link]="['/page']">test</a> ` }) export class MyComponent { }
=> You cannot bind to 'routerLink', because this is not a known property of '<a>' and there are no corresponding directives with the corresponding property.
What have I done wrong?
source share