简体   繁体   中英

How can I use angularjs with xampp but without node.js for server communication?

I am using basic for my programming web applications Until now I have used for the same.

But now i have switched to

I couldn't see anywhere the tutorial for server communication without

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

The point is, Angular JS is a client side framework. It doesn't matter what you use in server side.

Here is an example of server communication with PHP.

http://www.w3schools.com/angular/angular_sql.asp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM