0.0.15 • Published 8 years ago

fe-modal v0.0.15

Weekly downloads
-
License
MIT
Repository
-
Last release
8 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

8 years ago

0.0.14

8 years ago

0.0.13

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago