I am using basic xampp for my programming web applications Until now I have used php for the same.
But now i have switched to angularjs
I couldn't see anywhere the tutorial for server communication without nodejs
as I'm not comfortable using nodejs as per now i want direct use of angularjs for web applications; like for fetching and adding data into the database.
<body id="index" ng-app="notesApp" >
<h1>Hello servers!</h1>
<div ng-controller="maincntrl as cntrl" ng-repeat="todo in cntrl.items" class="item">
<div><span ng-bind="todo.label"></span></div>
<div>- <span ng-bind="todo.author"></span></div>
</div>
<script>
angular.module('notesApp',[])
.controller('mainCntrl',['$http', function($http){
var self= this;
self.items = [];
$http.get('/api/note').then(function(response){},function(errResponse){
console.error("error while fetching note");
});
}]);
</script>
</body>
THis code is not working