Skip to content

Instantly share code, notes, and snippets.

View mvidailhet's full-sized avatar

Michel Vidailhet mvidailhet

View GitHub Profile
import {Directive, ElementRef, Input} from '@angular/core';
import {Observable, Subscription, of} from 'rxjs';
import {share} from 'rxjs/operators';
/**
* Adds the css class `active-animate` to the element, if given expression is truthy, but after a setTimeout without triggering change detection
* This allows to animate an element entering the view, as you can't have an animation on an element that was just added to the DOM
*
* Example:
*