Подскажите, как использовать Fabric.js в Marionette.js 2.4.7 ?
Выдает ошибку " have error "Cannot create property 'style' on string 'constructor'".
Пробовал передавать this.ui.canva в итоге ошибка "Cannot set property 'userSelect' of undefined"
Вот код ItemView
define([
'app',
'marionette',
'backbone',
'underscore',
'pace',
'text!templates/constructor/index.ejs',
'fabric'
], function (App, Marionette, Backbone, _, pace, constructorTmpl, fabric) {
'use strict';
return Marionette.ItemView.extend({
template: _.template(constructorTmpl),
ui: {
canva: '#constructor'
},
onRender: function () {
var canvas = new fabric.Canvas('constructor');
}
});
});
Код index.ejs
<canvas id="constructor" width="300" height="300"></canvas>