skip to Main Content

I’ve recently started learning Angular and I’ve encountered an issue that I’m not sure how to solve. My scripts aren’t loading.

I’ve tried including them in the index.html file, but nothing happens – it doesn’t even display any errors in the console. I also attempted to add them in the angular.json file, but the issue still persists.

(https://phpout.com/wp-content/uploads/2023/08/Zw00o.png)

(https://phpout.com/wp-content/uploads/2023/08/M7ghw.png)

2

Answers


    1. Angular is Typescript, importing that way won’t work.
    2. For all of these scripts you are using there, you can find packages to implement. Look On npm for the package and install it.
    3. The package.json is responsible for your "scripts"
    4. I would recommend to start by going in step by step. Especially with you current experience.
    Login or Signup to reply.
  1. Angular is not like a traditional webpage or JS library. You cannot just link scripts. They must be imported.

    You also should not be using any scripts (like bootstrap for example) that will manipulate the DOM. Angular needs full control of your application and it needs to know about any DOM changes. You need to do things "the angular way" and use Angular libraries or custom components.

    To give you an example, instead of the plain JS script that does Bootstrap stuff you should probably use one of these instead:

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search