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({ | |
queryParams: ['foo', 'bar'] | |
}); |
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({ | |
observerCounter: 0, | |
nameObserver: Ember.observer('model.firstName', 'model.lastName', function(){ | |
this.incrementProperty('observerCounter'); | |
console.log('observer counter: ', this.get('observerCounter')); | |
}), | |
computedCounter: 0, | |
nameComputed: Ember.computed('model.firstName', 'model.lastName', function(){ |
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({ | |
}); |
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', | |
locations: [ | |
Ember.Object.create({id: 1,name: `me - 1`, merchantId: 1 }), | |
Ember.Object.create({id: 2,name: `me - 2`, merchantId: 1 }), | |
Ember.Object.create({id: 3,name: `me - 3`, merchantId: 2 }), | |
Ember.Object.create({id: 4,name: `me - 4`, merchantId: 2 }), | |
], |
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', | |
someFunc(){ | |
console.log('some func'); | |
}, | |
actions: { | |
someAction(){ | |
console.log('some action'); |
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: 'Input Action', | |
actions: { | |
updateFirstName(){ | |
let firstName = this.get('firstName') || ''; | |
console.log('firstName ', firstName); | |
} | |
} |
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: 'Notifying a property change on a property passed into a child component', | |
description: 'There is a parent component with some buttons. When a user clicks on a button, the buttons\'s action changes the property. Since the changed property is passed into the wrapped component, you would expect that it\'s observer would fire also. But it does not. To try this, just type in 1233 and you will see that the last 3 will not render.' | |
}); |
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'; | |
import Ember from 'ember'; | |
export default DS.Model.extend({ | |
// Attributes | |
first_name: DS.attr('string'), | |
middle_name: DS.attr('string'), | |
last_name: DS.attr('string'), | |
notes: DS.attr('string'), | |
date_of_birth: DS.attr('date'), |
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.RESTSerializer.extend(DS.EmbeddedRecordsMixin, { | |
primaryKey: 'ID', | |
extractArray: function(store, type, payload) { | |
var payloadTemp = {}; | |
payloadTemp[type.typeKey] = payload; | |
return this._super(store, type, payloadTemp); | |
}, | |
extractSingle: function(store, type, payload, id) { |
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
.history-items .history-item:not(:first-child) { | |
margin-top: 0; | |
} |