EmberJS + SPA

689 views

Published on

Apresentação sobre EmberJS e Single Pages Applications (SPA)

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
689
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
7
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • 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:
  • EmberJS + SPA

    1. 1. Rodolfo Fadino
    2. 2.     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
    3. 3.  Microsoft ◦ ◦ ◦ ◦ ◦ Web API Templates Padrões Web => Windows TypeScript Node.JS
    4. 4.    Biblioteca MVC pattern Core: ◦ ◦ ◦ ◦ ◦ TEMPLATES VIEWS CONTROLLERS MODELS ROUTER
    5. 5.  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.
    6. 6.  Scripts em oito camadas: ◦ webapi_adapter.js, webapi_serializer.js: ◦ Scripts/helpers.js: ◦ Scripts/app.js: ◦ Scripts/app/models/*.js ◦ Scripts/app/views/*.js ◦ Scripts/app/controllers/*.js ◦ Scripts/app/routes, Scripts/app/router.js ◦ Templates/*.html

    ×