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 --- docs/angular.formatter.ngdoc | 70 +++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 33 deletions(-) (limited to 'docs/angular.formatter.ngdoc') diff --git a/docs/angular.formatter.ngdoc b/docs/angular.formatter.ngdoc index 2f4433cf..83371c38 100644 --- a/docs/angular.formatter.ngdoc +++ b/docs/angular.formatter.ngdoc @@ -37,42 +37,46 @@ angular.formatter('reverse', { @example - -Formatted: - -
+ angular.formatter('reverse', { + parse: function(value){ + return reverse(value||'').toUpperCase(); + }, + format: function(value){ + return reverse(value||'').toLowerCase(); + } + }); + -Stored: -
-
{{data}}
+ Formatted: + +
+ Stored: +
+
{{data}}
+ + + it('should store reverse', function(){ + expect(element('.doc-example input:first').val()).toEqual('angular'); + expect(element('.doc-example input:last').val()).toEqual('RALUGNA'); -@scenario -it('should store reverse', function(){ - expect(element('.doc-example input:first').val()).toEqual('angular'); - expect(element('.doc-example input:last').val()).toEqual('RALUGNA'); + this.addFutureAction('change to XYZ', function($window, $document, done){ + $document.elements('.doc-example input:last').val('XYZ').trigger('change'); + done(); + }); + expect(element('.doc-example input:first').val()).toEqual('zyx'); + }); + +
- this.addFutureAction('change to XYZ', function($window, $document, done){ - $document.elements('.doc-example input:last').val('XYZ').trigger('change'); - done(); - }); - expect(element('.doc-example input:first').val()).toEqual('zyx'); -}); -- cgit v1.2.3