angular6 使用@Input() @Output()

 

@Input() html

在 B組件的TS文件中定義ide

@Input()
authenticationText;

@Input()
previewUrl;

@Input()
side;



在A組件的html文件中使用方法

 

這樣就能夠A B組件傳值3d

 

 @Output()htm

在B組件中定義blog

@Output()
key = new EventEmitter();

在B組件 TS文件中根據不一樣需求條件判斷後傳播出去

 



在A組件html中接收並使用

而且在A組件TS文件中定義事件事件

相關文章
相關標籤/搜索