Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 5316a10

Browse files
Trevor Ewenvojtajina
Trevor Ewen
authored andcommitted
docs($document): add a documentation example.
The $document docs are pretty empty, and this fills them out a bit. The example itself may not be particularly useful, but it could be improved or removed later. Works for me. Closes #6757
1 parent 9099a00 commit 5316a10

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/ng/document.js

+16
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@
77
*
88
* @description
99
* A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.
10+
*
11+
* @example
12+
<example>
13+
<file name="index.html">
14+
<div ng-controller="MainCtrl">
15+
<p>$document title: <b ng-bind="title"></b></p>
16+
<p>window.document title: <b ng-bind="windowTitle"></b></p>
17+
</div>
18+
</file>
19+
<file name="script.js">
20+
function MainCtrl($scope, $document) {
21+
$scope.title = $document[0].title;
22+
$scope.windowTitle = angular.element(window.document)[0].title;
23+
}
24+
</file>
25+
</example>
1026
*/
1127
function $DocumentProvider(){
1228
this.$get = ['$window', function(window){

0 commit comments

Comments
 (0)