Ever surprised that angular.document does not return what expected? It expects the parameter to be wrapped as jQuery object (or an alternative object to be honest). The correct code which work would be as simple as below example, by using jQuery’s $ helper function:
Full article