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
function loadScenarioViewController(project, model, actionDefinition) { | |
var controller, store = App.TestHelper.lookupStore(), | |
router = App.__container__.lookup('router:main'), | |
commander = App.Commander.create({store: store}), | |
App.__container__.register("controller:project", Ember.ObjectController.extend({content: project})); | |
controller = App.ScenarioController.create({ | |
container: App.__container__, | |
target: router, | |
content: model, |
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
App.Event = DS.Model.extend({ | |
user: DS.belongsTo('user'), | |
project: DS.belongsTo('project', {inverse: null}) | |
}); | |
App.Project = DS.Model.extend({ | |
users: DS.hasMany('user', { async: true, inverse: null}), | |
administrators: DS.hasMany('user', { async: true, inverse: null}), | |
}); |
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
test("When deleting a record that has a belongsTo relationship, the record is removed from the inverse but still has access to its own relationship - async", function () { | |
User.reopen({ | |
observesBestFriend: Ember.observer('bestFriend', function () { | |
this.get('bestFriend'); | |
}) | |
}); | |
var stanleysFriend = store.push('user', {id:2, name: "Stanley's friend"}); | |
var stanley = store.push('user', {id:1, name: 'Stanley', bestFriend:2}); | |
stanley.deleteRecord(); | |
stanleysFriend.get('bestFriend').then(async(function(fetchedUser) { |
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'; | |
var things = [{id: 42, name: 'blah'}, | |
{id: 43, name: 'oh'}, | |
{id: 44, name: 'ah'}]; | |
var things= [42,43, 44] | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', |
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'; | |
var array = [{id: 42, name: 'blah'}, | |
{id: 43, name: 'oh'}, | |
{id: 44, name: 'ah'}]; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
someProp: true, |
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', | |
owner: Ember.computed(function() { | |
return this.store.createRecord('owner'); | |
}), | |
init() { |
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'; | |
const { computed } = Ember; | |
export default Ember.Controller.extend({ | |
commentArray: computed('model.comments.[]', function() { | |
return this.get('model.comments').toArray(); | |
}), | |
favourites: computed.filterBy('model.comments', 'isFavourite'), | |
favouritesHack: computed.filterBy('commentArray', 'isFavourite'), | |
}); |
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'; | |
var FilePath = Em.Object.extend({ | |
default: null, | |
fileName: Em.computed.oneWay('default'), | |
path: Em.computed('fileName', function() { | |
return '/path/' + this.get('fileName'); | |
}) | |
}); |
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.Component.extend({ | |
store: Ember.inject.service(), | |
init() { | |
this._super(...arguments); | |
this.get('store').push({data: [{ | |
id: 42, | |
type: 'plic', |
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
"_args": [ | |
[ | |
"ember-data@^2.3.1", | |
"/Users/sma01/work/frontend" | |
] | |
], | |
"_from": "ember-data@>=2.3.1 <3.0.0", | |
"_id": "[email protected]", | |
"_inCache": true, |
OlderNewer