I have. DirectiveI can put on elements that check the current scroll position of the corresponding element.
It looks like:
@Directive({
selector: '[my-scroll-animation]'
})
Whenever a position suits a certain trident, I want the element to be displayed on the screen using animation. I know that for ComponentI can add a property animationsalong with some settings in the property hostto activate the animation.
I would like something like this:
import { myScrollAnimation } from './animations';
@Directive({
selector: '[my-scroll-animation]'
animations: [myScrollAnimation] // <- not possible?
})
How can I achieve this in the Directive?
Usage: Angular 4.0.0-rc.4
Nicky source
share