admin管理员组文章数量:1336643
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
本文标签: javascriptionic 2creating a ngrepeat inside ionslidesStack Overflow
版权声明:本文标题:javascript - ionic 2 : creating a ng-repeat inside ion-slides - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742343223a2457014.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论