I'm stuck in CRUD Operations in AngularJS.
-
index.html
. on this page on body I am usingng-app
andng-controller
. -
offer_letter_dashboard.php
and -
termination_dashboard.php
on this page I am writing script for adding and fetching data.
I am using the same script on both the pages for fetching data. Here is the script:
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http){
$http.get("http://www.adhr.adnacgroup.com/ADHRM/companyJson.php")
.then(function(response){
$scope.names = $scope.names = response.data.service;
});
getInfo();
function getInfo(){
$http.post('gettermination.php').success(function(data){
$scope.details = data;
})
}
});
</script>
Right now only the first page can retrieve data. Only the first page's script is working fine. And it applies for termination's page too.