ngc'''''''''''''''''''''''''''''''''''''' Ionic2

时间:2016-12-04 04:43:11

标签: android angular typescript build ionic2

我试图在离子2 RC2.0这个代码中运行离子运行android并且它失败了..需要帮助

错误:

c:\Ionic\MedicalMaster>ionic run android

> ionic-hello-world@ 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! ionic-hello-world@ ionic:build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-hello-world@ 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

我的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;
          }
        }

这是admin.ngfactory.ts

中的第546:65行
   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;
}

'属性'键''类型'HomePage'上不存在。'

1 个答案:

答案 0 :(得分:0)

检查您的rem Make the win32_localtime output all one line, though some versions may contain blank lines as well. rem So ignore blank lines and just pick up the number after the equal sign. for /f "delims== tokens=2" %%a in ('wmic path win32_localtime get dayofweek /format:list') do ( rem Increment the DOW as it is documented to be a zero-based index starting with Sunday. set /a DayOfWeekIndex=%%a+1 ) rem Also get name day of week. The DOW coming in is now a one-based index. rem This is used to reference the "array" of week day names. set DayOfWeekNames=Sun Mon Tue Wed Thu Fri Sat for /f "tokens=%DayOfWeekIndex%" %%b in ("%DayOfWeekNames%") do ( set DayOfWeekName=%%b ) ,看看它是否正在尝试使用您admin.html课程中的属性key(以及其中不存在的属性)。