2016-12-04 3 views
0

i in ionischen 2 RC2.0 diesen Code ionischen Lauf Android zu laufen versucht und es ist fehlgeschlagenngc Fehlgeschlagen 'Property' Schlüssel 'existiert nicht auf Typ' HomePage '.' Ionic2

Fehler ..need helfen:

c:\Ionic\MedicalMaster>ionic run android 

> [email protected] ionic:build c:\Ionic\MedicalMaster 
> ionic-app-scripts build 

[23:33:38] ionic-app-scripts 0.0.44 
[23:33:39] build prod started ... 
[23:33:39] clean started ... 
[23:33:39] clean finished in 135 ms 
[23:33:39] copy started ... 
[23:33:39] ngc started ... 
[23:33:51] copy finished in 12.77 s 
[23:35:28] Error: Error at c:/Ionic/MedicalMaster/.tmp/pages/admin/admin.ngfactory.ts: 
546:65 
[23:35:28] Property 'key' does not exist on type 'HomePage'. 
[23:35:28] ngc failed 
[23:35:28] ionic-app-script task: "build" 
[23:35:28] Error: Error 

npm ERR! Windows_NT 6.3.9600 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\guillermo\\AppData\\Roa 
ming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "ionic:build" 
npm ERR! node v6.9.1 
npm ERR! npm v3.10.6 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] ionic:build: `ionic-app-scripts build` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] ionic:build script 'ionic-app-scripts build'. 

npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the ionic-hello-world package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  ionic-app-scripts build 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs ionic-hello-world 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls ionic-hello-world 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  c:\Ionic\MedicalMaster\npm-debug.log 

mein admin.ts

 import { Component } from '@angular/core'; 
     import { ModalController, AlertController, LoadingController } from 'ionic-angular'; 
     import { MyService } from '../../providers/my-service'; 
     import { NavController, MenuController } from 'ionic-angular'; 
     import { Storage } from '@ionic/storage'; 
     import { ModalUpdatePage } from '../modal-update/modal-update'; 
     import { Pipe, PipeTransform } from '@angular/core'; 

     @Component({ 
      selector: 'page-admin', 
      templateUrl: 'admin.html', 
      providers: [MyService] 
     }) 
     export class HomePage { 

      public datosjson: any; 
      public datoguardadojson: any; 
      public name : any; 
      public lastname: any; 
      public id: any; 
      public mydata: any; 
      datosCita: any; 
      datosCita_prox: any; 
      string : any; 
      string_vars: any; 
      vars: any; 
      ultima: any; 
      public u: any; 
     public x: any; 
      tratamiento: any[] = []; 

      constructor(public navCtrl: NavController, 
      private loading: LoadingController, public alert: AlertController, 
      public storage: Storage, private Modelctrl: ModalController, private service: MyService, 
      public menu: MenuController) { 
      this.menu.enable(true); 

     } 
      ionViewDidLoad() { 
       this.service.checkToken() 
       .then((key: any)=>{ 
       // console.log (key); 
        this.x = key; 
        if(this.x == null){ 
        console.log("null"); 
         }else{ 
           this.name = this.storage.get('name'); 
           this.name.then((value : any)=>{ 
            this.name = value; 
            //console.log (this.name); 
           }); 
           this.lastname = this.storage.get('lastname'); 
           this.lastname.then((value:any)=>{ 
           this.lastname = value; 
           }); 
          } 
        }); 


       this.datoguardadojson = this.storage.get('datapaciente');// traigo el json del localstorage con la key jsondata 
       this.datoguardadojson.then((value:any)=>{ // y el valor se lo asigno a la variable datoguardadojson 
         this.datoguardadojson = value; 
         // this.datoguardadojson = JSON.parse(this.datoguardadojson); 
         if (this.datoguardadojson === null){ 
         console.log("debe actualizar los datos primero") 
        this.navCtrl.setRoot(ModalUpdatePage); 

         }else{ 
          console.log("ya se encuentran datos en el storage"); 
           this.datoguardadojson = this.storage.get('datapaciente'); 
           this.datoguardadojson.then((value:any)=> 
            { 
            this.datoguardadojson = value; 
            this.datoguardadojson = JSON.parse(this.datoguardadojson); 

            this.mydata = this.datoguardadojson.Citation; 
              if(Object.keys(this.mydata).length > 0){ 
              this.datosCita = this.mydata.pop(); 
              this.datosCita_prox = this.parse_extrac2(this.datosCita); 
              }else{ 
               this.datosCita_prox = "No hay datos de proximas citas"; 
              } 
           }); 
           this.ultima = this.storage.get('Acciones'); 
           this.ultima.then((value:any)=>{ 
            this.ultima = value; 
            this.ultima = JSON.parse(this.ultima); 
            if(Object.keys(this.ultima).length > 0){ 
             this.u = this.ultima.pop(); 
             this.u = this.parse_extrac(this.u); 
            }else{ 
             this.u = "No tiene notificaciones activas" 
            } 

           }) 
          } 
         }); 
      } 
      parse_extrac2(obj){ //string = json.parse(obj);//si no sirve el stringify() 
       this.string = JSON.stringify(obj); 
       this.string_vars = this.string.split(","); 
       this.vars = this.string_vars[3].split(":"); 
       //this.vars = this.string_vars[3].replace('"',''); 
       var aux = this.vars; 
       return aux[1].replace('"',""); 
      } 
      parse_extrac(obj){ //string = json.parse(obj);//si no sirve el stringify() 
       this.string = JSON.stringify(obj); 
       this.string_vars = this.string.split(","); 
       this.vars = this.string_vars[2].split(":"); 
       //this.vars = this.string_vars[3].replace('"',''); 
       var aux = this.vars; 
       return aux[1].replace('"',""); 
      } 



     } 
     @Pipe({ name:'hideC' }) 
     export class Keyspipe implements PipeTransform { 
      transform(val : any) { 
       if(!val){ 
       return ''; 
       } 
       var str = val.replace('"','') 
       return str; 
      } 
     } 

und dies ist die Zeile 546: 65 in admin.ngfactory.ts

const currVal_9:any = import5.interpolate(1,'',this.context.key,''); 
if (import5.checkBinding(throwOnChange,this._expr_9,currVal_9)) { 
    this.renderer.setText(this._text_17,currVal_9); 
    this._expr_9 = currVal_9; 
} 

'Property' Schlüssel 'existiert nicht für den Typ' HomePage '.'

+0

Haben Sie die Antwort auf Ihr Problem gefunden? Ich habe ein ähnliches Problem mit 'ngc'. –

Antwort

0

Überprüfen Sie Ihre admin.html und sehen, ob es versucht, eine Eigenschaft key von verwenden (und die nicht existiert) Ihre HomePage Klasse.

Verwandte Themen