簡體   English   中英

Angular1 Angular2中的范圍變量

[英]Angular1 Scope variables in angular2

我正在使用scope。$ on,scope。$ watch,scope。$ broadcast,$ scope。$ apply,$ scope。$ emit。 等等,angular1 但是當我嘗試用angular2編寫代碼時,我聽說這些屬性在angular2angular2 所以有人建議用這種東西代替。

您在Angular2中沒有提到任何內容。
在Angular2中,您可以使用服務和可觀察對象。

另請參閱https://angular.io/docs/ts/latest/cookbook/component-communication.html#!#bidirectional-service

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM