ionic2 loading控件出错

import { Component } from '@angular/core';


import { NavController , LoadingController } from 'ionic-angular';


@Component({

  selector: 'page-contact',

  templateUrl: 'contact.html'

})

export class ContactPage {


  constructor(public NavCtrl:NavController,public LoadCtrl:LoadingController) {

  this.user = {};

    this.user.username = "";

    this.user.password = "";

  this.NavCtrl = NavCtrl;

  }  

  

  showFill(){  

  let loading = this.LoadCtrl.create({

      content:"...",

      duration:3000

    });


    loading.present();


    setTimeout(()=>{

      loading.dismiss();

    },3000);

  }

}这样写有什么错误吗?

johnwei0912
浏览 1912回答 3
3回答

1160124424

export class ContactPage {    user:any;  constructor(public NavCtrl:NavController,public LoadCtrl:LoadingController) {        this.user = {};            this.user.username = "";            this.user.password = "";          }  }

sdwsq

@Component({  selector: 'page-contact',  templateUrl: 'contact.html'})@应该是没有这个吧?

johnwei0912

提示user没有定义,我用的Ionic2
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

WebApp