Angular custom directive to calculate image size in the client-side.