app .directive('uniform', function ($timeout) { return { restrict: 'C', require: 'ngModel', link: function (scope, element, attrs, ngModel) { element.uniform(); scope.$watch(function () { return ngModel.$modelValue; }, function () { $timeout($.uniform.update, 0); }); } }; });