2.0.2 • Published 3 years ago
@lukana/modals v2.0.2
Lukana modals
Modals using only @angular/cdk as dependencies.
Usage
- Add @lukana/modals/scss/modalto Yourstyle.scssfile or use Your own styles.
- Import ModalsModuleas dependency.
- Add modals content component to entryComponents
- Inject - ModalServiceas dependency in You component, and open modal with command- ModalService.open(YourComponent):- @Component({ selector: 'app-page', templateUrl: './app-page.component.html' }) export class AppPageComponent implements OnInit { constructor(private modalService: ModalService) { } ngOnInit() { } onOpenModal() { const dataPassedDoComponent = {name: 'Hello'}; this.modalService.open(ModalContentComponent, dataPassedDoComponent) .subscribe(resp => console.log('returned', resp)); } }
- In modal component You can Inject - ModalServiceand close modal with return value like this:- @Component({ selector: 'lukana-modal-content', templateUrl: './modal-content.component.html', styleUrls: ['./modal-content.component.css'] }) export class ModalContentComponent implements OnInit { name: string; constructor(private modalService: ModalService) { } ngOnInit() { } onClose() { this.modalService.close('returnValue'); } }
2.0.2
3 years ago
2.0.1
3 years ago
2.0.0
3 years ago
0.9.2
5 years ago
0.9.1
5 years ago
0.9.0
6 years ago
0.1.5
7 years ago
0.1.4
7 years ago
0.1.3
7 years ago
0.1.2
7 years ago
0.1.1
7 years ago
0.1.0
7 years ago
0.0.9
7 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