Tuesday, October 3, 2017

Data binding in ionic application

I am working on employeeManagement application, it take care of employee database and some review associated with the employee. I am using ionic storage for local storage purpose and mysql as database.

I have to show some data on a page as soon as page loads…but page is getting load earlier than object gets it value from the database.

below is the code

<ion-list *ngFor="let item of reviews"  >




and .ts file is as below

export class EmpDetailPage {

data : EmployeeDetail[] ;

emp_id: number;

data_emp:EmployeeDetail;

emp_name:string=”;

behaviour:number;

socialism:number;

communication:number;

technical:number;

management:number;

reviews: ReviewMap[]=[];

feedback : ReviewMap;

remarks:string=”;

rating :number;

constructor(public navCtrl: NavController, public navParams: NavParams,public storage: Storage) {

this.emp_id=navParams.get("emp_id");
this.emp_name=navParams.get("emp_name");
this.data=[];

this.storage.get(‘EmpReviews’).then((data)=>{

//let ionic_review=data;

this.reviews=data;

})

}

I have populated the values of reviews in constructor itself but it is not getting displayed.

Source: AngularJS



from Angular Questions https://angularquestions.com/2017/10/03/data-binding-in-ionic-application/
via @lzomedia #developer #freelance #web #lzomedia.com

No comments:

Post a Comment