如何使用ionic2在方法中调用构造函数?

时间:2016-12-09 10:24:10

标签: ionic2

我是离子2的新手,我们想在方法中调用构造函数,如何调用

export class OtpPage {
    constructor(public navCtrl: NavController, public navParams: NavParams,
                public formBuilder:FormBuilder, public logger: Logger,
                public rest: Rest) {

         this.customer_id=this.navParams.get('customer_id');
         this.mobile=this.navParams.get('mobile');
         this.myForm = formBuilder.group({
            'otpNumber': ['', Validators.required]
         });

        submit() {
            if(result.status=='1'){ 
                this.firstDiv=false;
                this.secondDiv = true;
                this.logger.debug("checking access tocken "+   
                this.access_token);
                alert("otp success");
        }
  }

在这些if循环中如何在this.secondDiv = true

时调用构造函数

0 个答案:

没有答案