5

I have not found yet the solution of this in the internet.

Angular brought this similar Github Issue , but can't find any solution there.

I have added my script files to angular.json such as (in both build & test scope):

        "assets": [
          "src/favicon.ico",
          "src/assets"
        ],
        "styles": [
          "src/styles.css"
        ],
        "scripts": [
          "src/assets/plugins/jquery/jquery-1.11.3.min.js",
          "src/assets/plugins/jquery-ui-1.11.4.custom/jquery-ui.min.js",
          "src/assets/plugins/bootstrap/js/bootstrap.min.js",
          "src/assets/plugins/owl-carousel/owl.carousel.min.js",
          "src/assets/plugins/bootstrap-select/js/bootstrap-select.min.js",
          "src/assets/js/jquery.subscribe-better.js",

          "src/assets/js/moment-with-locales.min.js",
          "src/assets/plugins/countdown/jquery.plugin.min.js",
          "src/assets/plugins/countdown/jquery.countdown.min.js",
          "src/assets/js/theme.js"
        ]

I am getting the css styles but some scripts are not working correctly.

Any solution?

6
  • Any error message in browser console? Commented Jul 31, 2018 at 15:03
  • Nope, it seems everything are working fine from the console. Commented Jul 31, 2018 at 15:07
  • "some scripts are not working correctly." ... what do you mean? are the scripts not included in the build? Commented Jul 31, 2018 at 15:11
  • @fransyozef scripts are included in the build, but say, my theme.js is working but jquery.countdown.min.js is not working. I have gone through every codes to see which functions are not working, so If I have 10 js, 3 js are working. 7 js are not working... weird though. and for verifying the js files, I have executed without angular and those files are corrects. Commented Jul 31, 2018 at 15:15
  • jQuery 1.11.3 ??? In general is a bad idea using angular + jquery, but the jquery actual version is 3.3.1 Commented Jul 31, 2018 at 17:13

1 Answer 1

1

After a couple of hours of trial-and-error, I found out that I was putting the script paths under the json key of

/projects/project-name/architect/test/options/scripts

instead of (if not both)

/projects/project-name/architect/build/options/scripts

P.S.: It may also apply to the "styles.css not working" type of questions.

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

1 Comment

This was my issue as well. Worth noting that this is inside angular.json

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.