2
votes

How can I create a view in Ember that uses plain 'ol HTML rather than a handlebars template? I'm using a graphing library called Rickshaw, and I want to be able to call its "render" function, which draws to the screen, but I can't execute javascript within a handlebars template.

1

1 Answers

2
votes

You could try something like this:

App.GraphView = Ember.View.extend({
    didInsertElement: function () {
        var graph = new Rickshaw.Graph({
            element: this.$().get(0),
            series: [] // DATA
        }):
        graph.render();
    }
});

didInsertElement is called once the view is inserted into DOM and by calling this.$().get(0) you can get its base DOM element.