Next, open the angular.json file and locate the scripts property inside.
The assets folder is inside the src folder so we do “src/assets/” and the name of our file.
Here is what is inside the ExampleJS1.js file:
Using Functions in the JS File
Then call it in the code.
However, you cannot add script elements in the html page of your components.
©2019 - 2023 Codeible. All rights reserved.