APP.controller('ListController', ['$rootScope', '$scope', function($rootScope, $scope) {
$scope.$on('$viewContentLoaded', function() {
// initialize core components
});}]);
function pageElements(){
$('#tt-datatable').dataTable();
}
APP.controller('Acctbl',['$http',function($http){
var accdata=this;
accdata.item=[];
$http({
url:_spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('Account')/items",
method: "GET",
headers: {"Accept": "application/json;odata=verbose"}
}).success(function(data){
accdata.item=data.d.results;
});
}
]);
I want to run pageElements after controller loaded , when i run on first
$scope.$on('$viewContentLoaded', function() {
});}]);
I am getting datatables with no results found and again data is binding