home
  • Blog
3.15
  • Introduction
  • Getting Started
  • Tutorial
  • Core Concepts
  • Components
  • Routing
  • Services
  • Ember Data
  • In-Depth Topics
  • Application Development
  • Application Concerns
  • Testing
  • Configuration
  • Accessibility
  • Addons and Dependencies
  • Developer Tools
  • Additional Resources
  • Upgrading
  • Contributing to Ember.js
  • Glossary
Old Guides - You are viewing the guides for Ember v3.15.0.
Go to v5.0.0

Edit pencil

One of the first things you'll notice when you generate JavaScript files in Ember is that most of the code you will write goes inside of an object. While an Ember Object might look a lot like a JavaScript class, it has some special properties.

Introducing: Ember Objects

The Ember Object class extends plain JavaScript objects to provide core framework functions such as participating in Ember's binding system or how changes to an object automatically trigger updates to the user interface.

Most objects in Ember, including Routes, Models, Services, Mixins, Controllers, and Components extend the EmberObject class.

Why Ember Objects?

The most important reason is that an Ember Object can be watched for changes – or observed. For example, being observable is important for computed properties. It is one of the fundamental ways that models, controllers and views communicate with each other in an Ember application.

More on Ember Objects

The @ember/object package also provides a class system, supporting features like mixins and constructor methods, and being observable.

Some features in Ember's object model are not present in JavaScript classes or common patterns, but all are aligned as much as possible with the language and proposed additions.

Ember also extends the JavaScript Array prototype with its @ember/enumerable interface to provide change observation for arrays.

Finally, Ember extends the String prototype with a few formatting and localization methods.

On this page

  • Introducing: Ember Objects
  • Why Ember Objects?
  • More on Ember Objects
Team Sponsors Security Legal Branding Community Guidelines
Twitter GitHub Discord Mastodon

If you want help you can contact us by email, open an issue, or get realtime help by joining the Ember Discord.

© Copyright 2023 - Tilde Inc.
Ember.js is free, open source and always will be.


Ember is generously supported by
blue