Answer the question
In order to leave comments, you need to log in
Why is ng-repeat not working?
output not working
<h3>Events</h3>
<div ng-repeat="e in vm.events">
{{e.name}}
{{e.date}}
{{e.locality}}
</div>
{{vm.events.locality}}
{{vm.events.locality}}
works, the data comes and is output. What is the problem? What did I miss? angular
.module('app.research')
.directive('researchEvents', researchEvents);
function researchEvents() {
var directive = {
restrict: 'EA',
templateUrl: 'research/client/directives/researchEventsDirective/research.events.client.directive.html',
scope: {
},
link: linkFunc,
controller: ExampleController,
controllerAs: 'vm'
};
return directive;
function linkFunc(scope, el, attr, ctrl) {
console.log(scope.vm.events);
}
}
ExampleController.$inject = ['researchEventsService'];
function ExampleController(researchEventsService) {
var vm = this;
vm.events = researchEventsService.get();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question