Old Guides - You are viewing the guides for
Ember
v1.12.0.
Problem
You want to increment or decrement a property.
Solution
Use the incrementProperty
or decrementProperty
methods of Ember.Object
.
To increment:
person.incrementProperty('age');
To decrement:
person.decrementProperty('age');
Discussion
You can optionally specify a value to increment or decrement by:
person.incrementProperty('age', 10);