离子运行android |提供的参数与呼叫目标的任何签名都不匹配

时间:2016-11-10 00:58:01

标签: ionic-framework ionic2 ionic-view ionicpopup

我有course-page.ts和course-data.ts。 课程页面从course-data.ts获取数据。 我希望使用"离子运行android"来构建我的应用程序但它失败了。 它向我显示了这个错误

   [02:51:30]  lint finished in 1.79 s
[02:51:39]  Error: Error at C:/Users/adirz/myapps/sceSchedule/.tmp/pages/courses-page/courses-page.ngfactory.ts:736:29

[02:51:39]  Supplied parameters do not match any signature of call target.
[02:51:39]  Error at C:/Users/adirz/myapps/sceSchedule/.tmp/pages/courses-page/courses-page.ngfactory.ts:761:29
[02:51:39]  Supplied parameters do not match any signature of call target.

[02:51:39]  ngc failed

[02:51:39]  ionic-app-script task: "build"

[02:51:39]  Error: Error

这是我的课程页面。

> import { Component } from '@angular/core';
import {NavController, LoadingController,AlertController} from 'ionic-angular';

import {CoursesData} from "../../providers/courses-data";
import {course} from "../../models/Course";

/*
  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 semester: string = 'SemA';
 // public coursesA: Array<any> = [];
  public coursesB: Array<any> = [];
  public coursesC:Array<any>=[];
  public department:any;
  public courseSelect: string = '';
  public lectureSelect:string= '';
  public coursesNames:Array<any>=[];
  public LecturesNames:Array<any>=[];
  public LectureCourses:Array<any>=[];
  public loader = this.loadingCtrl.create({
    content: "Please wait...",
    spinner: 'crescent'

  });
  public coursesA:Array<any>=[];
   public coursesAD:Array<any>=[];
  public coursesChose:Array<any>=[];

  constructor(public navCtrl: NavController,private loadingCtrl: LoadingController,public coursesData:CoursesData,public alertCtrl: AlertController) {

  }


  ionViewWillEnter() {
    this.loader.present();
      this.onSemChange(); 
    }
    public getCourses(semester:any){
      this.courseSelect='';
      this.coursesNames=[];
      this.LecturesNames=[];
      this.coursesA=[];
      console.log(semester);
     this.coursesData.LoadData(semester)
        .subscribe(courseList=> {
          courseList.forEach(course=>{
          var newCourse={
               id_course:course.id_course ,
              key_course:course.key_course,
              course_name:course.course_name ,
              course_type:course.course_type ,
              start:course.start ,
              end:course.end ,
              point_course:course.point_course ,
              day:course.Day,
              class:course.class,
              lecture_name:course.lecture_name
          }
            this.coursesA.push(newCourse);
            this.coursesNames.push(course.course_name);
            this.LecturesNames.push(course.lecture_name);
          });
          //this.courseSelect=this.coursesNames[0];
          this.coursesAD=this.coursesA;
          this.coursesNames = this.coursesNames.filter(function(elem, index, self) {
                  return index == self.indexOf(elem);
              })
              console.log(this.coursesA);


               this.loader.dismiss();
               console.log(this.coursesNames);
        // return this.coursesA;

        },err=>{
          console.log(err);
        });
  }



  public onCourseChange(){
    console.log(this.courseSelect);
    this.coursesA=this.coursesAD;
    //getCourses();
  this.coursesChose=[];
  this.LecturesNames=[];
   for (let course of this.coursesA) {
      if (course.course_name==this.courseSelect){
        this.coursesChose.push(course);
        this.LecturesNames.push(course.lecture_name);
        console.log(this.LecturesNames);
      }       
  }
    this.coursesA = this.coursesChose; 
  this.LecturesNames = this.LecturesNames.filter(function(elem, index, self) {
                  return index == self.indexOf(elem);
              })
  console.log(this.LecturesNames);
  console.log(this.coursesChose);
  }

  public onLectureChange(){
      this.coursesA=this.coursesAD;
    //getCourses();
  this.LectureCourses=[];
    for (let course of this.coursesA) {
      if (course.lecture_name==this.lectureSelect){
        this.LectureCourses.push(course);
      }
         this.coursesA = this.LectureCourses;
  }
  }
  public addDep(){}
  public onSemChange(){
   let semester=JSON.stringify({'semester':this.semester});
   console.log(semester);
   this.getCourses(semester);

  }
}

这是我的课程 - data.ts

    import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/add/operator/map';

/*
  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 {
  public data: any = null;

  constructor(public http: Http) {
    console.log('Hello CoursesData Provider');
  }

      LoadData(data:any){
            let link = "http://adirzoari.16mb.com/selectCourses.php";
            return this.http.post(link,data)
                .map(res => res.json());

      }

    }

当我尝试在网络上运行它时,它运行正常(当我运行&#34;离子运行服务&#34;)但是当我运行&#34;离子运行android&#34;它失败了。

0 个答案:

没有答案