Skip to content

Instantly share code, notes, and snippets.

@astr0sl0th
Created December 15, 2018 14:36
Show Gist options
  • Select an option

  • Save astr0sl0th/21740f6a5d1b111a52e5bed20f2f9db4 to your computer and use it in GitHub Desktop.

Select an option

Save astr0sl0th/21740f6a5d1b111a52e5bed20f2f9db4 to your computer and use it in GitHub Desktop.
import { Component, OnInit, Input } from '@angular/core';
import { ModalService } from './modal/modal.service';
import { BehaviorSubject } from 'rxjs';
@Component({
selector: 'app-modal',
templateUrl: './modal.component.html',
styleUrls: ['./modal.component.css']
})
export class ModalComponent implements OnInit {
@Input() title: string;
@Input() subHeading: string;
@Input() className: string;
@Input() modalName: string;
toggleModal: BehaviorSubject<string>;
constructor(private modalService: ModalService) {}
ngOnInit() {
this.toggleModal = this.modalService.toggalModal;
}
closeModal() {
this.modalService.toggalModal.next('none')
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment