1
Material 2 Tooltipのshow and hideメソッドを呼び出すために、コンポーネントの一部の条件に基づいてツールヒントを表示または非表示にすることができます。材質2コールツールチップの表示方法
私は@ViewChild
を使用してディレクティブへの参照を試みましたが、何か間違っている必要があります。
テンプレートスニペット:
<button md-mini-fab color="primary" mdTooltip="Menu" [mdMenuTriggerFor]="menu" class="remove-record">
<md-icon color="white">view_headline</md-icon>
</button>
コンポーネントスニペットは:
export class RackAverageComponent implements OnInit {
@ViewChild(MdTooltip) save;
ngOnInit() {
this.save.show();
}
}
これは、コンポーネントに関連付けられて取得されていないテンプレート内のディレクティブのように思えます。 @ViewChild
を正しく使用しているかどうかは不明です。
すごいです!ありがとう:) – Hodglem
喜んで:) – Faisal