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 It refers to var model = this.get ('model'); .

Does it refer to 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')});    

I Usually this inside amber.office function means that Ember.Object (code Todos.TodoController An example of ). / P>

Example:

  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.}});   

and so on.

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

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

P. s. I tried, but I think I have not succeeded. :) I'am sorry.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -