©
本文档使用 PHP中文网手册 发布
A jQuery or jqLite wrapper for the browser's window.document
object.
$window
<div ng-controller="ExampleController">
<p>$document title: <b ng-bind="title"></b></p>
<p>window.document title: <b ng-bind="windowTitle"></b></p></div>
angular.module('documentExample', [])
.controller('ExampleController', ['$scope', '$document', Function($scope, $document) {
$scope.title = $document[0].title;
$scope.windowTitle = angular.element(window.document)[0].title;
}]);