6.
Aplicações com uma grande interação clientside (Html5, CSS3 e JavaScript)
Navegação sem refresh
Logica da aplicação client-site
Carregar dados sobre demanda
12.
Template
Model
Controller
View
Router
◦ Handlebars templating language
◦ Application user interface.
◦ Application data that it gets from the server
◦ Stores application state.
◦ Present model data to the corresponding templates.
◦ Translates primitive events from the application
◦ and passes these to the controller.
◦ Manages application state
◦ URLs and templates in sync.
The models are defined in the Scripts/app/models folder. There are two model files: todoItem.js and todoList.js.todo.model.js defines the client-side (browser) models for the to-do lists. There are two model classes: todoItem and todoList. In Ember, models are subclasses of DS.Model. A model can have properties with attributes:
The models are defined in the Scripts/app/models folder. There are two model files: todoItem.js and todoList.js.todo.model.js defines the client-side (browser) models for the to-do lists. There are two model classes: todoItem and todoList. In Ember, models are subclasses of DS.Model. A model can have properties with attributes:
Models can define relationships to other models:
Models can have observer functions, which are invoked when an observed property changes:
The views are defined in the Scripts/app/views folder. A view translates events from the application UI. An event handler can call back to controller functions, or simply call the data context directly.
The controllers are defined in the Scripts/app/controllers folder. To represent a single model, extendEmber.ObjectController:A controller can also represent a collection of models by extending Ember.ArrayController. For example, the TodoListController represents an array of todoList objects. The controller sorts by todoList ID, in descending order:
The controller defines a function named addTodoList, which creates a new todoList and adds it to the array. To see how this function gets called, open the template file named todoListTemplate.html, in the Templates folder. The following template code binds a button to the addTodoList function: