Is there a way load class names as variables? new window[a]
does not seem to work. I'm getting an error of TypeError: window[a] is not a constructor
.
require([
'myController'
], function (myController) {
// this is working fine
// new myController().init();
$(function() {
var a = $('.test').attr('class'); // this returns myController
new window[a]; // error here
});
});