akveo / ngx-admin

Customizable admin dashboard template based on Angular 10+
https://akveo.github.io/ngx-admin/
MIT License
25.19k stars 7.94k forks source link

NbDialogService does not render a Dialog (No component factory found error) #5667

Open dcruz1990 opened 4 years ago

dcruz1990 commented 4 years ago

Issue type

I'm submitting a ... (check one with "x")

Issue description

Current behavior: Click on the button to open the dialog and console says: Error: No component factory found for undefined. Did you add it to @NgModule.entryComponents?

Expected behavior: When i click x button, its shows the dialog fine.

Steps to reproduce: From a working Nebular project, import NbDialogService, then in appModule.ts reference to use forRoot() as the docs says. Then in the x component, import NbDialogService, insert into constructor to use it and declare the function to open the dialog.

Related code:

Template (inside a card header):

 <button nbButton size="tiny" (click)="open()">New profile pic</button>

        <ng-template #dialog let-data let-ref="dialogRef">
          <nb-card>
            <nb-card-header>Template Dialog</nb-card-header>
            <nb-card-body>{{ data }}</nb-card-body>
            <nb-card-footer>
              <button nbButton (click)="ref.close()">Close Dialog</button>
            </nb-card-footer>
          </nb-card>
        </ng-template>

Component:

  open(dialog: TemplateRef<any>) {
    this.dialogService.open(dialog, { context: 'this is some additional data passed to dialog' });
  }

Other information:

Node v13.11.0 Npm 6.14.3

Angular, Nebular


    "@angular/animations": "~8.0.0",
    "@angular/cdk": "^8.0.0",
    "@angular/common": "~8.0.0",
    "@angular/compiler": "~8.0.0",
    "@angular/core": "~8.0.0",
    "@angular/forms": "~8.0.0",
    "@angular/platform-browser": "~8.0.0",
    "@angular/platform-browser-dynamic": "~8.0.0",
    "@angular/router": "~8.0.0",
    "@auth0/angular-jwt": "^4.0.0",
    "@nebular/auth": "^4.6.0",
    "@nebular/eva-icons": "4.6.0",
    "@nebular/theme": "^4.6.0",
    "eva-icons": "^1.1.2",
    "rxjs": "~6.4.0",
    "s": "^1.0.0",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.800.0",
    "@angular/cli": "~8.0.2",
    "@angular/compiler-cli": "~8.0.0",
    "@angular/language-service": "~8.0.0",
    "@schematics/angular": "~8.0.2",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.0.0",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.4.3"
  }
}```
suppadeliux commented 3 years ago

Same problem here!, weird nobody has answered yet :sob:

andreipadolin commented 3 years ago

Hi @suppadeliux could you please try to reproduce it with stackblitz https://stackblitz.com/github/akveo/nebular-seed