title: Unable to call javascript function from Typescript in Angular 6
body: <p>The javascript function (help) below is not being called from ngOnInit()?</p>
  
  <p>In web console: ERROR ReferenceError: "help is not defined"</p>
  
  <p>Would you know how this can be done?</p>
  
  <hr>
  
  <p>src/assets/myjs.js:</p>
  
  <pre><code>function help() {
      console.log("hilfe");   
  }
  </code></pre>
  
  <hr>
  
  <p>src/app/highlight.directive.ts:</p>
  
  <pre><code>import { Directive, ElementRef, OnInit } from '@angular/core';
  
  declare function help() : any;
  
  @Directive({
    selector: '[appHighlight]'
  })
  export class HighlightDirective implements OnInit {
  
    constructor(el: ElementRef) { 
      el.nativeElement.style.backgroundColor = 'yellow';
    }
  
    ngOnInit() {
      help();
    }
  
  }
  </code></pre>
  
  <hr>
  
  <p>angular.json:</p>
  
  <pre><code>...
  
      "styles": [
           "src/styles.css"
      ],
      "scripts": [
          "src/assets/myjs.js"
      ],
  },
  ...
  </code></pre>