I would like to write out list of some items in my app using ng-repeat but i faced with this problem:
Template
<ion-slide-box on-slide-changed="slideHasChanged($index)" ng-controller="AccountCtrl" ng-init="getData()">
<ion-slide ng-repeat="statitem in stats">
<div class="box vh80">
<h1>{{statitem.name}}</h1>
<h1>Test</h1>
</div>
</ion-slide>
</ion-slide-box>
And in AccountCtrl
angular.module('starter.controllers', [])
.controller('AccountCtrl', function($scope, Friends) {
$scope.getData = function() {
console.log('test');
var friends = [
{ id: 0, name: 'Scruff McGruff' },
{ id: 1, name: 'G.I. Joe' },
{ id: 2, name: 'Miss Frizzle' },
{ id: 3, name: 'Ash efe' }
];
$scope.stats = friends;
}
});
Problem is, that no item is obtained in template.
Where can be problem please?
Thanks for any help.
EDIT:
I solved it by moving the method calling to the parent div.
<ion-content class="padding" ng-controller="AccountCtrl" ng-init="getData()">