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 Controller from '@ember/controller'; | |
export default class ApplicationController extends Controller { | |
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({ | |
value: '<h1>Demo header</h1>This is some <i>italic</i> text.', | |
options: { | |
actions:[ | |
{ | |
name: 'titre', | |
icon: 'Z', | |
result: () => { |
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 Component from '@ember/component'; | |
export default Component.extend({ | |
toRemove: true, | |
actions:{ | |
updateRemove(){ | |
console.log(this.get('toRemove')); | |
} | |
} | |
}); |
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', | |
actions:{ | |
uploadFile(file){ | |
file.upload( | |
'www.test.com/fakeUpload/',{ |
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({ | |
theValue: 'the Text Value', | |
actions:{ | |
getText(arg){ | |
return arg+'_yay' | |
} | |
} | |
}); |
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.Component.extend({ | |
totalCosts:Ember.computed('pricing', | |
function(){ | |
var costs = {}; | |
costs["price"]=this.get('pricing').get('buy_price'); | |
costs["subscription"]=this.get('pricing').buy_subscription; | |
costs["perRoom"]=this.get('pricing').buy_per_room; | |
return costs; | |
}), |
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', | |
thePrice: new Pricing, | |
totalCosts:Ember.computed('pricing', | |
function(){ | |
var costs = {}; | |
costs["price"]=5; | |
costs["subscription"]=2; |
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 DS from 'ember-data'; | |
export default DS.Model.extend({ | |
costCents: DS.attr('number'), | |
cost:Ember.computed('costCents',{ | |
get(key){ | |
return this.get('costCents')/100 | |
}, | |
set(key,value){ | |
this.set('costCents',value*100) |
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', | |
theTime: new Date() | |
}); |
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.Component.extend({ | |
dateDisabled: Ember.computed('foo',function(){ | |
console.log(this.get('foo')); | |
return [ | |
function(date){ | |
//console.log(this.get('foo')); | |
let day = date.getDate() | |
if (day & 1){ |
NewerOlder