Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
https://twitter.com/dagda1/status/231016636847648769 | |
https://twitter.com/garybernhardt/status/227881347346219008/ | |
http://ianstormtaylor.com/rendering-views-in-backbonejs-isnt-always-simple/ | |
backbone: what you'd normally use jquery plugins for, but with an inverted rendering process (js -> DOM instead of DOM -> js) | |
"islands of richness", jquery data callbacks main pattern. | |
other frameworks are building out from jQuery's central pattern of DOM selection and event callbacks. | |
fantastic pattern for adding behavior to documents, but we aren't writing documents. |
# 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 |
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; |
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.
App.Store = DS.Store.extend | |
pushRecord: (type, record) -> | |
key = type.underscore().pluralize() | |
payload = {} | |
payload[key] = [record] | |
@pushPayload type, payload | |
@getById type, record.id |
router.js Architecture
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
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')
pojo = {awesome: false}; | |
Ember.defineProperty(pojo, 'computedAwesomeness', Ember.computed.not('awesome')); | |
alert("Computed Awesomeness: " + Ember.get(pojo, 'computedAwesomeness')); |