In the case where the route has been set, take table as an example, can be set as follows, the scope of the corresponding template;
App.tableview = Em.View.extend ({}); App.tableindexview = Em.View.extend ({});
Can also be created by the following new, its obtained this is the template of this;
{{#view Innerview}} ... {{/view}} Innerview = Ember.View.extend ({});
Simple settings:
- Set the overall label:
- Set class:
- Classnames:[] (suitable for fixed values);
- Classnamebinds[] (this is to be returned through other property settings or methods, suitable for variable values), also using the method set classname in the template, such as [' isEnabled:enabled:disabled ']
- Set additional attr Properties
Set the event method: The Set method is configured on all element in view;
using templates: The writing format of the template is the same as the HTML template;
Template:Ember.Handlebars.compile (""),
Use Didinsertelement: executes after render and Dom are loaded, and there are other methods that execute at different times
Take tables and table as examples in different URL jump time execution:
- x/x, X/tables: Simultaneous execution of Tablesindexview and Tablesview;
- X/tables-x/tables/id1: Execute tableview only;
- X/TABLES/ID1---X/tables/id2: neither is executed;
- X/TABLES/ID1-x/tables: Execute Tablesindexview only;
When jumping between X/tables/id1-X/TABLES/ID2, you can define a method in the controller
Ember.js: Using Note 5 using view