Add focus directive to be used to give input elements focus
This commit is contained in:
parent
b8f624f1e0
commit
beee5a3003
@ -72,4 +72,20 @@ angular.module('insight')
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
})
|
||||||
|
.directive('focus', function ($timeout) {
|
||||||
|
return {
|
||||||
|
scope: {
|
||||||
|
trigger: '@focus'
|
||||||
|
},
|
||||||
|
link: function (scope, element) {
|
||||||
|
scope.$watch('trigger', function (value) {
|
||||||
|
if (value === "true") {
|
||||||
|
$timeout(function () {
|
||||||
|
element[0].focus();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user