डाउनलोड पी.डी.एफ. ई-बुक्स
AJS - Services $window

$window service; ये Object; Browser के window object का वर्णन करता है |

window Object में बहुत सारे methods होते है |


Example for $window Service in AngularJS

Source Code :
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
</head>
<body>

<div ng-app="app" ng-controller="ctrl"> 
<button ng-click="myFunc()">Click Me</button>
</div>

<script>
var myapp = angular.module('app', []);
myapp.controller('ctrl', function($scope, $window) {
$scope.myFunc = function(){
	$window.alert("Hello World");
}
});
</script>

</body>
</html>
Output :