I used this in my angular driven student grouping app (http://petebacondarwin.github.com/Student-Grouping-App/) - just stick autofocus on the textarea element: here is a fiddle http://jsfiddle.net/jJVQC/1/. Of course this doesn't work on all browsers.
Pete
... sent from my SAM Coupe
Hi Ankur,
In such a case, use a direcive like this:
.directive('myFocus', function () {
var ddo = {
restrict : 'A', // only antribute
link : function (scope, element, attrs) {
scope.$watch(attrs.myFocus, function (newVal) {
if (!!newVal) {
element[0].focus();
// you might want to reset the myFocus here, so it works more then once.
}
});
}
};
return ddo;
};Does that help?
Regards
Sander