在Angular应用的child Component里同时使用@Input和@Output
生活随笔
收集整理的這篇文章主要介紹了
在Angular应用的child Component里同时使用@Input和@Output
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一個例子:
<app-input-output [item]="currentItem" (deleteRequest)="crossOffItem($event)"></app-input-output>(1) child Component的item屬性綁定到parent Component的currentItem屬性上
(2) 當child屬性拋出deleteRequest事件時,自動觸發parent Component的crossOffItem函數。
數據流向如下:
總結
以上是生活随笔為你收集整理的在Angular应用的child Component里同时使用@Input和@Output的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 哈啰打车推免佣、高额满单奖等车主激励举措
- 下一篇: Angular Template exp