Created
May 16, 2017 17:26
-
-
Save quincyle/17f943579501e2d03b54c78b4f1b1879 to your computer and use it in GitHub Desktop.
cp1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
cpToRender: Ember.computed('selectedLink', function(){ | |
console.log('componet cp') | |
return this.get('selectedLink.count') | |
}) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
count: 0, | |
count1: 0, | |
count2: 0, | |
obj: Ember.Object.create({ | |
count: 0 | |
}), | |
selectedLink: Ember.computed('count', function() { | |
return {} | |
}), | |
localCp: Ember.computed('selectedLink', function() { | |
return this.get('obj').set('count', this.get('count')) | |
}), | |
actions: { | |
increaseCount () { | |
this.set('count1', this.get('count1') + 1) | |
this.set('count', this.get('count') + 1) | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.12.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.8.2", | |
"ember-template-compiler": "2.8.2", | |
"ember-testing": "2.8.2" | |
}, | |
"addons": { | |
"ember-data": "2.12.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment