I'm using Bootstrap and Angular 2 (v4) for my webapp. I would like to listen to an element in a directive for visibility changes. My element has a parent that can hide its children with hidden-sm-up
and I need to trigger a function each time it is hidden or displayed.
div.hidden-sm-up
input.form-control(myDirective, type='number')
and in my directive:
@Directive({
selector: '[myDirective]'
})
export class myDirective {
constructor(private element: ElementRef, private renderer: Renderer){
}
ngAfterViewInit(): void{
// listen to visibility change here
}
}