diff options
| author | Misko Hevery | 2011-01-31 16:21:29 -0800 |
|---|---|---|
| committer | Misko Hevery | 2011-02-01 10:00:09 -0800 |
| commit | ba6b68b6ae2bb2400a75ca2834fee47bfd60f1c6 (patch) | |
| tree | 94f08ee16f270dd5f6238fb77064c91c624df931 /src/Scope.js | |
| parent | ed768ebc53ef6746ca83d81892c22d2e9c3afeef (diff) | |
| download | angular.js-ba6b68b6ae2bb2400a75ca2834fee47bfd60f1c6.tar.bz2 | |
changed the documentation @example to use <doc:example>
Diffstat (limited to 'src/Scope.js')
| -rw-r--r-- | src/Scope.js | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/src/Scope.js b/src/Scope.js index aef2706e..a73375ab 100644 --- a/src/Scope.js +++ b/src/Scope.js @@ -202,7 +202,7 @@ function errorHandlerFor(element, error) { * @returns {Object} Newly created scope. * * - * @exampleDescription + * @example * This example demonstrates scope inheritance and property overriding. * * In this example, the root scope encompasses the whole HTML DOM tree. This scope has `salutation`, @@ -216,27 +216,29 @@ function errorHandlerFor(element, error) { * - The child scope inherits the salutation property from the root scope. * - The $index property does not leak from the child scope to the root scope. * - * @example - <ul ng:init="salutation='Hello'; name='Misko'; names=['World', 'Earth']"> - <li ng:repeat="name in names"> - {{$index}}: {{salutation}} {{name}}! - </li> - </ul> - <pre> - $index={{$index}} - salutation={{salutation}} - name={{name}}</pre> - - @scenario - it('should inherit the salutation property and override the name property', function() { - expect(using('.doc-example-live').repeater('li').row(0)). - toEqual(['0', 'Hello', 'World']); - expect(using('.doc-example-live').repeater('li').row(1)). - toEqual(['1', 'Hello', 'Earth']); - expect(using('.doc-example-live').element('pre').text()). - toBe('$index=\nsalutation=Hello\nname=Misko'); - }); - + <doc:example> + <doc:source> + <ul ng:init="salutation='Hello'; name='Misko'; names=['World', 'Earth']"> + <li ng:repeat="name in names"> + {{$index}}: {{salutation}} {{name}}! + </li> + </ul> + <pre> + $index={{$index}} + salutation={{salutation}} + name={{name}}</pre> + </doc:source> + <doc:scenario> + it('should inherit the salutation property and override the name property', function() { + expect(using('.doc-example-live').repeater('li').row(0)). + toEqual(['0', 'Hello', 'World']); + expect(using('.doc-example-live').repeater('li').row(1)). + toEqual(['1', 'Hello', 'Earth']); + expect(using('.doc-example-live').element('pre').text()). + toBe('$index=\nsalutation=Hello\nname=Misko'); + }); + </doc:scenario> + </doc:example> */ function createScope(parent, providers, instanceCache) { function Parent(){} |
