I encountered an issue when attempting to execute a JavaScript function within an Angular function. The error I am facing specifically mentions that the indexof and search functions are not functioning properly.
<select class="form-control input-sm input_high" name="groupname" id="groupname" ng-model="tech_groupname">
<option value="">Select</option>
<option value="Dedicated-1">Test1</option>
<option value="Dedicated-2">Test2</option>
<option value="Yellow-2">Test3</option>
</select>
<div class="ui-widget" ng-if="checkCorpPackage(tech_groupname)" ></div>
appTechInfo.controller('tech_info_ctrl', ['$scope',function($scope)
{
//** check if package is corporate and need if start
$scope.checkCorpPackage = function(temp_grp_name){
//value is printed here if javascript function is not used
console.log(temp_grp_name);
//i have tested by getting data via scope too
var test_data = $scope.tech_groupname;
console.log(temp_grp_name.toLowerCase());
/**
if(temp_grp_name.indexof("Dedicated") > -1)
{
return true;
}
else
{
return false;
}
**/
}
//** check if package is corporate and need if start
}]);
Error log TypeError: Cannot read property 'toLowerCase' of undefined
i have searched similar problems but solution they are providing is not working for me