1
저는 home.ts 클래스에 Ionic 2.2.1이있는 Typescript로 쓰고 있습니다.정의되지 않은 '[function]'속성을 읽을 수 없습니다.
나는 오류를 얻을 : 형식 오류 : this.GetLocalInformation이 실행에 기능 없습니다. 여기
는 두 가지 기능이 상호 작용하는 방법입니다 : 내가 전화 때문에
ngOnInit() {
this.GetLocalInformation(); //sets this.school to the school
this.fullSchedule = this.schedProvider.GetCorrespondingSchool(this.school);
this.fullSchoolName = this.schedProvider.GetFullSchoolName(this.school);
this.timerFunc(); //Timer Function -- This method is in a loop with itself
}
timerFunc() { //Self Updating Timer Method
this.GetLocalInformation();
this.periods = this.schedProvider.GetPeriod(this.school);
this.timeInSeconds = ((this.periods[0].h * 3600) + (this.periods[0].m * 60)) - (new Date().getHours() * 3600 + new Date().getMinutes() * 60) - new Date().getSeconds(); //Calculate time difference
this.currentP = this.periods[0].title;
this.nextP = this.periods[1].title;
var dt = Date.now() - this.expected; // the drift (positive for overshooting)
if (dt > this.interval) {
// something really bad happened. Maybe the browser (tab) was inactive?
// possibly special handling to avoid futile "catch up" run
}
//Set Variables
//Update Timer
//this.timer.timer.secondsRemaining = +this.timeInSeconds;
this.timer.updateTimer(this.timeInSeconds);
this.expected += this.interval;
setTimeout(this.timerFunc, Math.max(0, this.interval - dt)); // take into account drift
}
내가 이해되지 않는다
timerFunc()의 첫 번째 줄에 오류 메시지가 나타납니다
ngOnInit에서 완벽하게 정상적으로 동일한 기능 ()
당신의 대답은 완벽하고 쉽게 이해했다. 고맙습니다! 매우 감사 –