私はButtonComponentと呼ばれるコンポーネントがあります。コンポーネントの角2命令は、ng-contentをオーバーライドしますか?
import { Component } from "angular2/core";
@Component({
selector: 'btn',
template: '<div class="btn"><ng-content></ng-content></div>'
})
export class ButtonComponent { }
と指令:
import { Directive, Input } from 'angular2/core';
@Directive({
selector: 'btn[dialog-data]'
})
export class DialogButtonDirective {
@Input('dialog-data')
public dialogData: any;
}
をしかし、私はこのようにそれを使用しようとします
<btn [dialog-data]="dart()">DART</btn>
次にボタンが内側に何もありませんそれの。 なぜですか?私がこの指令を使用していないときは、すべてが問題ありません。
Plunkerで再生しようとすることはできますか? –