本文介绍了在扩展$ Angular.js范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有时候,我看到使用这种模式的人:
angular.extend($范围,{somekey,someval})
。
什么是应用范围扩展的这种风格,当我可以设置范围的利益直接像这样:
$ scope.somekey = someval
?
解决方案
If I read this correctly, absolutely none, despite syntactic pseudo-sugar that I personely don't agreee with.
Though, reading some angular-leaflet issues, one day, I remember I read someone stating that something worked with angular.extend
and didn't with a simple assignment.
这篇关于在扩展$ Angular.js范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!