question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modal Component guide and example throw exceptions

See original GitHub issue

Bug description:

The Modal as a component plnkr linked from the guide doesn’t work when you click the button. It throws the exception:

Error in src/modal-component.html:3:47 caused by: No component factory found for NgbdModalContent

I’m actually getting the same error in my own code, not experienced enough with Angular2 yet to be able to figure out how to fix it.

Plnkr:

https://ng-bootstrap.github.io/app/components/modal/demos/component/plnkr.html

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: 2.0.2

ng-bootstrap: 1.0.0-alpha.8

Bootstrap: 4.0.0-alpha.4

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
Syes-Kcommented, Oct 20, 2016

in the lazy module. we need reimport the NgbModule,just like root module.

@NgModule({
    imports: [
        CommonModule,
        FormsModule,
        NgbModule.forRoot(),
        routing
    ],
    providers: [I18nService],
    declarations: [I18nComponent,
        ListComponent, StartComponent, ProjectComponent, ModuleComponent,
        CustomModalContent],
    entryComponents:[CustomModalContent]
})
export class I18nModule {
}

then it is working but i don`t known why!!!

1reaction
pkozlowski-opensourcecommented, Oct 20, 2016

in the lazy module. we need reimport the NgbModule,just like root module.

@Syes-K this shouldn’t be needed and in child components you should just add NgbModule instead of NgbModule.forRoot(). If this doesn’t work could you please open a separate issue for lazy-loaded modules? Just please add a minimal reproduce scenario in a plunker, see: https://github.com/ng-bootstrap/ng-bootstrap#you-think-youve-found-a-bug)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Handling in React Hooks - Medium
Error Handling in Hooks is quite Simple. In this article, we are going to demonstrate how to handle errors in React Hooks.
Read more >
Creating a modal error box after Exception thrown from ...
After MessageBox has finished its modal state (it is truly modal, by the way, see my comment) call EvenWaitHandle.Set on the same instance....
Read more >
Creating Modal using Custom Component
Creating Modal using Custom Component ... This guide has been deprecated in favor of the Modal component available in Draftbit. It requires no...
Read more >
How To Implement a Modal Component in React - DigitalOcean
In this tutorial you will learn about how to implement a modal component in your React project. You'll create a Dashboard component to...
Read more >
What could go wrong? How to handle errors in Angular
When that method was called, a modal dialog popped up and the user could ... ERROR HANDLER MODULE import {ErrorHandler, ModuleWithProviders, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found