title: Why I cannot use JS file inside Angular app?
body: <p>I am trying to include some <code>js</code> methods stored in a file in an angular application.Unfortunately i can not make the browser see the <code>js</code> file.<br>I have looked at this <a href="https://stackoverflow.com/questions/49526681/how-to-call-javascript-functions-from-typescript-in-angular-5">SO</a> post and followed the instructions but the browser does not see the file (<code>Sources</code>) section.</p>
  
  <p><br>
  <br>
  <strong>Js file</strong></p>
  
  <pre><code> function  toggleModal(id) {
          var modal = document.getElementById(id);
          $("#" + id).modal('toggle');
      }
  
      function setPag(tableId) {
          $(tableId).DataTable();
      }
  </code></pre>
  
  <p>My file is located inside:</p>
  
  <pre><code>Root/
    assets/
      js/
        scr.js
  </code></pre>
  
  <p><strong>Usage in Component</strong></p>
  
  <pre><code>declare function setPag(id:string):any;
  declare function toggleModal(id:string):any;
  
  @Component({
    selector: 'index',
    templateUrl: './index.component.html',
    styleUrls: ['./index.component.css']
  })
  export class IndexComponent implements OnInit {
       public toggle(id:string){
          toggleModal(id);
       }
       public setPage(id:string)
       {
          setPag(id);
       }
  }
  </code></pre>
  
  <p><strong>Angular.json</strong>
  <Br>-Scripts section</p>
  
  <pre><code>"architect": {
          "build": {
            "builder": "@angular-devkit/build-angular:browser",
            "options": {
              "outputPath": "dist/AnubisUI",
              "index": "src/index.html",
              "main": "src/main.ts",
              "polyfills": "src/polyfills.ts",
              "tsConfig": "src/tsconfig.app.json",
              "assets": [
                "src/assets"
  
              ],
  
              "scripts": [
                "./src/assets/js/scr.js",
                "node_modules/chart.js/dist/Chart.js",
                "node_modules/hammerjs/hammer.min.js"
              ]
            }
  </code></pre>