I am trying to find out a way to write a Angular JS directive which will set focus on a textbox after saving data using $http.
I am trying to solve the following problem.
- User fill up a form
- On ng-submit I save the data using $http call.
- I want to put the focus to first element of form after successfull save.
As I understand that DOM manipulation needs to be done via Directive. Can anyone provide a simple directive sample code to do this?
- UPDATE - I should put my code with my question. Here it is