From 7f0093da0a8a7227605fd9de337237275b6d0204 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Sat, 9 Dec 2017 16:33:01 +0530 Subject: [PATCH] course details changes done --- Apollo/assets/js/directives/compare-to.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Apollo/assets/js/directives/compare-to.js b/Apollo/assets/js/directives/compare-to.js index 8ac82a05..9753374c 100755 --- a/Apollo/assets/js/directives/compare-to.js +++ b/Apollo/assets/js/directives/compare-to.js @@ -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 + } + }; }); \ No newline at end of file