Java, .NET, PHP, PYTHON, ANGULAR, .NET, ML, Data Scince, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

 Services in Angular JS :-

It is used to add external functionality ,features in angular js application from Remote Web Server.

Service always will be defined as a method in angular JS Controller.


Service use to provide business code as well as Http data from web server.


To access Http data angular provide $http variable which will be defined under controller section.


Complete Code to get registration web service data in angular js application.

CORS should be enabled in angular JS Web services then it will be displayed .

..................................................................................................

<!DOCTYPE html>

<html>

<head>

<title>

AngularJs $http.get() Service Response Example

</title>

<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>


</head>

<body>

<div ng-app="serviceApp" ng-controller="serviceCtrl">



<h1>{{myWelcome}}</h1>



</div>
<script type="text/javascript">

var app = angular.module('serviceApp', []);

app.controller('serviceCtrl', function ($scope, $http) {

$http({

method: 'GET',

url: 'http://shivaconceptsolution.com/webservices/showreg.php'

}).then(function success(response) {

$scope.myWelcome = response.data;



}, function error(response) {

});

});

</script>

</body>

</html>





Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post