HTTP - Axios integrated

This commit is contained in:
Indrajith K L
2017-11-02 15:47:14 +05:30
parent 70a7e6c3c2
commit a7ccf2688f
5 changed files with 46 additions and 4 deletions

View File

@@ -1,10 +1,13 @@
import Backbone from 'backbone';
import * as _ from 'underscore';
import _ from 'lodash';
import $ from 'jquery';
import Mustache from 'mustache';
import axios from 'axios';
import Http from './http';
export default class MyView extends Backbone.View {
constructor() {
super();
}
@@ -13,11 +16,18 @@ export default class MyView extends Backbone.View {
this.el = '#myarea';
this.$el = $(this.el);
this.template = 'Hello';
Http.service.get('olapa')
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
this.render();
}
render() {
console.log(this.el)
this.$el.html(Mustache.render(this.template));
}