mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-13 22:39:59 +08:00
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
This commit is contained in:
committed by
Tobias Bosch
parent
8fd47a1cd5
commit
375c47d0c0
@@ -7,6 +7,22 @@
|
||||
*
|
||||
* @description
|
||||
* A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.
|
||||
*
|
||||
* @example
|
||||
<example>
|
||||
<file name="index.html">
|
||||
<div ng-controller="MainCtrl">
|
||||
<p>$document title: <b ng-bind="title"></b></p>
|
||||
<p>window.document title: <b ng-bind="windowTitle"></b></p>
|
||||
</div>
|
||||
</file>
|
||||
<file name="script.js">
|
||||
function MainCtrl($scope, $document) {
|
||||
$scope.title = $document[0].title;
|
||||
$scope.windowTitle = angular.element(window.document)[0].title;
|
||||
}
|
||||
</file>
|
||||
</example>
|
||||
*/
|
||||
function $DocumentProvider(){
|
||||
this.$get = ['$window', function(window){
|
||||
|
||||
Reference in New Issue
Block a user