From 324694a58b6d0ed33e05b511be4767573d9187dd Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 5 Nov 2010 21:12:37 -0700 Subject: Better example widget - syntax highlighting - tabless design - rename widget to doc:example - rename widget files (wiki_widget.* -> doc_widget.*) - example section is now optional --- src/Angular.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/Angular.js') diff --git a/src/Angular.js b/src/Angular.js index 9934b401..985d7bc4 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -165,9 +165,11 @@ var _undefined = undefined, * # Syntax * Attach a validator on user input widgets using the `ng:validate` attribute. * - * + * + * * Change me: <input type="text" name="number" ng:validate="integer" value="123"> - * + * + * * * # Writing your own Validators * Writing your own validator is easy. To make a function available as a @@ -255,6 +257,11 @@ var _undefined = undefined, * the DOM in addition to transforming the input. * * + * @exampleDescription + * The following example filter reverses a text string. In addition, it conditionally makes the + * text upper-case (to demonstrate optional arguments) and assigns color (to demonstrate DOM + * modification). + * * @example - The following example filter reverses a text string. In addition, it conditionally makes the - text upper-case (to demonstrate optional arguments) and assigns color (to demonstrate DOM - modification). - -
{{"hello"|reverse}}: {{"hello"|reverse}}
{{"hello"|reverse:true}}: {{"hello"|reverse:true}}
{{"hello"|reverse:true:"blue"}}: @@ -340,20 +342,22 @@ var _undefined = undefined, * } * }); * + * * Formatted:
* Stored:
*
{{data}}
+ * * * @scenario * it('should store reverse', function(){ - * expect(element('.example :input:first').val()).toEqual(''); - * expect(element('.example :input:last').val()).toEqual('>/RALUGNA<'); + * expect(element('.doc-example input:first').val()).toEqual(''); + * expect(element('.doc-example input:last').val()).toEqual('>/RALUGNA<'); * * this.addFutureAction('change to XYZ', function($window, $document, done){ - * $document.elements('.example :input:last').val('XYZ').trigger('change'); + * $document.elements('.doc-example input:last').val('XYZ').trigger('change'); * done(); * }); - * expect(element('.example :input:first').val()).toEqual('zyx'); + * expect(element('input:first').val()).toEqual('zyx'); * }); */ angularFormatter = extensionMap(angular, 'formatter'), -- cgit v1.2.3