-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathapplication.js
More file actions
37 lines (30 loc) · 962 Bytes
/
application.js
File metadata and controls
37 lines (30 loc) · 962 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
37
import Ember from 'ember';
import { merge } from '@ember/polyfills';
import { map } from '@ember/object/computed';
export default Ember.Controller.extend({
controllerProperty: 'test',
fullName: computed(function() {
return `${this.firstName} ${this.lastName}`;
}).property('firstName', 'lastName'),
fullName2: computed(function() {
return `${this.firstName} ${this.lastName}`;
}).volatile('firstName', 'lastName'),
friendNames: map('friends', function(friend) {
return friend[this.nameKey];
}).property('nameKey'),
actions: {
foo(object) {
Ember.propertyWillChange(object, 'someProperty');
this.doStuff(object);
Ember.propertyDidChange(object, 'someProperty');
object.propertyWillChange('someProperty');
this.doStuff(object);
object.propertyDidChange('someProperty');
},
bar() {
let a = { first: 'Yehuda' };
let b = { last: 'Katz' };
merge(a, b);
}
}
});