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({ | |
// {Property} List of details | |
studentDetails: null, | |
// {Property} Filtered student | |
filteredStudent: null, | |
// {Property} List of students |
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({ | |
studentDetails: null, | |
// {Property} List of students | |
students: Ember.computed('studentDetails.@each.student', function() { | |
let studentDetails = this.get('studentDetails') || []; | |
return studentDetails.getEach('student').uniq(); | |
}), |
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 DS from 'ember-data'; | |
export default DS.JSONAPIAdapter; |
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
// Normally this would be an import | |
let $ = window.$; | |
export default { | |
name: 'mockjax-setup', | |
initialize: function(application) { | |
$.mockjax({ | |
url: "/articles/1", | |
responseText: payload | |
}); |
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({ | |
classNames: 'tweet-message', | |
isDone: false, | |
actions: { | |
reTweet() { | |
this.set('isDone', true); | |
} |
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({ | |
user: null, | |
messenger: Ember.inject.service(), | |
message: '', | |
displayName: Ember.computed('user.title', 'user.firstName', 'user.lastName', function() { | |
let title = this.get('user.title'), |
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'; | |
const DEFAULT_MODEL = { | |
relationship: { | |
isFulfilled: false, | |
someValue: false | |
} | |
} | |
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
const UserModel = DS.Model.extend({ | |
displayName: attr('string') | |
}); | |
const CommentModel = DS.Model.extend({ | |
author: belongsTo('user'), | |
body: attr('string') | |
}); |
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({ | |
userSort: ['online:desc', 'displayName'], | |
sortUsers: Ember.computed.sort('model', 'userSort') | |
}); |