For some reason, I have to use ng-repeat in order to display data. I'd like to display data without using ng-repeat.
angular:
App.controller('aboutLongCtrl', function ($scope, $http) {
$http.get('test_data/ar_org.json')
.then(function (res) {
$scope.aboutlongs = res.data.aboutlong;
});
});
Here's 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>
If I use this, it won't work.. can anyone explain why?
<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 followed this approach but it won't work: How to Display single object data with out Using ng-repeat?
I'm guessing it's because of my angular code, something isn't right.