O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mastering Ember.js

Book Description

Build fast, scalable, dynamic, and ambitious single-page web applications by mastering Ember.js

In Detail

As businesses shift towards web-based solutions, there's been an increasing amount of customer needs that can only be met by sophisticated web applications. Building these applications is not easy and huge efforts have been invested in order to realize faster delivery of such applications. Ember.js is one of these efforts and acquiring expert knowledge of its key concepts will enable the realization of shorter and profitable web application development cycles.

Developing single-page web applications is about to get easier! This book introduces you to web application development using the Ember.js web framework. Mastering Ember.js will help you to utilize its full potential and will show you how to create web applications. You will learn about views, event management, logging, debugging, and error management, always focusing on best practices. Finally, you will test your application and learn how to use WebSockets with Ember.js and end the book by modularizing your project.

What You Will Learn

  • Install Ember.js and create a basic application
  • Separate concerns in web applications through the use of states
  • Create dynamic web applications
  • Easily make interactive web applications
  • Connect web applications to remote data stores
  • Make real-time web applications
  • Use REST in order to persist data
  • Discover how Ember.js logs errors and how to troubleshoot when needed
  • Package reusable web components

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Mastering Ember.js
    1. Table of Contents
    2. Mastering Ember.js
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Introduction to Ember.js
      1. The origin of Ember.js
      2. Downloading Ember.js
      3. Creating your first application
        1. Router
          1. Route
        2. Controller
        3. View
          1. Template
          2. Component
      4. Initializing the application
        1. Embedding Ember.js applications
      5. Summary
    9. 2. Understanding Ember.js Objects and Mixins
      1. Creating objects in Ember.js
      2. Accessing object properties
      3. Defining class instance methods
      4. Defining computed properties
      5. Defining property observers
      6. Creating property bindings
      7. Using mixins
      8. Reopening classes and instances
      9. Event subscription
      10. Summary
    10. 3. Routing and State Management
      1. Creating the application's router
      2. Mapping URLs to routes
      3. Nesting resources
      4. Understanding the state transition cycle
      5. Configuring the router
      6. Specifying a route's path
      7. Defining route and resource handlers
      8. Specifying a route's model
      9. Serializing resources
      10. Asynchronous routing
      11. Configuring a route's controller
      12. Rendering the route's template
      13. Redirecting state
      14. Catching routing errors
      15. Summary
    11. 4. Writing Application Templates
      1. Registering templates
      2. Inserting templates
      3. Writing out templates
      4. Expressing variables
      5. Writing bound and unbound expressions
      6. Adding comments in templates
      7. Writing conditionals
      8. Switching contexts
      9. Rendering enumerable data
      10. Writing template bindings
      11. Defining route links
      12. Registering DOM element event listeners
      13. Writing form inputs
      14. Extending templates
      15. Defining custom helpers
      16. Creating subexpressions
      17. Summary
    12. 5. Controllers
      1. Defining controllers
      2. Providing controllers with models
      3. Rendering dynamic data from controllers
        1. Properties
        2. Computed properties
        3. Observables
      4. Object and array controllers
        1. An object controller
        2. An array controller
        3. addObject(object)
        4. pushObject(object)
        5. removeObject(object)
        6. addObjects(objects), pushObjects(objects), and removeObjects(objects)
        7. contains(object)
        8. compact()
        9. every(callback)
        10. filter(object)
        11. filterBy(property)
        12. find(callback)
        13. findBy(key, value)
        14. insertAt(index, object), objectAt(index), and removeAt(index, length)
        15. map(callback)
        16. mapBy(property)
        17. forEach(function)
        18. uniq()
        19. sortProperties and sortAscending
      5. Handling event actions
      6. Specifying controller dependencies
      7. State transitions in controllers
      8. Summary
    13. 6. Views and Event Management
      1. Defining views
      2. Accessing a view's controller
      3. Specifying a view's template
      4. Specifying a view's element tag
      5. Updating a view's element class attribute
      6. Updating other views' element attributes
      7. Inserting views into DOM
      8. Inserting views into templates
      9. Specifying view layouts
      10. Registering event handlers in views
      11. Emitting actions from views
      12. Using built-in views (components)
        1. Textfields
        2. Textareas
        3. Select menus
        4. Checkboxes
        5. The container view
        6. Integrating with third-party DOM manipulation libraries
      13. Summary
    14. 7. Components
      1. Understanding components
      2. Defining a component
      3. Differentiating components from views
      4. Passing properties to components
      5. Customizing a component's element tag
      6. Customizing a component's element class
      7. Customizing a component's element attributes
      8. Managing events in components
      9. Defining component actions
      10. Interfacing a component with the rest of the application
      11. Components as layouts
      12. Summary
    15. 8. Data Persistence through REST
      1. Making Ajax requests
      2. Understanding Ember-data
      3. Ember-data namespace
      4. Creating a data store
      5. Defining models
      6. Declaring relations
        1. One to one
      7. Finding records
      8. Defining a store's adapter
      9. Creating REST APIs
      10. Customizing a store's serializer
      11. Creating custom transformations
      12. Summary
    16. 9. Logging, Debugging, and Error Management
      1. Logging and debugging
        1. Objects
        2. Router and routes
        3. Templates
        4. Controllers
        5. Views
      2. Using the Ember.js inspector
      3. Client-side tracing
      4. Error management
      5. Summary
    17. 10. Testing Your Application
      1. Writing tests
        1. Asynchronous test helpers
        2. Synchronous test helpers
        3. Wait helpers
      2. Writing unit tests
        1. Testing computed properties
        2. Testing method calls
        3. Testing observers
      3. Writing integration tests
      4. Summary
    18. 11. Building Real-time Applications
      1. Setting up Socket.io
      2. Connecting the user
      3. Summary
    19. 12. Modularizing Your Project
      1. Installing the Component build tool
      2. Code organization
      3. Installing components
      4. Building components
      5. Loading the built files
      6. Game logic
      7. Serving images and fonts
      8. Summary
    20. Index