I want to copy the value from vm.foo
to vm.bar
(that works) and then set focus to vm.bar
(that does not work).
<input type="text" ng-model="vm.foo" id="foo" >
<button ng-click="vm.baa=vm.foo; angular.element('#bar').focus();"></button>
<input type="text" ng-model="vm.bar" id="bar" >
How come angular.element('#bar').focus()
is not working in this situation?