mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-16 20:32:21 +01:00
25 lines
507 B
JavaScript
25 lines
507 B
JavaScript
(function () {
|
|
'use strict';
|
|
|
|
// Users directive used to force lowercase input
|
|
angular
|
|
.module('users')
|
|
.directive('lowercase', lowercase);
|
|
|
|
function lowercase() {
|
|
var directive = {
|
|
require: 'ngModel',
|
|
link: link
|
|
};
|
|
|
|
return directive;
|
|
|
|
function link(scope, element, attrs, modelCtrl) {
|
|
modelCtrl.$parsers.push(function (input) {
|
|
return input ? input.toLowerCase() : '';
|
|
});
|
|
element.css('text-transform', 'lowercase');
|
|
}
|
|
}
|
|
}());
|