How to apply this jquery in Angular directive
Jquery
$(":input:not(input[type=button],input[type=submit],button):enabled:visible:first").focus();
I have tried the below but no luck
Angular Directive Link
.directive('autoFocus', ['$timeout', function ($timeout) {
return {
scope: {
autoFocusInitial: "="
},
link: function (scope, element, attrs) {
if (scope.autoFocusInitial == true) {
$timeout(function () {
element[0].querySelector("input:not(.ng-hide)").filter(":enabled:visible:first").focus();
});
}
}
};
}