WAAPI in Angular
Learn how to use WAAPI in an Angular application and how to listen to WAAPI's animation events.
We'll cover the following...
To use WAAPI in Angular, we’ll need access to the element we want to animate. We can do this by giving the element an ID and using Angular’s ViewChild
decorator. Instead of using the document’s DOMContentLoaded
event, we can use Angular’s AfterViewInit
lifecycle hook to trigger the animation. The rest of the WAAPI code is identical to the non-Angular version.
{ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 "recommendations": ["angular.ng-template"] }
Spin animation using WAAPI in Angular
Events
WAAPI emits events that we can listen to using JavaScript. There are some slight ...