O
O
oe24y2016-03-30 13:49:01
JavaScript
oe24y, 2016-03-30 13:49:01

Why doesn't this simple Backbone code work?

var Change = Backbone.Model.extend({
  events: {
        "click #btn_change": "check" 
    },
    check: function () {
    console.log(1);
  }
});

var start = new Change();

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem Arsenowitch, 2016-03-30
@oe24y

I agree with Ivan, you need to use View instead of Model, since the methods that are described in your code are available only for View.
You also need to specify a template

I
Ivan Kondratiev, 2016-03-30
@inik23

In this case, you need to use View and not Model

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question