In NestedTypes, model.id is assignable property, linked to model.attributes[ model.idAttribute ].
model.id = 5 has the same effect as model.set( model.idAttribute, 5 )
NestedTypes creates native property for every attribute.
model.attr = val; has the same effect as model.set( 'attr', val );
val = model.attr; has the same effect as val = model.get( 'attr' );
Accessing attributes with native properties is faster than using get and set.
Set model attributes. Update sequence is fo
- Values are converted to proper types. For existing nested models and collections
deep updatemay be invoked. - Set hooks are being executed for changing attributes.
- Events are being registered for changing attributes.
- Attribute values are being set, firing change events.
In NestedTypes, you can assign model attributes directly, and it's faster than set:
model.attr = val;
Get attribute value by name. Returned value can be modified with get hook in attribute definition.
In NestedTypes, you can access model attributes directly, and it's faster than get:
val = model.attr;