This repository has been archived on 2022-01-02. You can view files and clone it, but cannot push or open issues or pull requests.
AriaNg/src/scripts/directives/placeholder.js

18 lines
457 B
JavaScript
Raw Normal View History

2016-05-29 06:43:39 +02:00
(function () {
'use strict';
2016-06-11 12:52:40 +02:00
angular.module('ariaNg').directive('ngPlaceholder', function () {
2016-05-29 06:43:39 +02:00
return {
restrict: 'A',
scope: {
placeholder: '=ngPlaceholder'
},
2016-06-11 12:52:40 +02:00
link: function (scope, element) {
2016-05-29 06:43:39 +02:00
scope.$watch('placeholder', function () {
2016-06-11 12:52:40 +02:00
element[0].placeholder = scope.placeholder;
2016-05-29 06:43:39 +02:00
});
}
2016-06-10 14:24:17 +02:00
};
2016-05-29 06:43:39 +02:00
});
})();