1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Consuming an Angular Element (Ang 18) in AngularJS getting 404 error

Discussão em 'Angular' iniciado por sparanza, Outubro 7, 2024.

  1. sparanza

    sparanza Guest

    I am trying to do an Angular upgrade slowly, last resort, by having Angular 18 "angular elements" (web components) using those Angular 18 web components inside an AngularJS (1.8.3) site. However, just even having a Hello World component shows "hello world", but also gives a 404 console error. My more complex element will not load or show anything.

    Error:

    Failed to load resource: the server responded with a status of 404 (Not Found) Refused to execute script from 'http://localhost:53390/simple-web-component.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

    I compiled the web component in Angular 18 as many tutorials show and am merging it together into one JS file: simple-web-component.js.

    And I am consuming the Angular 18 web component (Angular element) in AngularJS by:

    <div>
    <script src="web-components.js"></script>
    <web-component-contact-list></web-component-contact-list>
    </div>

    Continue reading...

Compartilhe esta Página