0
に一致しない、私は私のアプリを構築しようとすると、私はエラーを取得していますイオン2:指定されたパラメータは、コールのターゲットのいずれかの署名
とイオンの実行
アンドロイドこれは誤りである
[14:38:19] lint finished in 1.88 s
[14:38:33] Error: Error at
C:/Users/adirz/myapps/studentAssistantApp/.tmp/pages/courses-page/courses-page.ngfactory.ts:943:29
[14:38:33] Supplied parameters do not match any signature of call target.
私はコースpage.ts成分を添加
import { Component } from '@angular/core';
import {NavController, LoadingController,AlertController,NavParams} from 'ionic-angular';
//import providers
import {CoursesData} from "../../providers/Courses-data";
import firebase from 'firebase';
/*
Generated class for the CoursesPage page.
See http://ionicframework.com/docs/v2/components/#navigation for more info on
Ionic pages and navigation.
*/
@Component({
selector: 'page-courses-page',
templateUrl: 'courses-page.html'
})
export class CoursesPage {
public pet: string = 'SemA';
public coursesA: Array<any> = [];
public coursesB: Array<any> = [];
public department:any;
public gaming: string = 'all';
public courseNames: Array<any> = [];
constructor(public navCtrl: NavController,private navParams:NavParams,private loadingCtrl: LoadingController,public coursesData:CoursesData,public alertCtrl: AlertController)
{
console.log("adir");
this.department=this.navParams.get('department');
console.log(this.department.id);
}
ionViewDidLoad() {
let loader = this.loadingCtrl.create({});
this.coursesA=this.coursesData.getCoursesList(this.department.id);
if(this.coursesA){
console.log("hello world");
console.log(this.coursesA);
loader.dismiss();
}
//this.coursesData.getCourse(this.department.id)ף
/*this.getCoursesList().then((x: Array<any>) => {
if (x) {
this.coursesA = x;
this.courseNames = x;
loader.dismiss();
}
});
*/
}
私はそれは私が何か間違ったことをしたと思うもちろん、data.ts関数から帰国getCoursesList(departmentId:any):any
で何かだと思うもちろん、データプロバイダにも
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/add/operator/map';
import firebase from 'firebase'
/*
Generated class for the CoursesData provider.
See https://angular.io/docs/ts/latest/guide/dependency-injection.html
for more info on providers and Angular 2 DI.
*/
@Injectable()
export class CoursesData {
//firebase datab
public fireRef:any;
public coursesList:any;
public coursesA: Array<any> = [];
constructor() {
this.fireRef=firebase.database().ref();
this.coursesList=firebase.database().ref('Courses/');
}
public getCourse(departmentId:any):any{
var semesterRef = firebase.database().ref('Courses/'+departmentId+'/SemA');
return semesterRef;
/*semesterRef.on('child_added', function(courseSnapshot) {
console.log(courseSnapshot.key);
courseSnapshot.forEach(function(childSnapshot):boolean{
return courseSnapshot.val(); // to appease TypeScript
});
});
*/
}
public getCoursesList(departmentId:any):any
{
var rootRef = firebase.database().ref('Courses/'+departmentId+'/SemA');
var listChild =[];
rootRef.on('child_added', function (childData) {
childData.forEach(function(childData2){
listChild.push(childData2.val());
return false;
})
});
return(listChild);
}
}
を追加しました。
イオンを流すとうまく動作します。