0
A
回答
1
controllerAs
在Angular 1.3中引入,並且允許在控制器中使用this
來引用範圍屬性。
這是試圖減少範圍的使用,並從DOM結構中分離代碼。
但它引入了雙向數據綁定(手錶)的複雜性。使用controller-as語法添加手錶仍然需要操作範圍對象。
bindToController
,在Angular 1.4中引入的嘗試通過使用控制器而不是用於暴露通常駐留在範圍內的屬性的範圍來解決此問題。
相關問題
- 1. 「+」在CSS中做了什麼?
- 2. 定義函數在AngularJS中做了什麼?
- 3. perl中的~~做了什麼?
- 4. 我在做什麼錯了?
- 5. scalaz中scalaz.syntax.std.OptionOps.cata做了什麼?
- 6. L做了什麼?
- 7. logging.basicConfig做了什麼?
- 8. `tf.strided_slice()`做了什麼?
- 9. 什麼做錯了?
- 10. class_initialize()做了什麼?
- 11. @synchronized()做了什麼?
- 12. 我在做什麼錯了瓶裝+ AngularJS + HTTP POST請求
- 13. 爲什麼Django被jQuery 1.4困住了?
- 14. Grails 1.4 - ApplicationHolder,ConfigurationHolder等發生了什麼?
- 15. innerHTML在javascript中做了什麼?
- 16. @字符在jQuery中做了什麼?
- 17. extern在目標C中做了什麼?
- 18. @ Component在angular2中做了什麼
- 19. f.input在rails窗體中做了什麼?
- 20. Attach()在Entity Framework中做了什麼?
- 21. ccpClamp在Cocos2d中做了什麼?
- 22. Android:NoActionBar在主題中做了什麼?
- 23. LOWERCASE_EXPANDED_TERMS在Lucene中做了什麼?
- 24. 我在模式中做錯了什麼?
- 25. Page()在Razor Page中做了什麼?
- 26. if在[-n「$ {TEMP_FILE_LIST}」]中做了什麼?
- 27. 在命令行中做了什麼?
- 28. 在Angular 2中response.json()做了什麼?
- 29. 「12345」+ 2在C中做了什麼?
- 30. '|| ='操作符在ruby中做了什麼?
將*「angular bindToController」*拖放到Google中,您將得到詳細解釋的結尾......包括官方描述所在的$ compile文檔 – charlietfl