I'm trying to do a slider style page which presents dynamic data based on my json file given.
In my controller:
constructor(navController) {
this.navController = navController;
this.populateHistory();
}
populateHistory(){
console.log("populating!");
var tests = '{[{"name":"jack"},{"name":"john"},{"name":"joe"}]}';
}
In my html:
<ion-slides>
<ion-slide ng-repeat="test in tests">
{{test.name}}
</ion-slide>
</ion-slides>
The page doesn't appear even thou the console.log is fired. I'm guessing there is some syntax error in my html which I failed to notice.Do i have to use collection-repeat instead in Ionic 2?
I'm trying to do a slider style page which presents dynamic data based on my json file given.
In my controller:
constructor(navController) {
this.navController = navController;
this.populateHistory();
}
populateHistory(){
console.log("populating!");
var tests = '{[{"name":"jack"},{"name":"john"},{"name":"joe"}]}';
}
In my html:
<ion-slides>
<ion-slide ng-repeat="test in tests">
{{test.name}}
</ion-slide>
</ion-slides>
The page doesn't appear even thou the console.log is fired. I'm guessing there is some syntax error in my html which I failed to notice.Do i have to use collection-repeat instead in Ionic 2?
Share Improve this question asked May 17, 2016 at 2:31 GeneGene 2,2184 gold badges31 silver badges52 bronze badges1 Answer
Reset to default 7there is no ng-repeat
in angular2... should be
<ion-slides *ngIf="tests.length">
<ion-slide *ngFor="#test of tests">
<div>
{{ test.name }}
</div>
</ion-slide>
</ion-slides>
but I think you might want to look at this issue to see if it affects you.
https://github./driftyco/ionic/issues/6515
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742343224a4426038.html
评论列表(0条)