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>
我只是複製現有的教程,所以爲什麼我可以看到,在標籤內什麼?
:啊哈哈很簡單 –