backbone-hostname
v1.0.0
Published
Globally set the hostname for all Backbone models and collections.
Downloads
5
Readme
Backbone Hostname
Globally set the hostname for all Backbone models and collections.
Download
https://raw.github.com/amccloud/backbone-hostname/master/backbone-hostname.js
Example
var User = Backbone.Model.extend({
urlRoot: '/api/v1/user/'
});
Backbone.hostname = 'http://api.example.com';
var user = new User();
user.url() // 'http://api.example.com/api/v1/user/'