1

I'm trying to get a custom dialog modal popup in nativescript (angular 2) by following this example.

Any idea why when clicking the SHOW button I get the following exception:

EXCEPTION: No component factory found for DialogContent (d:\npn\qwe\node_modules\@angular\core\bundles\core.umd.js:3462:27)
ORIGINAL STACKTRACE: (d:\npn\qwe\node_modules\@angular\core\bundles\core.umd.js:3467:31)
Error: No component factory found for DialogContent
    at NoComponentFactoryError.Error (native)
    at NoComponentFactoryError.BaseError [as constructor] (/data/data/org.nativescript.qwe/files/app/tns_modules/@angular/core/bundles/core.umd.js:1255:38)
    at new NoComponentFactoryError (/data/data/org.nativescript.qwe/files/app/tns_modules/@angular/core/bundles/core.umd.js:6053:20)
    at _NullComponentFactoryResolver.resolveComponentFactory (/data/data/org.nativescript.qwe/files/app/tns_modules/@angular/core/bundles/core.umd.js:6062:19)
    at NgModuleInjector.CodegenComponentFactoryResolver.resolveComponentFactory (/data/data/org.nativescript.qwe/files/app/tns_modules/@angular/core/bundles/core.umd.js:6087:39)
    at DetachedLoader.loadInLocation (/data/data/org.nativescript.qwe/files/app/tns_modules/nativescript-angular/common/detached-loader.js:18:37)
    at DetachedLoader.loadComponent (/data/data/org.nativescript.qwe/files/app/tns_modules/nativescript-angular/common/detached-loader.js:30:21)
    at ModalDialogService.showDialog (/data/data/org.nativescript.qwe/files/app/tns_modules/nativescript-angular/directives/dialogs.js:51:36)
    at /data/data/org.nativescript.qwe/files/app/tns_modules/nativescript-angular/directives/dialogs.js:27:51
  at ZoneDelegate.invokeTask (/data/data/org.nativescript.qwe/files/app/tns_modules/nativescript-angular/zone.js/dist/zone-nativescript.js:223:37) (d:\npn\qwe\node_modules\@angular\core\bundles\core.umd.js:3468:31)
apricity
  • 1,300
  • 1
  • 14
  • 22

1 Answers1

3

I found the solution in another so. In the main module you have to add:

@NgModule({
   ....
    declarations: [ DialogContent ],
    entryComponents: [ DialogContent ]
})
Community
  • 1
  • 1
apricity
  • 1,300
  • 1
  • 14
  • 22
  • good man, also make sure you've got this import `import { DialogContent } from './components/app/dialogcontent` in your `app.module.ts` file – null canvas Feb 26 '17 at 14:39