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.
- Do not try to return properties from controllers, return the whole object.
- Eg: If you want to read a property of the first object of hasMany: do not return elements.firstObject.property. The hasMany are lazily loaded, thus not visible for models/controllers! The correct way is this: return the firstObject as computed property(elements.@each) and in the view bind the property. This way when the collection is lazy loaded, the view is notified and will update.
- Caution with collections in computed properties. You can observe the collection pointer or the collection elements(using @each)! They are different. Observing the collection pointer will notify when the collection is replaced or deleted, but not when an item is added! For this, you need to use @each.
- Displaying multiple model type on the same page is done with render(you can do it also with outlets but less clean).
- Observing a collection in order to apply a JQuery plugin is done using a CollectionView with a function observing content. In t
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(App) { | |
App.Adapter = DS.RESTAdapter.extend({ | |
namespace: null, | |
serializer: DS.RESTSerializer.extend({ | |
primaryKey: function() { | |
return '_id'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* `Ember.MergedArray` is an array that observes multiple other arrays (called source arrays) for changes and includes | |
* all items from all source arrays in an efficient way. | |
* | |
* Usage: | |
* | |
* ```javascript | |
* var obj = Ember.Object.create({ | |
* people: [ | |
* { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ember.LOG_BINDINGS = true; | |
var App = window.App = Ember.Application.create({ | |
LOG_STACKTRACE_ON_DEPRECATION : true, | |
LOG_TRANSITIONS : true, | |
LOG_TRANSITIONS_INTERNAL : true, | |
LOG_VIEW_LOOKUPS : true, | |
LOG_ACTIVE_GENERATION : true | |
}); |
This is a list of Ember components that can hopefully inspire your own solution to handle some really common cases. Please let me know of more.
Service Worker - offline support for the web
- Service Worker - Revolution of the Web Platform
- The Service Worker is Coming - Look Busy (vid)
- Service Workers: Dynamic Responsive Images using WebP Images
- Is Service Worker ready?
Progressive apps - high-res icon, splash screen, no URL bar, etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
tagName: 'section', | |
classNames: [ 'i18n-demo' ], | |
i18n: Ember.inject.service(), | |
beenClicked: false, | |
text: Ember.computed('i18n.locale', function() | |
{ |
Use Python to:
- send a plain text email
- send an email with attachment
- receive and filter emails according to some criteria