Socket
Socket
Sign inDemoInstall

m-dialog-2

Package Overview
Dependencies
5
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    m-dialog-2

Angular 2 modal component


Version published
Maintainers
1
Install size
12.0 MB
Created

Readme

Source

Angular2 modal component

For angular 1 one, please check this repo: https://github.com/mahpah/mDialog

Manual

Import MDialogModule to your main module as root. Register your custom modal within your main module or any module.

@NgModule({
	imports: [
		// ...
		MDialogModule.forRoot(),
	],
	declarations: [
		MyCustomModal,
	],
	entryComponents: [
		MyCustomModal,
	],
})
export class MainModule {}

Call MDialogService.create() from your component

class AppComponent {

	constructor(
		private mDialog: MDialogService,
	) {}

	openModal() {
		let modalRef = this.mDialog.create(
			MainModule,
			MyCustomModal,
			// ...any data
		)
	}
}

modalRef contain 2 replay subject: componentRef emit event when component created; and result subject emit event when dialog close or dismiss

interface ModalRef {
	componentRef: ReplaySubject<componentInstance>,
	result: ReplaySubject<DialogResult>
}

Keywords

FAQs

Last updated on 10 Jan 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc