1.0.0 • Published 5 years ago
ngx-simple-dialog v1.0.0
DOCS
Installation
To install this library, run:
$ npm install ngx-simple-dialog --save
Usage
Import SimpleDialogModule
in your app.module.ts
import { NgModule } from '@angular/core';
import { SimpleDialogModule } from 'ngx-simple-dialog';
import {DialogComponent} from './dialog/dialog.component';
...
@NgModule({
declarations: [
// Your component that you want to use as a dialog
DialogComponent
...
],
imports: [
SimpleDialogModule.forRoot()
],
entryComponents: [
// Do not forget to add the component to the entryComponents.
DialogComponent
],
...
})
In your component where you want to use the Dialog Service
import { Component } from '@angular/core';
...
import {DialogService} from 'ngx-simple-dialog';
// Your component that you want to use as a dialog
import {DialogComponent} from './dialog/dialog.component';
...
@Component({
selector: 'home', // <home></home>
styleUrls: [ './home.component.scss' ],
templateUrl: './home.component.html',
...
})
export class HomeComponent {
deviceInfo = null;
...
constructor(private dialogService: DialogService) {}
...
openDialog() {
// Passing the component to open
this.dialogService.open(DialogComponent, {
// data for dialog
})
}
}
Dialog service
Holds the following properties
- browser
Helper Methods
- open() : The method of opening the modal window. As parameters it takes the component and the data, if needed, to transmit the dialog
- close() : Closes the modal window
1.0.0
5 years ago
0.0.20
5 years ago
0.0.19
5 years ago
0.0.18
5 years ago
0.0.17
5 years ago
0.0.16
5 years ago
0.0.15
5 years ago
0.0.14
5 years ago
0.0.13
5 years ago
0.0.12
5 years ago
0.0.11
5 years ago
0.0.10
5 years ago
0.0.8
5 years ago
0.0.7
5 years ago
0.0.6
5 years ago
0.0.5
5 years ago
0.0.4
5 years ago
0.0.3
5 years ago
0.0.2
5 years ago
0.0.1
5 years ago