In angular 2 can I do something like
<div (onEnter)="doSomething()">
</div>
which would trigger when the windows is near an element within a large component.
I am trying to avoid having to write a bunch of components with custom entrance animation. so I wanted to set the style to reference animate.css in the dosomething() function.
Yes, only the syntax dictates
(enter)
rather than(onEnter)
.Plus, you're using angular2, hence the proper usage is of LESS or SCSS files. For pre-processing style files read here http://lesscss.org/