0

In my Angular component, inside the HTML file, the script tags aren't working. Only HTML is being rendered but not JavaScript. Can someone help me out?

2
  • 2
    Hello, could you expand on what you need so we can help you better? Do you need to add javascript code in your component's template? If so why? Maybe there is another way to do what you need that does not require to do so. If you want to load a third party script the answers here might help you. stackoverflow.com/questions/34140065/… Commented Oct 14, 2021 at 12:00
  • I actually want to implement an Angular program that can graphically display data of csv files using bar graphs. Commented Oct 27, 2021 at 9:54

1 Answer 1

1

To add js script tags in an Angular project you need to have the script tag created and added to the DOM programatically.

A potential solution is having a "ScriptMakerService" that you inject into your app.component or the top component of the module that requires the script. This way when the module is loaded the script is created, added to the DOM and then loaded.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.