Tuesday, January 30, 2018

write a program for The http Service in angularJS.

The http service is one of the most common used services in AngularJS applications. The service makes a request to the server, and lets your application handle the response.
Program
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
</head>
<body>
<div ng-app="ABC" ng-controller="DEF">
<p>
{{myWelcome}}
</p>
</div>
<script>
var app=angular.module('ABC',[]);
app.controller('DEF', function ($scope,$http)
{
$http.get("angular.html").then(function (response)
{
$scope.myWelcome=response.data;
});
});
</script>
</body>
</html>

Output


0 comments:

Post a Comment

Thanks For Commented.

TechTalk