[轉]observables-in-ionic2

https://www.joshmorony.com/building-mobile-apps-with-ionic-2/observables-in-ionic2.html this.http.get(url).subscribe( (data) => { console.log(data); }, (err) => { console.log(err); }, () => { console.log(“completed”); } ); In the code above the first event handler handles the onNext response, which basically means “when we detect the next bit of data emitted from the stream, do this”. The second handler handles the onError response, which as you might have guessed will be triggered when an error occurs. The final handler handles the onCompleted event, which will trigger once the Observable has returned all of its data. ...

2016-12-17 · 1 min · 90 words · Me

ionic2 angularfire example better than google example

https://github.com/rodrigoreal/ionic2-angularfire-login ========== https://github.com/angular/angularfire2/issues/560 https://blog.khophi.co/angularfire2-authentication/ https://github.com/angular/angularfire2/issues/568 https://github.com/angular/angularfire2/issues/566

2016-12-16 · 1 min · 6 words · Me

AngularFire ionic2 auth

Very Important !! use subscribe constructor(public af: AngularFire) { af.auth.subscribe((authstate) => { console.log(authstate); authstate == null ? logout() : login(authstate.auth.displayName); }); } And Think change to Callback mode …………. ========== First : everyone use af.auth.getauth() , then check, have value is login, null is not login. But it’s mistack. Reload page, Change page AngularFire miss…… af.auth be free. Only login page can get af.auth Second: af.auth.subscribe ( ……. ) When auth check finish, run subscribe ( ….. ) This is real get auth. But Think login different First way…….. ...

2016-12-15 · 1 min · 89 words · Me

ionic run android gives Property … does not exist on type ‘{ [key: string]: AbstractControl; }’

ionic run android gives Property … does not exist on type ‘{ [key: string]: AbstractControl; }’ https://forum.ionicframework.com/t/property-does-not-exist-on-type-key-string-abstractcontrol/65783 http://stackoverflow.com/questions/39881367/property-does-not-exist-on-type-key-string-abstractcontrol/39886710 I Test Finish: 1、In ts files, still use loginForm: FormGroup; 2、loginForm.controls.password.valid -> loginForm.get(‘password’).valid

2016-12-14 · 1 min · 31 words · Me

CTJS2016 新手上路之 40 分鐘學會 Angular 2 網站開發框架 '

https://www.youtube.com/watch?v=IQYYHLtpiAQ http://www.slideshare.net/WillHuangTW/ctjs-javascript-conference-happy-coding-with-angular-2 https://github.com/doggy8088/ctjs2016-ng2demo 非常建議值得一看,非常容易了解,非常清楚

2016-07-13 · 1 min · 4 words · Me