I am trying to include function inside ng-include directive. The function takes in parameter and based on this loads dynamic content.
I am using the following syntax to achieve this functionality but is not working.
<div ng-controller="MyCtrl">
<div ng-include src="'getCategoryDetail(cat_id)'"></div>
<div>{{results}}</div>
</div>
And here is my controller
myapp.controller('MyCtrl', function($scope, $http) {
$scope.getCategoryDetail=function(catid)
{
$scope.catid=catid;
$http.post('categoryDetail.php',{catId:scope.catid}).success(function(data) {
$scope.results=data;
})
};
});