This file contains 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
var classify = Ember.String.classify, | |
decamelize = Ember.String.decamelize, | |
assert = Ember.assert; | |
var resolveFactory = function(namespace) { | |
return function(parsedName) { | |
var className = classify(parsedName.name) + classify(parsedName.type), | |
moduleName = namespace + '/' + parsedName.type + 's/' + parsedName.name, | |
factory; |
This file contains 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({ | |
model: null, | |
text: '', | |
actions: { | |
addComment() { | |
let text = this.get('text'); | |
let comment = this.store.createRecord('comment', { text }); |
This file contains 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({ | |
model: null, | |
text: '', | |
actions: { | |
addComment() { | |
let text = this.get('text'); | |
let comment = this.store.createRecord('comment', { text }); |
This file contains 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({ | |
}); |
This file contains 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({ | |
didReceiveAttrs() { | |
this._super(...arguments); | |
this.set('downstream', this.get('upstream')); | |
} | |
}); |
This file contains 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' | |
}); |
This file contains 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({ | |
posts: Ember.A([ | |
Ember.Object.create({ author: { name: 'steve' } }), | |
Ember.Object.create({ author: { name: 'jill' } }), | |
Ember.Object.create({ author: { name: 'andy' } }) | |
]), | |
authors: Ember.computed.mapBy('posts', 'author'), |
This file contains 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({ | |
tagName: 'button' | |
}); |
This file contains 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
// The home page needs to load a lot of data for a feed of events. | |
// This would block initial rendering of the application, so what | |
// we do is make a pathless child route called feed that loads the | |
// data. | |
// Since our home route doesn't load data anymore it renders | |
// immediately. It has an {{outlet}}, and while 'home.feed' is | |
// fetching data 'home.loading' will be rendered into the | |
// outlet. Once feed's model hook fulfills the feed template | |
// is rendered to the outlet. |
This file contains 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: 'x' | |
}); |