app.controller('myController',['$scope',function($scope){
// here i have one array of objects arr is here
}])
和指令是
app.directive("myDir", function() {
scope: {
myArr: "=",
},
templateUrl: "views/myHTML.html"
};
});
我在这里包括myHTML.html文件。我如何将数组传递给此文件?我在我的HTML.html文件中需要这个数组。我想用ng-repeat.
在蛇的情况下在HTML中使用您的指令...即my-arr =“”而不是myArr =“”。 –
检查它没有奏效。谢谢 –