Ionic2 *ngFor


#1
                               <ion-list >   
                           	        <ion-item >         
                                         All Stores
                                        </ion-item>    
	                        		
	                                <ion-item *ngFor="let route of routeList">
                                           <div (click)="selectedRoute(route.location)">{{route.route_name}}</div>
                                         </ion-item>


	                        </ion-list>

This code is works perfectly in browser . But i dont know why android phone does not showing the list ?
Help me in this


#2

Nobody can possibly help you without knowing how routeList is managed.


#3
       export class RoutePage {
           color: string;
           storage ;
           routeList;   

        constructor(private _navController: NavController, private _navParams: NavParams,private dbcontent:DbContent,private zone:NgZone) {

//console.log("in route page===========",dbcontent.n)
//dbcontent.executeRoute();
let options = {name :"mirrow"};
this.storage = new Storage(SqlStorage, options);
 this.storage.query("SELECT * FROM route").then((data) => {
          
          console.log("ds",data.res.rows); 
          

          alert(data.res.rows.item(0).location);
          this.zone.run(()=>this.routeList=data.res.rows)
        },
     (error) => {
        console.log("ERROR" + JSON.stringify(error.err));
        });


    }

This is code for getting the routelist


#4

I have pasted the code for getting the routelist .can u help me in this ?


#5

Does your console log any errors? Perhaps the call is failing somewhere on the device?


#6

No More error in my console .

What kind of problem will occur in my device ?


#7

Hi vknaveenkumar,
Are you get the solution ? If yes kindly suggest me I stuck in this issue.


#8

Are you certain you have the same issue? Storage has changed quite a bit since this topic was originally posted.