><div class="controls"> > <div class="col-lg-9"> > <input type="text" > name="nickname" > id="nickname" > ng-model="currentDynamicRule.nickname" > class="form-control" > ng-disabled="!isNew" > placeholder="Nickname" > required > ng-maxlength="10" > /> > <div class="field-validation-error"> > <span ng-show="form.nickName.$error.required && form.nickName.$dirty">Nickname is required.</span> > <span ng-show="form.nickName.$error.maxlength && form.nickName.$dirty">Nickname cannot exceed 10 characters.</span> > </div> > </div> > </div> > </div> > > <div class="form-group"> > <div class="control-label col-lg-3"> > <label title="Description">Description:</label> > </div> > <div class="controls"> > <div class="col-lg-9"> > <input type="text" name="descrip" id="descrip" ng-model="currentDynamicRule.descrip" class="form-control" > placeholder="Description" required ng-maxlength="30" > sm-focus /> > <div class="field-validation-error"> > <span ng-show="form.descrip.$error.required && form.descrip.$dirty">Description is required.</span> > <span ng-show="form.descrip.$error.maxlength && form.descrip.$dirty">Description cannot exceed 30 characters.</span> > </div> > </div> > </div> > </div>>
>(function () { > 'use strict'; > > var app = angular.module('sysMgrApp'); > > app.directive('smFocus', [ '$timeout', function ($timeout) { > return { > restrict: 'A', > link: function (scope, element) { > > scope.$on('sm:focus', function () { > $timeout(function () { > if (element[0].disabled = "false") > element[0].focus(); > }, 10); > }); > } > }; > }]); >})(); > >>