Ng-repeat on a ion-slide element creates bad result


#1

Hello.

I am trying to generate a ion-slide based on a json result from a rest api.
My mockup is like this:

	<ion-slide-box ng-if="datesofweek">
		<ion-slide ng-repeat="date in datesofweek">
				<div>{{date}}</div>
		</ion-slide>
	</ion-slide-box>		

and in my Controller I have the following code:

	$http.get( 'http://portal.ontimebemanning.no/api/json/hours/' + $scope.weeknumber )
	.success( function( data, status, headers, config ) {
		$scope.datesofweek = data.dates;
	}).

The Json result which feeds the datesofweek object is:

"dates":["2014-11-04","2014-11-05","2014-11-06","2014-11-07","2014-11-08","2014-11-09"]

This is resulting in 7 slides being generated, but they are all shown at the first one. When i scroll through each one, they work as expected after that.

This is how it looks when I enter the page:

Link: http://pasteboard.itvault.no/files/N11SSSSe.jpg


#2

@vimzzz Can u put up a plunkr/codepen. I can’t get a grasp of the problem.


#3

Here is a Pen.

It seems the problem is created due to the tabs repeat getting populated by a $http.get
If i feed it a static object its fine. So most likely, angular isnt redrawing the slides after it fetches data from the server.


#4

Problem solved:

My initial $scope.datesofweek = [1,2,3,4,5,6,7]; was ment for testing and created the bug.
By removing it, it works as normally planned.