Aliased Properties
'use strict';
polarity.export = PolarityComponent.extend({
details: Ember.computed.alias('block.data.details')
});<div>
{{details.stuff}} is the same as {{block.data.details.stuff}}
</div>'use strict';
polarity.export = PolarityComponent.extend({
details: Ember.computed.alias('block.data.details')
severityColor: Ember.computed('details', function(){
// here we can access 'details' directly because of our alias
// without the alias we would need to explicitly request
// `block.data.details.severity'
let severity = this.get('details.severity');
return severity > 50 ? "red" : "green";
});
});Last updated