0.0.15 • Published 6 years ago

fe-modal v0.0.15

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

F.E.Mock fe-modal

Dependencies

  • Angular >=4.0.0

Install

You can get it on npm.

npm install fe-modal --save

Usage

.angular-cli.json

"apps": [
    {
        ...
        "styles": [
            "../node_modules/fe-modal/modal.less"
        ],
        ...
    }
]

app.module.ts:

import { ModalModule } from 'fe-modal';

@NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        ...
        ModalModule.forRoot(),
    ],
    providers: [],
    bootstrap: [AppComponent]
})
export class AppModule {}

Use in components:

import { ModalService } from 'fe-modal';   

@Component({
    selector: 'app-demo',
    templateUrl: './app-demo.component.html',
    styleUrls: ['./app-demo.component.less']
})
export class DemoComponent {

    constructor (private modal: ModalService) {}

    dialog () {
        this.modal.dialog({ template: FormComponent });
    }

    alert () {
        this.modal.alert({ template: 'alert' });
    }

    loading () {
        this.modal.loading({ template: 'loading' });
    }

    remove (id: string) {
        this.modal.confirm({
            template: 'Do not restore after deletion, please operate carefully',
            confirmCallback: () => {
                // code ...
            }
        });
    }
}
0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago