Skip to content

Instantly share code, notes, and snippets.

Avatar

Cruz Fernandez morhook

  • SCVSoft
  • Buenos Aires, Argentina
View GitHub Profile
View testem.js
/* eslint-env node */
module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: [
'Chrome'
],
launch_in_dev: [
'Chrome'
],
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
ajax: Ember.inject.service(),
startup: Ember.on('init', function() {
const ajax = this.get('ajax');
ajax.request('https://www.google.com');
})
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
items: Ember.computed('value', function() {
return [this.get('value')];
})
});
@morhook
morhook / components.my-component.js
Created Jan 12, 2017
detecting if action is passed in
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
onGo: Ember.K,
passed: Ember.computed(function() {
return this.get('onGo') !== Ember.K;
}),
click() {
console.log('clicked on my-compoent, now calling action passed');
this.get('onGo')();
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
runit() {
console.log(this.get('chequeado'));
},
checkedToggle() {
this.set('isChecked', true);
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
callmechild() {
console.log('called in child');
//this.sendAction('callmeup');
this.send('callmeup');
}
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
classNames: 'appointment'
});
View controllers.application.js
import Ember from 'ember';
const { run } = Ember;
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init() {
this._super(...arguments);
run.later(() => {
this.set('appName', 'Ember.js');
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Test mirage'
});