« All deprecation guides
Deprecation Guide for
Deprecate setting properties on objects generated by
Deprecation Guide for
Deprecate setting properties on objects generated by {{hash}}
Objects generated by {{hash}}
helper method no longer supports setting properties because it was defined on the original hash and is a reference to the original value. Objects generated by {{hash}}
can be considered immutable as internally it returns a Proxy object rather than an original object. You can get the same functionality by using an object created with a tracked property or getter, or with a custom helper.
Before:
app/components/greeting.js
export default class GreetingComponent extends Component {
constructor() {
super(...arguments);
const person = this.args.person;
person.firstName = 'Bruce';
person.lastName = 'Wayne';
}
}
After:
app/controllers/application.js
export default class ApplicationController extends Controller {
@tracked person = {
firstName: 'Christian',
lastName: 'Bale',
};
}