[英]Angular1 Scope variables in angular2
我正在使用scope。$ on,scope。$ watch,scope。$ broadcast,$ scope。$ apply,$ scope。$ emit。 等等,在angular1
。 但是當我嘗試用angular2
編寫代碼時,我聽說這些屬性在angular2
中angular2
。 所以有人建議用這種東西代替。
您在Angular2中沒有提到任何內容。
在Angular2中,您可以使用服務和可觀察對象。
另請參閱https://angular.io/docs/ts/latest/cookbook/component-communication.html#!#bidirectional-service
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.