I am facing an issue with my Angular app that utilizes ui-router. I have set up a service and directive, but I am unable to display JSON data. Surprisingly, it works perfectly fine without the directive when I directly display it in the main template (home.html). The code snippet of my controller is as follows:
app.controller('homeCtrl', ['$scope', 'homeList', function ($scope, homeList) {
homeList.get().then(function (homeList) {
$scope.homeList = homeList;
$scope.homeList.name = 'Home list';
});
}]);
Even though {{homeList.name}}
displays the data correctly, the ng-repeat
in directiveTemplate.html
fails to display data from the JSON source.
You can check out the issue in the Plunker provided here
I have checked the console for errors, but there aren't any. I am at a loss trying to figure out what I might be missing.
Any help or guidance would be greatly appreciated.