Skip to Content

How can i call multiple js file functions inside my controller?

Apr 28, 2017 at 01:34 PM


avatar image
Former Member

#######below is my utility.js (not controller) file #######

], function() {

"use strict";

return {

test:function() {

debugger; }

}; });

Now i wanted to call test method inside my controller.

By doing sap.ui.controller("namespace.Controllername").method(); i can able to access controller but not js file.

Looking forward to extend my js file and/or to call js file as above!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member
Apr 28, 2017 at 08:17 PM

you'll have to inject the js files in your controller.

], function(Controller, File1, File2){

return Controller.extend("MyController",{

   test : function(){

      File1.methodName() // invoke method in file1.js
      File2.methodName() //invoke method in file2.js



10 |10000 characters needed characters left characters exceeded