<html>
<script
src="angular.min.js"></script>
<body>
<div
ng-app="myApp" ng-controller="myCtrl">
AreaofCircle={{AreaofCircle}}<br>
Circumference={{Circumference}}
</div>
</body>
<script>
var
app1 = angular.module('myApp',[]);
app1.service('circle',
function() {
var
pi= 3.14;
this.Area=function(r)
{
//var
pi=3.14;
return
pi*r*r;
}
this.Circumference=function(r)
{
return
pi*r*2;
}
});
$scope.AreaofCircle=circle.Area(5);
$scope.Circumference=circle.Circumference(5);
});
</script>
</html>