Tuesday, January 30, 2018

Hpw to write a program for location service in angularJS.

  • In AngularJS, a service is a function, or object, that is available for, and limited to, your AngularJS application.
  • AngularJS has about 30 built-in services. One of them is the location service. 


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">
<h1>
{{myUrl}}
</h1>
</div>
<script>
var app=angular.module('ABC',[]);
app.controller('DEF',function($scope,$location)
{
$scope.myUrl = $location.absUrl();
});
</script>
</body>
</html>

Output


0 comments:

Post a Comment

Thanks For Commented.

TechTalk