1

i have course-page.ts and course-data.ts. course-page get data from course-data.ts. i looking to build my app with "ionic run android" but it's failed. it shows me this error

   [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

this is my course-page.ts

> 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);

  }
}

that's my course-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());

      }

    }

when i try to run this in web it's works fine(when i run "ionic run serve") but when i run "ionic run android" it failed.

Manspof
  • 598
  • 26
  • 81
  • 173
  • Include ".tmp/pages/courses-page/courses-page.ngfactory.ts" file so that it will be easy for finding the error. Error "Supplied parameters do not match any signature of call target" occurs when the number of parameters in the calling function does not match with the number of parameters in called function – AishApp Nov 10 '16 at 05:27

0 Answers0