EExcel 丞燕快速查詢2

EExcel 丞燕快速查詢2
EExcel 丞燕快速查詢2 https://sandk.ffbizs.com/
顯示具有 angular2 標籤的文章。 顯示所有文章
顯示具有 angular2 標籤的文章。 顯示所有文章

angularfire2 subscribe once

https://github.com/angular/angularfire2/issues/380


subscription.unsubscribe();


Observable.interval + take(1)


copy keep angularfire list

Maybe

Object.assign   but sub itme only reference


So JSON.parse(JSON.stringify(theObject))

Data Binding Directive

http://www.sqeeex.com/201605/27.html

  • {{value}}  和   [property]='value'
变量绑定在Component中,只要在Component中控制变量值改变,dom中就会更新,它是单向的。

  • (event)
是事件绑定,是单向的,在dom中触发,从而告知Component。

  • [(ng-model)]或者[(ngModel)]
实现双向绑定, angular1中,我们要实现双向绑定是用ng-model="xx",angular2中从用法上来说确实只是多加了两个括号。



angular2 ionic2 angularfire2 json <-> object

authstat json <-> object

import { Storage } from '@ionic/storage';
import { FirebaseAuthState } from 'angularfire2';


// authstate  object -> json

this._auth.signInWithEmailAndPassword(this.loginForm.value.email, this.loginForm.value.password)
.then((authData: FirebaseAuthState ) => {
  this.storage.set('alluserinfo', JSON.stringify(authData));
});



//json -> authstate  object

this.storage.get('alluserinfo').then((t_value) => {
      let value: FirebaseAuthState;
      value = JSON.parse(t_value);
});

Angular2 View Not Changing After Data Is Updated

[轉]Understanding Zones and Change Detection in Ionic 2 & Angular 2

http://www.joshmorony.com/understanding-zones-and-change-detection-in-ionic-2-angular-2/


Angular2 View Not Changing After Data Is Updated


Finish Use

setTimeout(() => {
     this.msgerror = error.message;
}, 10);

[轉]Creating an Asynchronous Login Screen in Ionic 2

https://www.youtube.com/watch?v=5WK9R1y-eKg

================
http://eriyu-blog.logdown.com/posts/773548-study-of-ng2-polyfill

主要是提供ES7提出的Observables特性,

Observables提供了非同步資料fetch時的另一種做法。

我們跟伺服器端抓取完資料,要做後續的動作時,

最早的寫法是用callback,

後來改良的寫法是使用Promise減少callback hell的發生。

Promise已經很好用了,但是它還是有些缺點。

它無法做到發送request後,可以中止或是重送的功能。

它在宣告使用Promise時,就已經被執行了。

而Observables解決了Promise的這些問題,

它可以中止及重送request。

Observables在創建時不會被執行,而是實際呼叫時才被執行。

另外Observables又提供了值組的操作,像是merge、sum、map等功能。

還有Observables就如同它字面的意思,他實作觀察者模式,當資料變更時會發出通知給它的訂閱者。

官方的Angular2教學文件在非同步資料抓取,是直上ES7的規格,提供Observables的寫法,但你也可以依據你的專案需求改成Promise。

一般的專案,也許可以用Promise就能滿足了,但是如果你的專案功能是需要比較互動、即時性的時候,用上Observables就不用費太多功夫做資料的watch。

[轉]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.



etc.... just see webpage

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

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........

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

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


非常建議值得一看,非常容易了解,非常清楚