Fixed popup service to use ng.element instead of $