I am trying to pass an array of JSON objects into my directive and then repeat them back using ngrepeat, however it is not working and it is not clear why.
I have created a jsfiddle which shows the problem that I am experiencing.
https://jsfiddle.net/HB7LU/15997/
Is anybody able to tell me what I am doing wrong? I don't understand why it won't let me do this.
var myApp = angular.module('myApp',[]);
myApp.directive('dir', function() {
return {
restrict: 'E',
scope:{
items: '@'
},
replace: true,
template: '<div><h6>descriptions below</h6><div ngrepeat="x in items"><p>{{x.desc}}</p></div></div>',
link :function(scope){
console.log(scope.items);
}
};
});