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({ | |
queryParams: ['value'], | |
appName: 'Ember Twiddle', | |
value: 0, | |
actions: { | |
incrementValue: function() { | |
let pastValue = this.get('value'); |
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
destroy: function() { | |
for (var i=0, l=this.children.length; i<l; i++) { | |
this.children[i].destroy(); | |
} | |
this.children = []; | |
eachDestroyable(this, function(item) { | |
item.destroy(); | |
}); |
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 User = DS.Model.extend({ | |
messages: DS.hasMany('message', {polymorphic: true}) | |
}); | |
var Message = DS.Model.extend({ | |
user: DS.belongsTo('user'), | |
body: DS.attr() | |
}); | |
var Post = Message.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
#!/usr/bin/env node | |
var cordova_util = require('cordova/src/util'); | |
var ConfigParser = require('cordova/src/ConfigParser'); | |
var projectRoot = cordova_util.isCordova(process.cwd()); | |
var projectXml = cordova_util.projectConfig(projectRoot); | |
var projectConfig = new ConfigParser(projectXml); | |
projectConfig.name(); | |
var fs = require ('fs'); |
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
test:start | |
Promise #0 | |
asap:queue callback for Promise #0. function publishFulfillment(promise) { | |
publish(promise, promise._state = FULFILLED); | |
} | |
Promise #1 | |
asap:flush 1 | |
asap:flush callback for Promise #0. function publishFulfillment(promise) { | |
publish(promise, promise._state = FULFILLED); | |
} |
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
test("The store can save an async polymorphic belongsTo association", function() { | |
ajaxResponse({ my_post: { id: "1", name: "Awesome" } }); | |
var post = store.push('myPost', { id: "1", name: "OMG" }); | |
var comment = store.createRecord('myComment', { id: "2", name: "Awesome"}); | |
comment.set('message', post); | |
comment.save().then(async(function(comment) { | |
ajaxParams = lastAjaxCall(); | |
equal(ajaxParams.passedUrl, "/my_comments"); |
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
DS.attr = function(type, options) { | |
var transform = DS.attr.transforms[type]; | |
ember_assert("Could not find model attribute of type " + type, !!transform); | |
var transformFrom = transform.from; | |
var transformTo = transform.to; | |
options = options || {}; |