Courseware of Ember--ember.js Ling

Source: Internet
Author: User

First, Controller: Define the variable, directly in the template display var helloember = Ember.Application.create (); Helloember.applicationcontroller = Ember.Controller.extend ({greeting: "Good Morning starshine!", Happythought: "The E Arth Says hello! "});<Body>  <Div>    <ScriptType= "Text/x-handlebars"Data-template-name= "Application">      <H1>{{Greeting}}</h1>      <H3>{{Happythought}}</h3>    </Script>  </Div></Body>

<! the variables added to the-ember.controller are only valid in the main template- > second, rout in This.resource control which template displays App.Router.map (function () {    this.resource (' Hu ', {path: '/'});    Root path loading hu}); third, the controller controls which template, which is determined by its name App.hu1controller =ember.controller.extend ({     name: ' Zlg '}), "Template in Hu1" Iv. Control Action

Variable assignment in templates the second way,the model of the route , the return value can be an object, an array, a value

Controller and route both render the template, the controller takes effect andthe model of the route fails

Arraycontroller Use Example

http://emberjs.com/api/classes/Ember.ArrayController.html data URL of the API

Ember--ember.js Ling's courseware

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.