From Sam...
No collaborators loaded. Only use if you’re testing single object.
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
channelTalk: null, | |
classNames: 'Channel-table-row', | |
channel: Ember.computed.readOnly('channelTalk.channel'), | |
talk: Ember.computed.readOnly('channelTalk.talk'), |
import { test, moduleFor } from 'ember-qunit'; | |
moduleFor('route:application', 'ApplicationRoute', { | |
// Specify the other units that are required for this test. | |
// needs: ['controller:foo'] | |
}); | |
test('it exists', function() { | |
var route = this.subject(); | |
ok(route); |
var classify = Ember.String.classify, | |
decamelize = Ember.String.decamelize, | |
assert = Ember.assert; | |
var resolveFactory = function(namespace) { | |
return function(parsedName) { | |
var className = classify(parsedName.name) + classify(parsedName.type), | |
moduleName = namespace + '/' + parsedName.type + 's/' + parsedName.name, | |
factory; |
I send the controller an event that will result in some long processing/work. Once this work is complete, I want the controller to update a binding. Ideally, I do not want th controller to know anything about this work, I simply want it to ask for the result.
In this example thingApi
is an injected object that knows how to create new strings for things (done async). newString()
is a function that returns a promise that eventually resolves to a string.
What I have to do:
this.get('thingApi').newString().then(function(string) {
this.set('thing', string);
});
I'd like to see more enumerable functions, min/max
and groupBy
are just a few I've recently used, but there are many more (Ruby's Enumerable is what I am thinking of). While these functions are easy to implement, it would be nice to see them in Ember. I know that Ember.Enumerable wants to stay as close as possible to the JS API, so it sounds like that is not a good place for these.
There are a lot of 3rd party libs that build out these functions for you. However, because of Ember's use of proxies (like DS.ManyArray) you have to remember to call toArray
on the relationship. This creates ugly code: groupBy(person.get('posts').toArray(), 'category')
. What's worse is these 3rd party libs don't know about Ember's binding system, so the above turns into groupBy(person.get('posts').toArray(), function(post) { return post.get('category') });
. I think it's a lot easier to think of the above as person.get('posts').groupBy('category')
.
Is there interest for these functions? If so, how should
root@ryan-desktop:/usr/local/src/bdsm-0.8.8# sm sets install ruby | |
[✘] bdsm-ruby! | |
Unknown SCM type (not found) for url 'wayneeseguin/bdsm-ruby'. | |
A command has returned error code '(1)' without being handled. | |
+# source file # function() | |
======================================================================================================================================== | |
less +866 /sm/core/cli/modules/shell/sets/dsl # sets_install() | |
less +506 /sm/core/sm/modules/shell/logging/dsl # action_call() |
<?php | |
/** | |
* Finds all of the X(table) within (radius) of (object). | |
* | |
* Uses Haversine formula | |
* | |
* @author ryan | |
*/ | |
class Gps_Radius { |
<div id="strike-form-6150cd9ecfcddc83eefe04bd09d356ae"></div> | |
<script type="text/javascript"> | |
strike_form_init = function() { | |
strike_form = new StrikeForm(); | |
strike_form.start(); | |
}; | |
</script> | |
<script src="http://www.strikeform.com/forms/show/v1/6150cd9ecfcddc83eefe04bd09d356ae.js"></script> |