-
Data Down / Actions Up
- http://emberjs.jsbin.com/nayaho/edit?html,js - Interdependent select boxes. No observers.
- http://ember-twiddle.com/2d7246875098d0dbb4a4 - One Way Input
-
Plain JSBin's
-
Ember Version Base JSBin's
| <script type="text/javascript"> | |
| (function () { | |
| "use strict"; | |
| // once cached, the css file is stored on the client forever unless | |
| // the URL below is changed. Any change will invalidate the cache | |
| var css_href = './index_files/web-fonts.css'; | |
| // a simple event handler wrapper | |
| function on(el, ev, callback) { | |
| if (el.addEventListener) { | |
| el.addEventListener(ev, callback, false); |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
https://sublime.wbond.net/installation#st3
- Source Code Pro -
sourcecodepro.sh - Hack -
hack.sh
| @mixin smart-underline($background: #fff, $text: #000, $selection: #ffc, $position: 86%){ | |
| a { | |
| color: inherit; | |
| text-decoration: none; | |
| background: -webkit-linear-gradient($background, $background), -webkit-linear-gradient($background, $background), -webkit-linear-gradient($text, $text); | |
| background-size: .05em 1px, .05em 1px, 1px 1px; | |
| background-repeat: no-repeat, no-repeat, repeat-x; | |
| text-shadow: 0.03em 0 $background, -0.03em 0 $background, 0 0.03em $background, 0 -0.03em $background, 0.06em 0 $background, -0.06em 0 $background, 0.09em 0 $background, -0.09em 0 $background, 0.12em 0 $background, -0.12em 0 $background, 0.15em 0 $background, -0.15em 0 $background; | |
| background-position-y: $position,$position, $position; | |
| background-position-x: 0%, 100%, 0%; |
This post is also on my blog, since Gist doesn't support @ notifications.
Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:
- Use Ember CLI
- In general, replace views + controllers with components
- Only use controllers at the top-level for receiving data from the route, and use
Ember.Controllerinstead ofEmber.ArrayControllerorEmber.ObjectController - Fetch data in your route, and set it as normal properties on your top-level controller. Export an
Ember.Controller, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
| function validateCNH(cnh) { | |
| var char1 = cnh.charAt(0); | |
| if (cnh.replace(/[^\d]/g, '').length !== 11 || char1.repeat(11) === cnh) { | |
| return false; | |
| } | |
| for (var i = 0, j = 9, v = 0; i < 9; ++i, --j) { | |
| v += +(cnh.charAt(i) * j); | |
| } |
| HTMLElement.prototype.css = function (style) { | |
| for (let k in style) { | |
| this.style[k] = style[k]; | |
| } | |
| }; | |
| // Example 1 | |
| document.body.css({ | |
| backgroundColor: 'rgb(20,20,20)', | |
| fontFamily: 'Arial, sans-serif', |
A collection of links to the excellent "Composing Software" series of medium stories by Eric Elliott.
Edit: I see that each post in the series now has index, previous and next links. However, they don't follow a linear flow through all the articles with some pointing back to previous posts effectively locking you in a loop.