How to use a document in Typescript angular

I tried to apply the code below in the parent Typescript controller, but it does not work.

Did I miss something?

 angular.element(document).ready(function() {
            $('form').find('input[type=text],textarea,select').filter(':visible:first').focus();
     });
+4
source share
1 answer

It seems your jQuery did not complete the download before your AngularJS calls its method angular.element(document).ready.

Try calling the jQuery method $(document).readyand check which one starts first, as I did in this little Plnkr: http://plnkr.co/edit/Ubw0w2mo7wkPZwBld82N?p=preview

jQuery , ( Safari Version 10.1 Chromium Version 57.0.2978.0) http://plnkr.co/edit/Oe5dcFmhLPaatoI2qXBr?p=preview

, , jQuery, AngularJS.

-1

Source: https://habr.com/ru/post/1661195/


All Articles