From ba6b68b6ae2bb2400a75ca2834fee47bfd60f1c6 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Mon, 31 Jan 2011 16:21:29 -0800 Subject: changed the documentation @example to use --- src/Angular.js | 92 +++++++++++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 40 deletions(-) (limited to 'src/Angular.js') diff --git a/src/Angular.js b/src/Angular.js index 2812c926..de2de30d 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -484,14 +484,18 @@ function map(obj, iterator, context) { * @returns {number} The size of `obj` or `0` if `obj` is neither an object or an array. * * @example - * Number of items in array: {{ [1,2].$size() }}
- * Number of items in object: {{ {a:1, b:2, c:3}.$size() }}
- * - * @scenario - it('should print correct sizes for an array and an object', function() { - expect(binding('[1,2].$size()')).toBe('2'); - expect(binding('{a:1, b:2, c:3}.$size()')).toBe('3'); - }); + * + * + * Number of items in array: {{ [1,2].$size() }}
+ * Number of items in object: {{ {a:1, b:2, c:3}.$size() }}
+ *
+ * + * it('should print correct sizes for an array and an object', function() { + * expect(binding('[1,2].$size()')).toBe('2'); + * expect(binding('{a:1, b:2, c:3}.$size()')).toBe('3'); + * }); + * + *
*/ function size(obj) { var size = 0, key; @@ -556,17 +560,19 @@ function isLeafNode (node) { * @returns {*} The copy or updated `destination` if `destination` was specified. * * @example - Salutation:
- Name:
- -
- - The master object is NOT equal to the form object. - -
master={{master}}
-
form={{form}}
- - * @scenario + * + * + Salutation:
+ Name:
+ +
+ + The master object is NOT equal to the form object. + +
master={{master}}
+
form={{form}}
+ *
+ * it('should print that initialy the form object is NOT equal to master', function() { expect(element('.doc-example input[name=master.salutation]').val()).toBe('Hello'); expect(element('.doc-example input[name=master.name]').val()).toBe('world'); @@ -577,6 +583,8 @@ function isLeafNode (node) { element('.doc-example button').click(); expect(element('.doc-example span').css('display')).toBe('none'); }); + * + *
*/ function copy(source, destination){ if (!destination) { @@ -633,27 +641,31 @@ function copy(source, destination){ * @returns {boolean} True if arguments are equal. * * @example - Salutation:
- Name:
-
- - The greeting object is - NOT equal to - {salutation:'Hello', name:'world'}. - -
greeting={{greeting}}
- - @scenario - it('should print that initialy greeting is equal to the hardcoded value object', function() { - expect(element('.doc-example input[name=greeting.salutation]').val()).toBe('Hello'); - expect(element('.doc-example input[name=greeting.name]').val()).toBe('world'); - expect(element('.doc-example span').css('display')).toBe('none'); - }); - - it('should say that the objects are not equal when the form is modified', function() { - input('greeting.name').enter('kitty'); - expect(element('.doc-example span').css('display')).toBe('inline'); - }); + * + * + Salutation:
+ Name:
+
+ + The greeting object is + NOT equal to + {salutation:'Hello', name:'world'}. + +
greeting={{greeting}}
+ *
+ * + it('should print that initialy greeting is equal to the hardcoded value object', function() { + expect(element('.doc-example input[name=greeting.salutation]').val()).toBe('Hello'); + expect(element('.doc-example input[name=greeting.name]').val()).toBe('world'); + expect(element('.doc-example span').css('display')).toBe('none'); + }); + + it('should say that the objects are not equal when the form is modified', function() { + input('greeting.name').enter('kitty'); + expect(element('.doc-example span').css('display')).toBe('inline'); + }); + * + *
*/ function equals(o1, o2) { if (o1 == o2) return true; -- cgit v1.2.3