I am trying to implement a solution where I need to call the Listing function of testController from userController. I have placed a marker (//) in the code snippet below to indicate where I want to make this function call. This implementation is being done using angularjs.
function userController($scope, $http) {
$scope.SignUp = function() {
$http.post('<?php echo site_url('angularjs/addToTable'); ?>', {'uname': $scope.username, 'pswd': $scope.userpassword, 'email': $scope.useremail}
).success(function(data, status, headers, config) {
// Implementing function call to the Listing function of testController here...
});
}
}
function testController($scope, $http) {
$scope.Listing = function() {
$scope.users = [];
$http.get('<?php echo site_url('angularjs/get_list'); ?>').success(function($data) {
$scope.users = $data;
});
}
}