Skip to content

Instantly share code, notes, and snippets.

Robert Jackson rwjblue

Block or report user

Report or block rwjblue

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View components.checkbox-component.js
import Ember from 'ember';
export default Ember.Component.extend({});
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super();
this.set('bar', { foo: 'stuff' });
this.set('keys', Object.keys(Ember.get(this, 'bar')));
},
actions: {
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super();
this.set('bar', { foo: 'stuff' });
},
actions: {
foo() {
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
save: function() {
alert('saving ' + this.get('foo'));
}
}
});
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
updateCount: 0,
didUpdateAttrs() {
this._super(...arguments)
console.log("didUpdateAttrs", this.updateCount)
debugger
this.updateCount++;
}
View components.x-inner.js
import Ember from 'ember';
let uuid = 0;
export default Ember.Component.extend({
init() {
this._super(...arguments);
this.count = 0;
},
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({
You can’t perform that action at this time.