I have used angular-reductor editor(npm package for editor in html)
I want to focus on text-area(redector editor) on ng-click below code is not working but if i remove redactor="redactor_options"
from text-area it works but editor don't get display.
According to angular-redector document they using jQuery method to focus but as i am working on angularjs is there any angularjs method to do this ?
In short:is there any angularjs way to focus on redector editor on ng-click ?
html file
`<div ng-click="focusInput=true">
<textarea ng-model="data.content" redactor="redactor_options" cols="30" rows="10" focus-me="focusInput"></textarea>
<div>'
Controller I have added directive for focus on textarea on ng-click
`app.directive('focusMe', function($timeout) {
return {
link: function(scope, element, attrs, redactor) {
scope.$watch(attrs.focusMe, function(value) {
if(value === true) {
$timeout(function() {
element[0].focus();
scope[attrs.focusMe] = false;
});
}
});
}
};
});`