I am developing a application using Backbone.Marionette, I am loading the files using RequireJs, I decide to use the strict mode for my app, so I declared
"use strict" on the function. But I am getting error like this:
ught TypeError: Cannot set property 'App' of undefined
when i remove the "use strict" from function it all works fine.
here is my function:
define(["jQuery", "underscore", "backbone", "marionette","routes"],
function($, _, Backbone, Marionette, Routes){
"use strict";
console.log(Marionette);
this.App = new Marionette.Application();
this.App.addInitializer(function(){
var Route = new Routes();
Backbone.history.start();
});
this.App.start();
});
What is wrong here? how to fix this issue or how to apply strict mode to my function?