My ng-click function is working properly on a tab and I am receiving the list from the service correctly. However, the data is not reflecting on the HTML page. I am unable to figure out what the issue is with my code. Please review my code and let me know where I may have gone wrong.
/**
* @Summary: Function to getUserCategory, retrieves the User selected Category.
* @param: callback
* @return: callback(response).
* @Description:
*/
//Defining function for getUserProfile in service
$scope.getUserCategory = function () {
var data = {
userTypeKeyId: Number(AUTH.userTypeKeyId),
fieldKeyId: Number(AUTH.defaultFieldKeyId)
};
IntermediaryDashboardService.getIntCategory(function (response) {
if (response != null) {
if (response.data.isSuccess) {
$scope.userCategories = response.data.userCategories;
}
}
}, data);
};
/**
* @Summary: Function to getIntCategory, retrieves the IntCategory
* @param: callback, data
* @return:
* @Description:
*/
this.getIntCategory = function (callback, data) {
var url = '/api/userCategories/filter/list/each';
$http({
method: 'POST',
url: url,
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
transformRequest: function(obj) {
var str = [];
for(var p in obj)
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
return str.join("&");
},
data
}).then(
function (response) {
//Success Function
callback(response);
},
function (response) {
//Failure function
callback(null);
}
}
<ul ng-repeat="category in userCategories" class="ng-cloak">
<li style="padding-top: 11px;">
<a href="#" ng-click="getAlbumInIntermediary(category.categoryKeyId)">
{{category.categoriesDto.categoryName}}
</a>
</li>
</ul>