app.controller('custCtrl',custCtrl);
custCtrl.$inject = ['$element'];
function custCtrl($element)
{
//call API & get the json
if(jsonData.readonlyFlag){
var elems = $element.find('input[type=text]');
elems .forEach(function(elem) {
//need to set each elem to readonly
});}
}
But this is throwing the below error.
angular.js:13042 Error: [$injector:unpr] Unknown provider: $elementProvider <- $element <- custCtrl
But I have already included jQuery before angular library
On googling I see few links which says that this is not the right way.
So my question is if I am doing this way, how do I address my requirement else what could be the better way?
Requirement: - how to set all the inputs fields to readonly of an ng-template??