i am a newbie to web application development. i have a backbone model named LoginModel. I want to create an object of it and make it globally accessible from any Backbone View which will be loaded dynamically. Here is my model..
define(['underscore', 'backbone'], function(_, Backbone) {
LoginModel = Backbone.Model.extend({
initialize: function(){ },
defaults:{
userName: 'undefined',
userID: 'undefined'
},
urlRoot: 'https://xxxx.xx.xxxxxx',
parse: function(response, options){
return{
userName: response.userName,
userId:response.userId
};
}
});
});