Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am consuming angular web component (built using angular elements) in another angular app which is hosted in IIS. I am using '
@angular-extensions/elements
' but giving console error "
ERROR NullInjectorError: StaticInjectorError(AppModule)[LazyElementDirective -> LazyElementsLoaderService]: 
  StaticInjectorError(Platform: core)[LazyElementDirective -> LazyElementsLoaderService]: 
    NullInjectorError: No provider for LazyElementsLoaderService!
"

What I have tried:

I have installed
npm i @angular-extensions/elements


//in app.module
import {LazyElementsModule} from '@angular-extensions/elements'

@NgModule({
 imports: [
    BrowserModule,
    AppRoutingModule,
    LazyElementsModule,
  ],
providers: [{ provide: LazyElementsModule}],

//in html

<pre><app-root
      *axLazyElement="'http://localhost:4200'">
    
    </app-root>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900