Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Angular err KTUtil is not defined


hello, i'm using metronic8 angular and trying to use widget-27 from demo 50 inside angular component and get error KTUtil is not defined

["Uncaught ReferenceError: KTUtil is not defined"]

and added scripts files in angular.json

["src/assets/plugins.bundle.js",
"src/assets/script.bundle.js",
"src/assets/widget-27.js",
"src/assets/widgets.bundle.js",
]
code example tested taken from :
"\metronic_html_v8.1.8_demo50\demo50\dist\dashboards\website-analytics.html"


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hi Ahmed,

Could you please open the browser's developer console and look for any additional errors or warnings related to script loading. Make sure there are no 404 errors indicating that the script files are not found. If there are any other errors, address them accordingly.

Double-check the paths to the script files in your Angular configuration (angular.json) to ensure they are correct and match the actual file locations.

Thanks



no error or warning ,
but now i want to take the all of home page i took the html file and put it in html angular component and took the css and js files also and put it in angular.json

"styles": [
"src/styles.scss",
"src/assets/datatables.bundle.css",
"src/assets/vis-timeline.bundle.css",
"src/assets/plugins.bundle.css",
"src/assets/style.bundle.css"
],
"scripts": [
"src/assets/plugins.bundle.js",
"src/assets/scripts.bundle.js",
"src/assets/datatables.bundle.js",
"src/assets/vis-timeline.bundle.js"
]
put when i'm trying to serve angular project get many of errors :
"./src/assets/plugins.bundle.css - Error: Module Error (from ./node_modules/postcss-loader/dist/cjs.js):"


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(