This file contains 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
//Controller | |
import Em from 'ember'; | |
function concatProperties(key1, key2) { | |
return Em.computed(key1, key2, function() { | |
return this.get(key1) + ' ' + this.get(key2); | |
}); | |
} |
This file contains 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' | |
}); |
This file contains 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 Em from 'ember'; | |
import Metrics from 'myapp/models/metrics'; | |
var FrontendStatsService = Em.Service.extend({ | |
stats: {}, | |
timings: {}, | |
start: function(key) { | |
if(window.performance) { | |
if(this.timings[key] === undefined) { //skip the first so we're not capturing data when loading the app |
This file contains 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'; | |
//the foods array will concatinate, the colours are replaced | |
let Animal = Ember.Object.extend({ | |
concatenatedProperties: ['foods'], | |
colours: ['white'], | |
foods: ['milk'] | |
}); |
This file contains 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
with `react-native`: | |
npm set progress=false && rm -rf ~/.npm && rm -rf node_modules && npm cache clean && time npm install | |
npm install 83.72s user 26.03s system 100% cpu 1:49.32 total | |
npm set progress=true && rm -rf ~/.npm && rm -rf node_modules && npm cache clean && time npm install | |
npm install 199.30s user 27.32s system 91% cpu 4:08.29 total | |
-- |
This file contains 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', | |
myComponentName: null, | |
actions: { | |
registerComponent() { | |
let template = Ember.Handlebars.compile('<b>First x-foo</b>'); |
This file contains 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', | |
myComponentName: null, | |
actions: { | |
registerComponent() { | |
let template = Ember.Handlebars.compile('<b>First x-foo</b>'); |
This file contains 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' | |
}); |
This file contains 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({ | |
enabled: false, | |
trueValue: 'T', | |
falseValue: 'F' | |
}); |
This file contains 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({ | |
enabled: false, | |
items: ['a'], | |
isNotEmpty: Ember.computed.notEmpty('items'), | |
actions: { | |
addItem: function() { | |
this.get('items').pushObject('another'); |