Atlas sits on top of Backbone.js, adding features and enhancing the API
Atlas sits on top of Backbone.js, adding features and making it nicer to use.
Atlas adds ES5 getters and setters to
Backbone.Model for every default attribute.
var User = BackboneModelextenddefaults:username: undefinedemail: undefined;var user = ;// Backbone's API:userset 'username':'dandean' ;// Backbone with Atlas:userusername = 'dandean';
Atlas triggers events before and after calls to
Backbone.history.navigate(...). These events can do awesome things like notify your views that they should go ahead and remove themselves from the DOM.
Events: "willNavigate", "didNavigate".
var router = BackboneRouterextendroutes:'' : 'index''library': 'library''library/work': 'work'var collectionsView = LibraryCollections;$'body'appendcollectionsViewel;var worksView = LibraryWorks;$'body'appendworksViewel;varif from === 'library'Backbonehistoryunbind'willNavigate' navigateHandler;collectionsViewremove;worksViewremove;;Backbonehistorybind"willNavigate" navigateHandler;;
Atlas is still experimental, and the fact that it monkey-patches Backbone is a bit iffy... but it's awesome so you should totally use it.
The topmost vertibra in a backbone is named "atlas"... now you know.