2014年10月28日 星期二

AngularJS 2.0 is coming soon...

  上週 ng-europe 介紹了 angularJS 2.0 的 spec。才正想要好好寫一篇關於 directive 的文章,看完 angularJS 2.0 的介紹後.... 只能說還沒開始用 angularJS 又想要用的人似乎可以暫緩一下腳步了... 因為 2.0 和 1.3 是道道地地的不一樣阿...
  這邊幫大家迅速整理了差別,看完之後你就會明白了

angularJS 2.0 使用了新的語法:

"


"

  發現了嗎?ng-model, ng-click 全不見啦!!因為這樣 value 這個東西就不會暴露在 DOM attribute 裡面囉。
不過最可怕的還是... angularJS 的架構幾乎是全改了...

從angularJS 2.0 開始


  1. 沒有 controller 
  2. 沒有 directive definition object
  3. 沒有 $scope
  4. 沒有 angular.module
  5. 沒有 jqLite

  其實沒 jqLite 是可以理解,因為真的在開發專案時通常都會使用 jquery 而捨棄 jqLite,不過其他稱之為 angularJS 精髓的概念全都拿掉了,而且1.3 到 2.0 是沒有 migration patch 的!所以想學習 angularJS 的developer 可以再觀望一下會比較好喔~
 
  至於已經有在用且花好長一段時間研究的其他人,只能說...又有新的架構準備要學啦!唯一比較不絕望的事情是,在 angularJS 2.0 Final 釋出後,至少 angularJS 團隊還是會繼續 support bug fixes 和 security patches.

  最後想了解更多的人請去參考 references 囉!

References

沒有留言:

張貼留言