Does AngularJS have equivalent to this:
elementObject.addEventListener("resize", myFunction);
I thought about about watches, but I don't think it's the good solution.
Create a custom directive:
app.directive("myResize", function($parse) {
return {
link: postLink
};
function postLink(scope, elem, attrs) {
elem.on("resize", function (e) {
var rs = $parse(attrs.myResize);
rs(scope, {$event: e});
scope.$apply();
});
}
});
Usage:
<div my-resize="$ctrl.myFunction($event)">
</div>
For more information,