-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathapplication.js
More file actions
36 lines (29 loc) · 837 Bytes
/
application.js
File metadata and controls
36 lines (29 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import Controller from '@ember/controller';
import Ember from 'ember';
import { assign } from '@ember/polyfills';
import { map } from '@ember/object/computed';
export default Controller.extend({
controllerProperty: 'test',
fullName: computed('firstName', 'lastName', function() {
return `${this.firstName} ${this.lastName}`;
}),
get fullName2() {
return `${this.firstName} ${this.lastName}`;
},
friendNames: map('friends', ['nameKey'], function(friend) {
return friend[this.nameKey];
}),
actions: {
foo(object) {
this.doStuff(object);
Ember.notifyPropertyChange(object, 'someProperty');
this.doStuff(object);
object.notifyPropertyChange('someProperty');
},
bar() {
let a = { first: 'Yehuda' };
let b = { last: 'Katz' };
assign(a, b);
}
}
});