工作這是我的索引頁angular.isArray功能沒有在循環
<li class="active" ng-repeat="items in menuItems">
<span ng-if="angular.isArray(items)">
<a href="" class="act">{{items}}</a>
</span>
</li>
這是我的控制器
app.controller('mainController', function($scope) {
$scope.assests = 'include/assests.html' ;
$scope.menu = 'include/menu.html' ;
$scope.footer = 'include/footer.html' ;
$scope.menuItems = [ 'a' , ['xyz'] , ['abc'] ];
});
的MenuItems是數組和值的組合,但angular.isArray(項)既不評價真實也不虛假。
http://stackoverflow.com/questions/25411291/angularjs-inline-check-if-an-array-check –