Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BSModalContext not found in ngx-modialog/plugins/bootstrap #430

Open
upendrasengarmbwk opened this issue Apr 10, 2018 · 1 comment
Open

Comments

@upendrasengarmbwk
Copy link

upendrasengarmbwk commented Apr 10, 2018

I'm submitting a ...
[x] bug report
[ ] feature request
[ ] question about the decisions made in the repository

  • What is the current behavior?

I'm using latest version but unable to create a custom component as modal dialg altough it was working with older version angular2-modal.

import { Modal, BSModalContext } from 'ngx-modialog/plugins/bootstrap';

ERROR in src/app/app.module.ts(33,38): error TS2307: Cannot find module 'ngx-modialog/plugins/bootstrap'.
src/app/components/requests/popups/approved-request/approved-request.component.ts(4,39): error TS2307: Cannot find module 'ngx-modialog/plugins/bootstrap'.

Code Sample

  import { Component, OnInit } from '@angular/core';
  import { Overlay, DialogRef, ModalComponent, CloseGuard } from 'ngx-modialog';
  import { Modal, BSModalContext } from 'ngx-modialog/plugins/bootstrap';`
  export class CustomModalContext extends BSModalContext {
        public modalData: any;
  }
  @Component({
           selector: 'modal-content',
            templateUrl: './approved-request.component.html'
   })

  export class ApprovedRequestModal implements OnInit, CloseGuard, 
    ModalComponent<CustomModalContext> {
    context: CustomModalContext;
    public modalData: any;
    public img;

   constructor(
      public dialog: DialogRef<CustomModalContext>,
    ) {
      console.log(dialog.context);
      this.context = dialog.context;
      dialog.setCloseGuard(this);
  }
  ngOnInit() {
  }

  beforeDismiss(): boolean {
      return false;
  }

  beforeClose(): boolean {
      return false;
  }

  close() {
  }
}
@upendrasengarmbwk upendrasengarmbwk changed the title BSModalContext not found in 'angular2-modal/plugins/bootstrap'; BSModalContext not found in ngx-modialog/plugins/bootstrap Apr 10, 2018
@zerocewl
Copy link

Try this solution...

#398

That's a problem with Typescript 2.5.3. If you go back to 2.5.2, it should work. I had the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants