From 47066e70e1621ff74bd2cd6b5853ca3c5841aba6 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Thu, 4 Nov 2010 14:24:31 -0700 Subject: added documentation for ng:include and ng:widget and test for doc collector. --- src/widgets.js | 51 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) (limited to 'src/widgets.js') diff --git a/src/widgets.js b/src/widgets.js index 5eda5345..7a06fd6c 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -244,13 +244,28 @@ angularWidget('option', function(){ }); -/*ng:doc - * @type widget - * @name ng:include +/** + * @ngdoc widget + * @name angular.widget.ng:include * * @description + * Include external HTML fragment. + * + * Keep in mind that Same Origin Policy applies to included resources + * (e.g. ng:include won't work for file:// access). + * + * @param {string} src expression evaluating to URL. + * @param {Scope=} [scope=new_child_scope] expression evaluating to angular.scope * * @example + * + * url = {{url}} + *
+ * * * @scenario */ @@ -299,6 +314,36 @@ angularWidget('ng:include', function(element){ } }); +/** + * @ngdoc widget + * @name angular.widget.ng:switch + * + * @description + * Conditionally change the DOM structure. + * + * @usageContent + * ... + * ... + * ... + * ... + * + * @param {*} on expression to match against ng:switch-when. + * + * @example + + switch={{switch}} + + +
Settings Div
+ Home Span +
+ + * + * @scenario + */ var ngSwitch = angularWidget('ng:switch', function (element){ var compiler = this, watchExpr = element.attr("on"), -- cgit v1.2.3