3.0.31 • Published 5 years ago

lib-module-modal v3.0.31

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

Modal

This library help to construct modal dialog

Predicat

Import bootstrap in your project angular in angular.json

  "styles": [
               "src/styles.css",
               "node_modules/bootstrap/dist/css/bootstrap.min.css"
             ]

or in style.css

     @import "~bootstrap/dist/css/bootstrap.min.css";

Objects

ModalController

Is interface to control the modal

  export class ModalController {
     enable?: boolean; //enable modal if has true
     title?: string;
     buttonCloseEnable?: boolean;
     cache?: any[]; // stock elements we want use element in function hide
     hide?: (modalController: ModalController) => void;
     timestampClose?: number // timestamp in millisecond after close modal
     timestampCloseTmp?: number // timestamp in millisecond after close modal 
                             // and remove timestamp after close
  }

ModalModule

#####template modify body: container body of modal

header: container header of modal

footer: container footer of modal

in app.module.ts

 @NgModule({
   declarations: [
     AppComponent
   ],
   imports: [
     BrowserModule,
     AppRoutingModule,
     ModalModule // to import module
   ],
   providers: [],
   bootstrap: [AppComponent]
 })
 export class AppModule { }

example use modal

html

 <ng-template #modalBody>
     <p>body text modal</p>
 </ng-template>
 <lib-modal [body]="modalBody" [controller]="modalController"></lib-modal>

on controller

get modalController() {
 return this.controller;
}

controller: ModalController = {
 hide(p1: ModalController) {
   p1.enable = false;
 },
 title: 'hello',
 buttonCloseEnable: false
};
3.0.24

5 years ago

3.0.27

5 years ago

3.0.28

5 years ago

3.0.25

5 years ago

3.0.26

5 years ago

3.0.30

5 years ago

3.0.31

5 years ago

3.0.29

5 years ago

3.0.23

5 years ago

3.0.21

5 years ago

3.0.22

5 years ago

3.0.20

5 years ago

3.0.18

5 years ago

3.0.19

5 years ago

3.0.9

5 years ago

3.0.12

5 years ago

3.0.4

5 years ago

3.0.13

5 years ago

3.0.3

5 years ago

3.0.10

5 years ago

3.0.2

5 years ago

3.0.11

5 years ago

3.0.1

5 years ago

3.0.16

5 years ago

3.0.8

5 years ago

3.0.17

5 years ago

3.0.7

5 years ago

3.0.14

5 years ago

3.0.6

5 years ago

3.0.15

5 years ago

3.0.5

5 years ago

3.0.0

5 years ago

2.1.5

5 years ago

2.1.4

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.9

5 years ago

2.0.8

5 years ago

2.0.7

5 years ago

2.0.3

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.6

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago