Forked from sglanzer-deprecated/components.my-component.js
Last active
April 8, 2018 14:09
-
-
Save fredguth/6c3ef8a55c81fb4704c57f31f722b7ba to your computer and use it in GitHub Desktop.
Arbitrary properties set via an object hash
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({ | |
notMyInput: Ember.computed('myInput', function() { | |
return !this.get('myInput') | |
}) | |
}); |
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 fabric from 'fabric'; | |
export default Ember.Controller.extend({ | |
parentInput: true, | |
didInsertElement() { | |
let canvas = new fabric.Canvas('pad', { | |
isDrawingMode: false | |
}); | |
var redRect = new fabric.Rect({ | |
width: w, | |
height: h, | |
fill: 'red', | |
top: 15, | |
left: 50 | |
}); | |
var blueRect = new fabric.Rect({ | |
width: 20, | |
height: 30, | |
fill: 'blue', | |
top: 15, | |
left: 50 + w - 10 | |
}); | |
canvas.add(redRect); | |
canvas.add(blueRect); | |
this.set('canvas', canvas); | |
}, | |
actions: { | |
changeInput() { | |
this.set( | |
'parentInput',!this.get('parentInput') | |
) | |
}, | |
onObjectDblClick(event) { | |
} | |
} | |
}); |
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 function destroyApp(application) { | |
Ember.run(application, 'destroy'); | |
} |
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 Resolver from '../../resolver'; | |
import config from '../../config/environment'; | |
const resolver = Resolver.create(); | |
resolver.namespace = { | |
modulePrefix: config.modulePrefix, | |
podModulePrefix: config.podModulePrefix | |
}; | |
export default resolver; |
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 Application from '../../app'; | |
import config from '../../config/environment'; | |
const { run } = Ember; | |
const assign = Ember.assign || Ember.merge; | |
export default function startApp(attrs) { | |
let application; | |
let attributes = assign({rootElement: "#test-root"}, config.APP); | |
attributes = assign(attributes, attrs); // use defaults, but you can override; | |
run(() => { | |
application = Application.create(attributes); | |
application.setupForTesting(); | |
application.injectTestHelpers(); | |
}); | |
return application; | |
} |
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 resolver from './helpers/resolver'; | |
import { | |
setResolver | |
} from 'ember-qunit'; | |
setResolver(resolver); |
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.10.4", | |
"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.7.0", | |
"ember-data": "2.7.0", | |
"ember-template-compiler": "2.7.0" | |
}, | |
"addons": { | |
"ember-cli-fabric2-shim": "^0.2.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment