例如,我在jsp或者html文件中如此写一个作用域:
<input type="text" ng-model="bb.hello"/>
然后在js中,我如果想给bb添加一个属性该如何写呢?
在js中,如果直接写
bb.a="sdfd";
就回报错的。
那么该如何写符合这种东西呢?
PHP中文网2017-05-15 17:04:12
As far as writing is concerned, if a variable in HTML, such as bb, reaches the controller, it needs to be preceded by $scope., which is $scope.bb.