title: "'this.byId' is not a Function" error in console
body: <p>I have a script file that I would like to load into a Main.controller.js</p>
  <p><strong>myScript.js</strong></p>
  <pre><code>sap.ui.define([], function () {
  
      return {
          /////
          testFunc : function(){
  
                  var test = this.byId(&quot;someId&quot;);
                  console.log(test);
      };
  });
  </code></pre>
  <p>The myScript.js file is successfully read in the main controller when I load it in as a dependency (see below), but I get an error in the myScript.js :</p>
  <blockquote>
  <p>&quot;'this.byId' is Not a Function&quot; (console.log)</p>
  </blockquote>
  <p>Inside the main controller, &quot;this.byId()&quot; works because the 'this' keyword points to the xml view associated with the main controller (main.view.xml). How can I have a dependency like 'myScript.js' point to the same xml view as the controller that loads it?</p>
  <p><strong>main controller</strong></p>
  <pre><code>sap.ui.define([
          'jquery.sap.global',
          'sap/ui/core/mvc/Controller',
          'sap/ui/model/json/JSONModel',
          'sap/ui/model/Filter',
          'sap/ui/model/FilterOperator',
          'pricingTool/controller/myScript'
      ],
  
      function (jQuery, Controller, JSONModel, Filter, FilterOperator, myScript) {
          &quot;use strict&quot;;
  
  
          var mainController = Controller.extend(&quot;pricingTool.controller.Main&quot;, {
         
          myScript.testFunc();
  
         ...
  
       });
  
      return mainController;
  });
  </code></pre>
  <p><strong>main.view.xml</strong></p>
  <pre><code>&lt;mvc:View
      controllerName=&quot;pricingTool.controller.Main&quot;
      xmlns:l=&quot;sap.ui.layout&quot;
      xmlns:core=&quot;sap.ui.core&quot;
      xmlns:f=&quot;sap.ui.layout.form&quot;
      xmlns:mvc=&quot;sap.ui.core.mvc&quot;
      xmlns=&quot;sap.m&quot;&gt;
      ...
  &lt;/mvc:View&gt;
  </code></pre>