How to reference a model in Ember.js? -
I am working through the DOOMVC and in the code given below, just do not understand that Does it refer to I Usually Example: and so on. II. another P. s. I tried, but I think I have not succeeded. :) I'am sorry. It refers to var model = this.get ('model'); . controller or root if this is the controller , then where do we go from Does the model work with x controller y ?
Todos.Dad Controller = Amber.Object Controller Adended ({complete: function (key, value) {var model = this.get ('model'); ...} .property ('Model.isCompleted')}); this inside amber.office function means that Ember.Object (code Todos.TodoController An example of ). / P>
App. Some RURTE = M. Route.ex ({active: function} (this; // this is the app. Some root frequency reference.}}); App.SomeController = Em.Controller.extend ({someMethod: function () {this ; // This is the app. Some controller example referees.}};; App.SomeView = Em.View.extend ({someMethod: function () {this is; // This app is a example example ref.}}); this.get ('model') is just a property Controller (if you want you can set any value for that property) * A Prior to end v1.7, the model was a ember.computed.alias which was on the property of a controller called content , but this latest amber version In behavior./P> model property, in Em.Route , it is different from Em.ObjectController.model Actually, this is the function to be applied in routing order, which gives data, which Em.Route a controller.model to hook Use to set property em in C does .Route . Therefore, the output of this.get ('model') inside Em.Route will be a function.
Comments
Post a Comment