1.0.14 • Published 3 years ago

input-popup v1.0.14

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Input Popup

Input Popup is an angular component that allows you to create a popup with a input for the user to enter something in and get the data that they input.

Installation

npm install input-popup

Usage

import { InputValueComponent } from 'input-popup';
import { MatDialog } from '@angular/material/dialog';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.scss']
})
export class AppComponent {
    constructor(private dialog: MatDialog) { }

    async someFunction() {
        // the color property is the color of the title, default is black
        const config: MatDialogConfig<any> = {data: {title: "What is your name?", name: "Name", color: "#324ea8"}};
        const data: null | string = await this.dialog.open(InputValueComponent, config).afterClosed().toPromise();
        // data will either be null or the string value of the input
        if (data == null) {
            return; // the user closed the dialog or did not provide any value
        }
        else {
            console.log(data); // the value the user inputted
        }
    }
    
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago