course details changes done

This commit is contained in:
gandhimathi 2017-12-09 16:33:01 +05:30
parent 0ffba91be7
commit 7f0093da0a

View File

@ -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
}
};
});