关于何时使用Ember.Controller
以及何时使用Ember.ArrayController
及其用法,我没有明显区别。
With a Controller, you could do {{#each item in model}}
in your template.
With ArrayController, you could simply do {{#each item}}
.
Could. ArrayController is deprecated because it was obscuring the logic, you should never use it. The Controller is also being deprecated in favor of routeable components, somewhere in Ember 2.1 or 2.2.
Current strategy is the following:
setupController
. Instead, put everything into a model, turning it into a hash of models. RSVP.hash
is your friend. PS The syntax for each
is changing to {{#each model as |item|}}
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.