Skip to content

Instantly share code, notes, and snippets.

@dz1984
Created January 9, 2014 10:30
Show Gist options
  • Select an option

  • Save dz1984/8332219 to your computer and use it in GitHub Desktop.

Select an option

Save dz1984/8332219 to your computer and use it in GitHub Desktop.
An In-Depth Introduction To Ember.js by Julien Knebel隨手筆記。

An In-Depth Introduction To Ember.js by Julien Knebel 筆記

  • Controller從Router取得Model,作為Model與View/Template之間橋樑。
  • Controller若不宣告,EmberJS會自動產生。
  • 要留意resouce是routes群組且允許巢狀,同時也重新設定巢狀命名為最後的resource name。
  • modelFor方法可以讓你使用別的Route的Model。
  • Actions是在目前Controller觸發相關聯Method的事件,若在Controller沒發現Method,就會透過Route將action往上傳遞直到配對為止。
  • 從Route切換和從Controller切換有點小方地不一樣。
// from a route
this.transitionTo('your.route')
// from a controller
this.transitionToRoute('your.route')
  • renderTemplate能夠route相關聯的特定樣版。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment