fixing bug caused by input element was being inserted before document is...

Fix bug causing ```Uncaught TypeError: Cannot read property 'setSelectionRange' of null```. Input element was being inserted before document ready.
The ready function is fine - the TravisCI error is a "No Selection" error, ie it can't find the element.
I think the issues is that `angular.element('body')` should be `angular.element(document.body)`.
Angular.element: Wraps a raw DOM element or HTML string as a jQuery element. [Ref](https://docs.angularjs.org/api/ng/function/angular.element)
If jQuery is loaded it is an alias for the `$()` function, otherwise you have to pass it a DOM node not a selector.