aboutsummaryrefslogtreecommitdiff
path: root/src/view.js
blob: 860148f0a54830c5129d4ba444356c8b7c016507 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import Backbone from 'backbone';
import * as _ from 'underscore';
import $ from 'jquery';
import Mustache from 'mustache';
import MyView from './myview';

import Http from './http';


export default class TestView extends Backbone.View {
    constructor() {
        super();
    }

    initialize() {
        this.el = 'li';
        this.$el = $(this.el);
        this.template = '<div id="myarea"></div>';

        Http.service.get('test1').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));
        new MyView();
    }



}