course details changes done
This commit is contained in:
parent
0ffba91be7
commit
7f0093da0a
@ -19,4 +19,22 @@ app.directive('compareTo', function () {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
});
|
||||||
|
app.directive('capitalize', function() {
|
||||||
|
return {
|
||||||
|
require: 'ngModel',
|
||||||
|
link: function(scope, element, attrs, modelCtrl) {
|
||||||
|
var capitalize = function(inputValue) {
|
||||||
|
if (inputValue == undefined) inputValue = '';
|
||||||
|
var capitalized = inputValue.toUpperCase();
|
||||||
|
if (capitalized !== inputValue) {
|
||||||
|
modelCtrl.$setViewValue(capitalized);
|
||||||
|
modelCtrl.$render();
|
||||||
|
}
|
||||||
|
return capitalized;
|
||||||
|
}
|
||||||
|
modelCtrl.$parsers.push(capitalize);
|
||||||
|
capitalize(scope[attrs.ngModel]); // capitalize initial value
|
||||||
|
}
|
||||||
|
};
|
||||||
});
|
});
|
||||||
Loading…
Reference in New Issue
Block a user