0

I know how to load scripts using steal however I want to load it before the code in my controller's init method is executed. I need the methods from a script file to be defined before the controller initialization.

How can I do that?

EDIT: Some background info: I've tried loading the script file using the steal function in the controller like so:

steal( 'jquery/controller','jquery/view/ejs', '../js/other.js' )

The result was that the file was loaded via <script> tag in the head section of the file. Also jQuery was not defined before loading set file.

ene.andrei
  • 187
  • 1
  • 2
  • 9

1 Answers1

0

Are you using then() to define your controller?

steal('jquery/controller','../js/other.js').then(function() {
    // other.js is loaded now
    $.Controller(...);
});
noah
  • 21,289
  • 17
  • 64
  • 88