📜  EmberJS-对象模型

📅  最后修改于: 2020-10-25 11:01:07             🧑  作者: Mango


在Ember.js中,所有对象均来自Ember.Object。面向对象的分析和设计技术称为对象建模。通过使用类系统,Ember.Object支持诸如混合功能和构造方法之类的功能。 Ember使用Ember.Enumerable接口扩展JavaScript Array原型以提供对数组的观察更改,还使用格式化和本地化方法扩展String原型

下表列出了Ember.js中不同类型的对象模型及其描述-

S.No. Types & Description
1 Classes and Instances

Class is a template or blue print, that has a collection of variables and functions, whereas instances are related to the object of that class. You can create new Ember class by using the Ember.Object’s extend() method.

2 Reopening Classes and Instances

This is nothing but updating the class implementation without redefining it.

3 Computed Properties

A computed property declares functions as properties and Ember.js automatically calls the computed properties when needed and combines one or more properties in one variable.

4 Computed Properties and Aggregate Data

The computed property accesses all items in an array to determine its value.

5 Observers

The observer observes the property such as computed properties and updates the text of the computed property.

6 Bindings

The binding is a powerful feature of Ember.js which helps to create a link between two properties and if one of the properties gets changed, the other one is updated automatically.