disabled
class
click
event
click
event unless boundclick
eventclick
event unless boundclick
event unless boundclick
eventclick
event unless boundclick
event unless boundclick
eventclick
event unless boundPerformance* | Scalability | Size | Testable | Flexibility | |
---|---|---|---|---|---|
AngularJS | Very High | Very | 36kb |
Very | Good |
Ember.js | High | Extremely | 69kb |
DIY | Good |
Backbone | Baseline | Average | 6kb |
DIY | Excellent |
A Comparison of Angular, Backbone, CanJS and Ember by Sebastian Porto [http://is.gd/mvcperformance](http://is.gd/mvcperformance)
* Based on two-way scoped-binding
angular.module("myApp").factory "Cat", ($resource) ->
$resource "/pets/:pet_type/:pet_id",
"pet_type": "cats"
"pet_id": "@pet_id"
angular.module("myApp").controller "CatCtrl", ($scope, Cat) ->
# Get all cats
$scope.cats = Cat.index()
# Get cat by ID
arthur = Cat.get(42)
# New Cat
jeff = Cat.new( { name: "Jeff", type: "Tabby" } )
# Update
jeff.type = "Octocat"
jeff.save()
{
loading: false
user: undefined
addressBook: undefined
addressBooks: undefined
contacts: [
{ sname: "Reid", fname: "Benjamin", checked: true, ...}
{ sname: "Redman", fname: "Rob", checked: true, ...}
{ sname: "Procter", fname: "Paul", checked: true, ...}
{ sname: "Prior", fname: "Cheryl", checked: true ...}
{ sname: "Procter", fname: "Paul", checked: true, ...}
{ sname: "Panay", fname: "Mark", checked: true ...}
...
]
complete: false
showHelp: false
}