Cheat sheet extracted from https://www.youtube.com/watch?v=2zmUSoVMyRU by That JS Dude.
If you pass any of the CSS selectors to $(<identifier>) you get the first element.
> $('a')| // Record changes to an ObjectProxy and allow them to be stepped through | |
| // or jumped to. | |
| // | |
| // For an example, see http://emberjs.jsbin.com/EJEcoxO/12/edit?html,js,output | |
| // | |
| // There is a bower/npm installable version of this library on GitHub: | |
| // https://github.com/mixonic/ember-vcr-proxy | |
| // | |
| (function (global) { |
| pojo = {awesome: false}; | |
| Ember.defineProperty(pojo, 'computedAwesomeness', Ember.computed.not('awesome')); | |
| alert("Computed Awesomeness: " + Ember.get(pojo, 'computedAwesomeness')); |
Cheat sheet extracted from https://www.youtube.com/watch?v=2zmUSoVMyRU by That JS Dude.
If you pass any of the CSS selectors to $(<identifier>) you get the first element.
> $('a')Let this serve as a guide for anyone who'd like to dig into router.js's internals, understand what's going on, and hopefully contribute!
router.js is most popularly known as the routing microlib used by the
Ember.js Router, though other folk have been known to use it beyond
Ember, including some Angular folk who weren't satisfied with
| App.Store = DS.Store.extend | |
| pushRecord: (type, record) -> | |
| key = type.underscore().pluralize() | |
| payload = {} | |
| payload[key] = [record] | |
| @pushPayload type, payload | |
| @getById type, record.id |
The Ember router is getting number of enhancements that will greatly enhance its power, reliability, predictability, and ability to handle asynchronous loading logic (so many abilities), particularly when used in conjunction with promises, though the API is friendly enough that a deep understanding of promises is not required for the simpler use cases.
| var empty, get, set, | |
| __hasProp = {}.hasOwnProperty; | |
| get = Ember.get; | |
| set = Ember.set; | |
| empty = function(obj) { | |
| var key; | |
| for (key in obj) { | |
| if (!__hasProp.call(obj, key)) continue; |
| # Patch from https://github.com/rails/rails/pull/8862 | |
| module ActionDispatch | |
| Request.class_eval do | |
| # Remove nils from the params hash | |
| def deep_munge(hash) | |
| hash.each do |k, v| | |
| case v | |
| when Array |