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({ | |
actions: { | |
test() { | |
this.set('message','successfully added'); | |
} | |
} | |
}); |
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({ | |
actions: { | |
activate(name) { | |
if(this.currentTab === name) { | |
this.set('currentTab', ''); | |
} else { | |
this.set('currentTab', name); | |
} |
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({ | |
init() { | |
this.set('checkboxList', [{VALUE: "Content", CHECKBOX_ID: 1},{VALUE: "Size", CHECKBOX_ID: 2}]); | |
}, | |
actions: { | |
test() { | |
this.set('checkboxList.0.VALUE', "Cont"); | |
} |
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'; | |
import {task, timeout} from 'ember-concurrency'; | |
export default Ember.Controller.extend({ | |
done: false, | |
didSomething: task(function * () { | |
this.set('done', false); | |
yield timeout(5000); | |
// here we know nothing had called didSomething for 5 seconds. |
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
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xsel -i --clipboard" | |
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xsel -i --clipboard" | |
bind ] run-shell "xsel --clipboard | tmux load-buffer - ; tmux paste-buffer" |
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({ | |
actions: { | |
bar() { | |
if(this.foo) { | |
this.foo(...arguments); | |
} | |
} | |
} |
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'; | |
import Mixin from '@ember/object/mixin'; | |
const Foo = Mixin.create({ | |
handleReponse:{ | |
colorURL(c){ | |
this.clean(c); | |
}, | |
clean(c){ | |
alert(c); |
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 DS from 'ember-data'; | |
export default DS.Adapter.extend({ | |
findAll() { | |
return { | |
genres: [ | |
{"id":1,"name":"Action"}, | |
{"id":2,"name":"Adventure"}, | |
{"id":3,"name":"Animation"}, | |
{"id":4,"name":"Comedy"}, |
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({ | |
selected: [], | |
actions: { | |
select(id) { | |
// this is a *bit* ugly because the child object has no relation to the parent. So there is actually not a *easy* way to get the right parent or to know if its a child or a parent. | |
// so this code basically gives us the array of elements that are valid selections. | |
// if the clicked element is a parent thats all parents (so this.data) |
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' | |
}); |