Reputation: 1
I am new to backbone js and i wanted to call one external url and i want the which will fetch from the url output.
I have tried like the following
var MyApp.myModel = Backbone.Model.extend({
url: 'http://senthil_c/DSCFrameWork/UVIndevSvc.svc/GetWeatherByZipcode/02111/json'
});
var MyApp.myView = Backbone.View.extend({
initialize: function() {
this.model.bind("change",this.render,this);
this.model.fetch();
},
render: function() {
alert('do awesome stuff here');
}
});
I dont know how to call and i dont know this one is correct or not any one suggest me?
Upvotes: 0
Views: 1326
Reputation: 5308
initialize: function() {
this.model = new MyApp.myModel();
this.model.fetch();
}
Upvotes: 1