1
你好,我试图研究角度,但比我想象的更难。 我只想要在控制器内形象化一个数组的值,但在浏览器中似乎显示任何东西。角js,为什么我的数据不可视化?
这里的代码:
<body ng-app="APP">
<div ng-controller="theController">
<b ng-repeat="item in items">{{item.title}}</b>
</div>
<script>
angular.module('APP',[])
.controller ('theController',['$scope',function($scope){
$scope.items[
{'title':'a','type':1},
{'title':'b','type':2},
{'title':'c','type':1},
{'title':'d','type':4}
]
}])
</script>
</body>
</html>
我只是复制现有的教程,所以为什么我可以看到,在标签内什么?
:啊哈哈很简单 –