This is an unofficial collection of resources for Ember.js. This is what worked for me. Hopefully you'll have a similar experience.
- stackoverflow: http://stackoverflow.com/questions/tagged/ember.js
- IRC:
#emberjs
on freenode
# If we save a record using ember-data's RESTadapter, and it fails, Rails | |
# returns the validation errors of the model as JSON hash: | |
# | |
# {"errors":{"name":["may not be blank"]}} | |
# | |
# This patches the RESTadapter to add these errors to the invalid record. It | |
# can be removed when the following Pull Request was merged into ember-data: | |
# https://github.com/emberjs/data/pull/376 | |
DS.RESTAdapter.reopen |
This is an unofficial collection of resources for Ember.js. This is what worked for me. Hopefully you'll have a similar experience.
#emberjs
on freenodeCurrently, there are several awkward points to Ember.js controllers. Namely:
After a mind numbing week of updating all of the templates in our app and thinking about the implications of this change, I'd like to provide a little bit of feedback on this change.
Overall, I view this change as unfavorable. It's not that I dislike the change, it's that I don't find much value in it and it was a very daunting task to push to Ember users.
From what I've gathered the purpose of this change is to "significantly reduce the verbosity of templates". I did not find that my templates either grew or shrank in size, they really remained constant. I believe one of the intended ways for reducing size was the elimination for the need of contentBinding="this"
on {{view}}
helpers. E.g.
{{#each App.photosController}}
JQ.Animate = Ember.Mixin.create({ | |
cssProperties: ['background', 'backgroundAttachment', 'backgroundColor', 'backgroundImage', 'backgroundPosition', | |
'backgroundRepeat', 'border', 'borderBottom', 'borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', | |
'borderColor', 'borderLeft', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRight', 'borderRightColor', | |
'borderRightStyle', 'borderRightWidth', 'borderStyle', 'borderTop', 'borderTopColor', 'borderTopStyle', 'borderTopWidth', | |
'borderWidth', 'clear', 'clip', 'color', 'cursor', 'display', 'filter', 'font', 'fontFamily', 'fontSize', | |
'fontVariant', 'fontWeight', 'height', 'left', 'letterSpacing', 'lineHeight', 'listStyle', 'listStyleImage', | |
'listStylePosition', 'listStyleType', 'margin', 'marginBottom', 'marginLeft', 'marginRight', 'marginTop', 'overflow', | |
'padding', 'paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop', 'pageBreakAfter', 'pageBreakBefore', | |
'position', 'styleFloat', 'textAlign', 'textDecoration' |
JQ.Animate = Ember.Mixin.create({ | |
cssProperties: ['background', 'backgroundAttachment', 'backgroundColor', 'backgroundImage', 'backgroundPosition', | |
'backgroundRepeat', 'border', 'borderBottom', 'borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', | |
'borderColor', 'borderLeft', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRight', 'borderRightColor', | |
'borderRightStyle', 'borderRightWidth', 'borderStyle', 'borderTop', 'borderTopColor', 'borderTopStyle', 'borderTopWidth', | |
'borderWidth', 'clear', 'clip', 'color', 'cursor', 'display', 'filter', 'font', 'fontFamily', 'fontSize', | |
'fontVariant', 'fontWeight', 'height', 'left', 'letterSpacing', 'lineHeight', 'listStyle', 'listStyleImage', | |
'listStylePosition', 'listStyleType', 'margin', 'marginBottom', 'marginLeft', 'marginRight', 'marginTop', 'overflow', | |
'padding', 'paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop', 'pageBreakAfter', 'pageBreakBefore', | |
'position', 'styleFloat', 'textAlign', 'textDecoration' |
Recently, we've been working on extracting Ember conventions from applications we're working on into the framework. Our goal is to make it clearer how the parts of an Ember application work together, and how to organize and bootstrap your objects.
Routing is an important part of web applications. It allows your users to share the URL they see in their browser, and have the same things appear when their friends click on the link.
The Ember.js ecosystem has several great solutions for routing. But, since it is such an important part of most web applications, we've decided to build it right into the framework.
If you have already modeled your application state using Ember.StateManager
, there are a few changes you'll need to make to enable routing. Once you've made those changes, you'll notice the browser's address bar spring to life as you start using your app—just by moving between states, Ember.js will update the URL automatically.
Viz.WidgetsController = Ember.ArrayController.extend | |
init: -> | |
@refresh() | |
setInterval (=> @refresh), 5000 | |
refresh: -> | |
$.ajax | |
url: @get('src'), | |
type: "GET", | |
context: this, |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> | |
<meta charset="utf-8"> |
Created by Christopher Manning