I am new to Angular. I have added JS files in angular-cli.json inside scripts tag. Files are loaded successfully but the problem is that on my LoginForm console showing:
zone.js:192 Uncaught ReferenceError: theWYSIWYG is not defined
it is loaded when I loggedIn successfully I route to my another component from login-form.component.ts this.router.navigate(['dashboard']); on dashboard component some of html code is
<div id="theWYSIWYG" name="theWYSIWYG" frameborder="0" contentEditable="true" dir="rtl" ></div>
function defined inside the js file which is loaded when app was started. Why JS is not accessing dashboard components.?
tsconfig.json, do you have"allowJs": trueundercompilerOptions. This will allow typescript compiler to resolve the references to .js files..jsfile execute before your component initilize. so before accessing element with idtheWYSIWYGadd condition for undefinded.