Ember.js: Using Note 5 using view

Source: Internet
Author: User

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:
      • TagName
    • 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.