I am facing an issue with a JavaScript function that runs in an HTML file, as I keep getting the error "angular is not defined". To address this, I included the following script tag before my HTML script:
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js">
However, I want to move my function to an actual JavaScript file instead of embedding it in the HTML. Since I cannot use the src
attribute for script inclusion in a JavaScript file, I tried copying all the code into a separate file and referencing it from the main JavaScript file, but unfortunately, it did not work.
Are there any alternative solutions to tackle this issue?