Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
Ionic2 - element._view is undefined

I try implements chart.js into ionic project,, i take values from firebase.. i push datas using subscribe.. here is my code

export class HomePage {
  items: FirebaseListObservable<any[]>;
  itemsChart: FirebaseListObservable<any[]>;
  listArray: any[] = [];

  public lineChartType:string = 'line';
  public lineChartData:Array<any> = [{data: [], label: 'Grafik'}];
  public lineChartLabels:Array<any> = [];

  constructor(public navCtrl: NavController, af: AngularFire) {
    this.itemsChart = af.database.list('/kelembaban', {
       preserveSnapshot : true,
       query: {
         orderByKey: true,
         limitToLast: 10
       }
    }).map((array) => array.reverse()) as FirebaseListObservable<any[]>;

    this.itemsChart.subscribe(snapshots => {
      snapshots.forEach(snapshot => {
        this.lineChartLabels.push(snapshot.val().time);
        console.log(this.lineChartLabels);
        this.lineChartData[0]['data'].push(snapshot.val().value);
        console.log(this.lineChartData[0]['data']);
      });
    });
   }
}

i dont know whats wrong with my code.. ty for advice

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!