shlomiassaf / ngx-modialog

Modal / Dialog for Angular
http://shlomiassaf.github.io/ngx-modialog
MIT License
686 stars 242 forks source link

How render a component #358

Open Barralex opened 7 years ago

Barralex commented 7 years ago

That's all guys, i can see in the docs that the plugin could render component but i really can't see how. There is some examples or something?

Very very thankful.

jelling commented 7 years ago

I had the same question and solved it by following this example: http://embed.plnkr.co/mbPzd8/

Specifically, look in app.comonent.ts at:

    return this.modal.open(CustomModal,  overlayConfigFactory({ num1: 2, num2: 3 }, BSModalContext));
  }

One small change from the example: I had to add my modal component to the app.module.ts like so:

  declarations: [ AppComponent, MyModalComponent ],
ghost commented 7 years ago

That example saved my life, thanks @jelling !