Instantly share code, notes, and snippets.

View controllers.application.js
import Ember from 'ember';
let RowItem = Ember.Object.extend({
order: 0
});
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
sortDirection: 'asc',
items: Ember.computed(function(){
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
updateValue(event) {
let newValue = event.target.value;
let sanitizedValue = newValue.replace(/[^a-zA-Z0-9-]/, '');
if (newValue !== sanitizedValue) {
event.target.value = sanitizedValue;
}
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
log(msg) {
alert(msg);
}
}
View controllers.application.js
import Ember from 'ember';
import DS from 'ember-data';
import MyNativeClassModel from '../models/my-native-class-model';
import MyEmberObjectModel from '../models/my-ember-object-model';
function isModel(TestModel) {
return TestModel !== DS.Model && DS.Model.detect(TestModel);
}
export default Ember.Controller.extend({
View controllers.application.js
import Ember from 'ember';
const Controller = Ember.Controller.extend({
appName: 'Ember Twiddle',
_foo: 0,
bar: 0,
// foo: Ember.computed({
// get() {
View controllers.application.js
import Ember from 'ember';
let deprecations = [];
Ember.Debug.registerDeprecationHandler((message, options, next) => {
deprecations.pushObject(message);
next();
});
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
});
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({
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});