JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://github.com/downloads/emberjs/ember.js/ember-0.9.5.min.js"></script>
JavaScript
(function () {
'use strict';
// Ember application
var App = Ember.Application.create();
// Storage ArrayProxy
App.StorageProxy = Ember.ArrayProxy.create({
content : []
});
// Storage ArrayController
App.Storage = Ember.ArrayController.create({
init : function () {
// Create model
var model = Ember.Object.create({
foo : 'bar'
});
// Push object
App.StorageProxy.pushObject(model);
// results in "undefined"
Ember.Logger.log(App.StorageProxy.get('content').get('foo'));
// results in "bar" but how should i know the index before?
Ember.Logger.log(App.StorageProxy.get('content').get(0).get('foo'));
// results in "["bar"]" but only works for single objects / else you will get ["bar", undefined]
Ember.Logger.log(App.StorageProxy.get('content').getEach('foo'));
}
});
}());