একটি তালিকায় একটি টেক্সট ইনপুট ফোকাস সেট করতে, নিম্নলিখিত কোড চেষ্টা করুন:
newApp.directive('focus', function () {
return function (scope, element, attrs) {
attrs.$observe('focus', function (newValue) {
newValue === 'true' && element[0].focus();
});
}
}); নিম্নলিখিত HTML:
<input type="text" ng-model="cues[$index].text" focus="{{cue.isNewest}}"
class="input-xlarge" />{{cue.isNewest}}