I read this article and practice it myself.
If I remove the backbone. $ = $, the code will not work. What for?
var Backbone = require('backbone');
var $ = require('jquery');
Backbone.$ = $;
module.exports = Backbone.View.extend({
initialize: function(){
console.log('wuuut')
this.render();
},
render: function(){
$('body').prepend('<p>wooooooooooooooo</p>');
}
});
Why in node js do I need to assign jquery to a member of a Backbone object?
source
share