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
Arrayobservers = SC.Application.create({ | |
NAMESPACE: 'Arrayobservers', | |
VERSION: '0.1.0', | |
store: SC.Store.create().from(SC.Record.fixtures) | |
}); | |
Arrayobservers.objects = [SC.Object.create({foo: 1}), SC.Object.create({foo: 2})]; |
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
SC.RunLoop.begin(); | |
Arrayobservers.setPath('objects.1.foo', 5); // don't know what you are actually doing | |
SC.RunLoop.end(); | |
Arrayobservers.contentNotifyingObjects.get('computedProperty'); //should be 6 |
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
Arrayobservers = SC.Application.create({ | |
NAMESPACE: 'Arrayobservers', | |
VERSION: '0.1.0', | |
store: SC.Store.create().from(SC.Record.fixtures) | |
}); |
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
ScHerestay.rentalUnitController = SC.ObjectController.create({ | |
contentBinding: SC.Binding.single('ScHerestay.rentalUnitsController.selection') | |
}); |
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
My.coreStateChart = SC.Statechart.create({ | |
rootState: SC.State.design({ | |
initialSubstate: 'checkingState', | |
checkingState: SC.State.design({ | |
enterState: function(){ | |
return SC.Async.perform('isLoggedInCheck'); | |
}, | |
exitState: function() { |
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
App.Choice = SC.Record.extend({ | |
label: SC.Record.attr(String, { isRequired: YES }), | |
question: SC.Record.toOne("App.Question", { isMaster: NO }) | |
}); | |
App.Question = SC.Record.extend({ | |
question: SC.Record.attr(String, { isRequired: YES }), | |
quiz: SC.Record.toOne("App.Quiz", { isMaster: NO }), | |
choices: SC.Record.toMany("App.Choice"), | |
correctAnswers: SC.Record.toMany("App.Choice") |
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
GX.itemController = SC.ObjectController.create({ | |
invoiceVatBinding: 'GX.invoiceForItemController.hasVAT', | |
hasVAT: function(){ | |
return this.get('invoiceVat'); | |
}.property('invoiceVat') | |
}); | |
GX.invoiceForItemController = SC.ObjectController.create({ | |
contentBinding: "GX.itemController.invoice" |
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
// need to add destroy of internal cache on destroy... | |
SC.ManyArray.reopen({ | |
// Set up observers. | |
contentDidChange: function() { | |
var observedRecords = this._observedRecords; | |
if (!observedRecords) observedRecords = this._observedRecords = []; | |
var record, i, len; | |
// If any items in observedRecords are not in content, stop observing them. |
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
// somewhere in your data source: | |
someMethod: function () { | |
SC.Request.getUrl('http://your.url.here').json().notify(this, this._myCallbackMethod).send(); | |
}, | |
_myCallbackMethod: function (result) { | |
if (SC.ok(result)){ | |
// successfully retrieved | |
var myData = result.get('body'); |
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
<html> | |
<head> | |
<title>AudioPlayground</title> | |
<style>* {box-sizing: border-box;}</style> | |
</head> | |
<body> | |
<h3>AudioPlayground</h3> | |
<p>If you're happy and you know it, clap your hands!</p> | |
<script> | |
var Recording = function(cb){ |
OlderNewer