aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrevor Ewen2014-03-19 21:06:50 -0400
committerCaitlin Potter2014-03-19 23:42:21 -0400
commit4d4da556eb2a401ad92323e04c803ff2e77924b0 (patch)
treecfef0af69e136e83de314577951790e7cad3c261
parent58f5da86645990ef984353418cd1ed83213b111e (diff)
downloadangular.js-4d4da556eb2a401ad92323e04c803ff2e77924b0.tar.bz2
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
-rw-r--r--src/ng/document.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ng/document.js b/src/ng/document.js
index cc760477..321a3652 100644
--- a/src/ng/document.js
+++ b/src/ng/document.js
@@ -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){