It seems like I am required to use ng-repeat in order to display the data, but I would prefer to avoid using it.
angular:
App.controller('aboutLongCtrl', function ($scope, $http) {
$http.get('test_data/ar_org.json')
.then(function (res) {
$scope.aboutlongs = res.data.aboutlong;
});
});
This is how I have set up my markup:
<div class="background-white p20 reasons" ng-controller="aboutLongCtrl" >
<h6 ng-repeat="aboutlong in aboutlongs"><b>About {{aboutlong.name}}</b></h6>
<div class="reason-content" ng-repeat="aboutlong in aboutlongs">
{{aboutlong.description}}
</div>
</div>
But when I try to simplify it by removing ng-repeat, it doesn't seem to work. Can anyone point out where the issue might be?
<div class="background-white p20 reasons" ng-controller="aboutLongCtrl" >
<h6><b>About {{aboutlong.name}}</b></h6>
<div class="reason-content">
{{aboutlong.description}}
</div>
</div>
I attempted to follow suggestions from here without success: How to Display single object data with out Using ng-repeat?
I suspect there may be an issue within the angular code that I need to address.