File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 1- import { Component , OnInit } from '@angular/core' ;
1+ import { AfterContentInit , Component , OnInit } from '@angular/core' ;
22import { AlertController , NavController , NavParams } from 'ionic-angular' ;
33import { PhoneService } from '../../services/phone' ;
44import { ProfilePage } from '../profile/profile' ;
@@ -7,7 +7,7 @@ import { ProfilePage } from '../profile/profile';
77 selector : 'verification' ,
88 templateUrl : 'verification.html'
99} )
10- export class VerificationPage implements OnInit {
10+ export class VerificationPage implements OnInit , AfterContentInit {
1111 private code : string = '' ;
1212 private phone : string ;
1313
@@ -22,6 +22,19 @@ export class VerificationPage implements OnInit {
2222 this . phone = this . navParams . get ( 'phone' ) ;
2323 }
2424
25+ ngAfterContentInit ( ) {
26+ this . phoneService . getSMS ( )
27+ . then ( ( code : string ) => {
28+ this . code = code ;
29+ this . verify ( ) ;
30+ } )
31+ . catch ( ( e : Error ) => {
32+ if ( e ) {
33+ console . error ( e . message ) ;
34+ }
35+ } ) ;
36+ }
37+
2538 onInputKeypress ( { keyCode} : KeyboardEvent ) : void {
2639 if ( keyCode === 13 ) {
2740 this . verify ( ) ;
You can’t perform that action at this time.
0 commit comments