From c2f2587a79aeb77aad66f081cf924a79348a698e Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Wed, 19 Jan 2011 15:42:11 -0800 Subject: fixed example rendering, add tests for it. --- docs/angular.formatter.ngdoc | 16 +- docs/angular.service.ngdoc | 10 +- docs/angular.validator.ngdoc | 18 +- docs/angular.widget.ngdoc | 18 +- docs/service.template | 2 +- docs/spec/domSpec.js | 24 +++ docs/spec/ngdocSpec.js | 10 + docs/spec/writerSpec.js | 8 +- docs/src/gen-docs.js | 2 +- docs/src/ngdoc.js | 5 +- docs/src/reader.js | 2 +- docs/src/templates/doc_widgets.css | 2 +- docs/src/templates/doc_widgets.js | 16 +- docs/src/templates/docs-scenario.html | 2 +- docs/src/templates/docs.js | 8 +- .../templates/syntaxhighlighter/shBrushJScript.js | 6 +- docs/src/templates/syntaxhighlighter/shBrushXml.js | 10 +- docs/src/templates/syntaxhighlighter/shCore.css | 2 +- docs/src/templates/syntaxhighlighter/shCore.js | 2 +- .../templates/syntaxhighlighter/shThemeDefault.css | 2 +- docs/src/writer.js | 12 +- src/AngularPublic.js | 2 +- src/Browser.js | 48 ++--- src/Compiler.js | 14 +- src/Injector.js | 2 +- src/markups.js | 18 +- src/parser.js | 42 ++-- src/sanitizer.js | 2 +- src/scenario/output/Json.js | 2 +- src/services.js | 170 +++++++-------- src/validators.js | 124 +++++------ test/AngularSpec.js | 10 +- test/BinderSpec.js | 238 ++++++++++----------- test/CompilerSpec.js | 2 +- test/FiltersSpec.js | 10 +- test/FormattersSpec.js | 4 +- test/ParserSpec.js | 20 +- test/ScenarioSpec.js | 18 +- test/ScopeSpec.js | 4 +- test/ValidatorsSpec.js | 42 ++-- test/jquery_alias.js | 2 +- test/jquery_remove.js | 2 +- test/markupSpec.js | 2 +- test/sanitizerSpec.js | 22 +- test/scenario/mocks.js | 2 +- test/servicesSpec.js | 10 +- 46 files changed, 512 insertions(+), 477 deletions(-) create mode 100644 docs/spec/domSpec.js diff --git a/docs/angular.formatter.ngdoc b/docs/angular.formatter.ngdoc index ba28471f..2f4433cf 100644 --- a/docs/angular.formatter.ngdoc +++ b/docs/angular.formatter.ngdoc @@ -8,13 +8,13 @@ The formatters are responsible for translating user readable text in an input wi data model stored in an application. # Writting your own Formatter -Writing your own formatter is easy. Just register a pair of JavaScript functions with -`angular.formatter`. One function for parsing user input text to the stored form, +Writing your own formatter is easy. Just register a pair of JavaScript functions with +`angular.formatter`. One function for parsing user input text to the stored form, and one for formatting the stored data to user-visible text. -Here is an example of a "reverse" formatter: The data is stored in uppercase and in -reverse, while it is displayed in lower case and non-reversed. User edits are -automatically parsed into the internal form and data changes are automatically +Here is an example of a "reverse" formatter: The data is stored in uppercase and in +reverse, while it is displayed in lower case and non-reversed. User edits are +automatically parsed into the internal form and data changes are automatically formatted to the viewed form.
@@ -56,11 +56,11 @@ angular.formatter('reverse', {
 });
 
 
-Formatted: 
+Formatted:
 
 
-Stored: +Stored:
{{data}}
@@ -69,7 +69,7 @@ Stored: 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(); diff --git a/docs/angular.service.ngdoc b/docs/angular.service.ngdoc index a34142bb..4e4810f9 100644 --- a/docs/angular.service.ngdoc +++ b/docs/angular.service.ngdoc @@ -76,7 +76,7 @@ window alert. }; }, {$inject: ['$window']});
- + And here is a unit test for this service. We use Jasmine spy (mock) instead of real browser's alert.
 var mock, notify;
@@ -85,7 +85,7 @@ beforeEach(function() {
   mock = {alert: jasmine.createSpy()};
   notify = angular.service('notify')(mock);
 });
- 
+
 it('should not alert first two notifications', function() {
   notify('one');
   notify('two');
@@ -134,7 +134,7 @@ function myController($loc, $log) {
   };
 }
 // which services to inject ?
-myController.$inject = ['$location', '$log']; 
+myController.$inject = ['$location', '$log'];
 
@example @@ -149,13 +149,13 @@ myController.$inject = ['$location', '$log']; } }; }, {$inject: ['$window']}); - + function myController(notifyService) { this.callNotify = function(msg) { notifyService(msg); }; } - + myController.$inject = ['notify']; diff --git a/docs/angular.validator.ngdoc b/docs/angular.validator.ngdoc index acd3caf2..fccdc5a0 100644 --- a/docs/angular.validator.ngdoc +++ b/docs/angular.validator.ngdoc @@ -4,7 +4,7 @@ @namespace Namespace for all filters. @description # Overview -Validators are a standard way to check the user input against a specific criteria. For +Validators are a standard way to check the user input against a specific criteria. For example, you might need to check that an input field contains a well-formed phone number. # Syntax @@ -29,10 +29,10 @@ Attach a validator on user input widgets using the `ng:validate` attribute. # Writing your own Validators -Writing your own validator is easy. To make a function available as a -validator, just define the JavaScript function on the `angular.validator` -object. passes in the input to validate as the first argument -to your function. Any additional validator arguments are passed in as +Writing your own validator is easy. To make a function available as a +validator, just define the JavaScript function on the `angular.validator` +object. passes in the input to validate as the first argument +to your function. Any additional validator arguments are passed in as additional arguments to your function. You can use these variables in the function: @@ -40,9 +40,9 @@ You can use these variables in the function: * `this` — The current scope. * `this.$element` — The DOM element containing the binding. This allows the filter to manipulate the DOM in addition to transforming the input. - -In this example we have written a upsTrackingNo validator. -It marks the input text "valid" only when the user enters a well-formed + +In this example we have written a upsTrackingNo validator. +It marks the input text "valid" only when the user enters a well-formed UPS tracking number. @css ng-validation-error @@ -57,7 +57,7 @@ UPS tracking number. }); @scenario diff --git a/docs/angular.widget.ngdoc b/docs/angular.widget.ngdoc index 5f15398f..5942d933 100644 --- a/docs/angular.widget.ngdoc +++ b/docs/angular.widget.ngdoc @@ -4,19 +4,19 @@ @namespace Namespace for all widgets. @description # Overview -Widgets allow you to create DOM elements that the browser doesn't -already understand. You create the widget in your namespace and -assign it behavior. You can only bind one widget per DOM element -(unlike directives, in which you can use any number per DOM -element). Widgets are expected to manipulate the DOM tree by +Widgets allow you to create DOM elements that the browser doesn't +already understand. You create the widget in your namespace and +assign it behavior. You can only bind one widget per DOM element +(unlike directives, in which you can use any number per DOM +element). Widgets are expected to manipulate the DOM tree by adding new elements whereas directives are expected to only modify element properties. Widgets come in two flavors: element and attribute. # Element Widget -Let's say we would like to create a new element type in the -namespace `my` that can watch an expression and alert() the user +Let's say we would like to create a new element type in the +namespace `my` that can watch an expression and alert() the user with each new value.
@@ -38,7 +38,7 @@ angular.widget('my:watch', function(compileElement) {
 
# Attribute Widget -Let's implement the same widget, but this time as an attribute +Let's implement the same widget, but this time as an attribute that can be added to any existing DOM element.
 <div my-watch="name">text</div>
@@ -70,4 +70,4 @@ angular.widget('@my:watch', function(expression, compileElement) {
   });
 
 
-     
\ No newline at end of file
+
diff --git a/docs/service.template b/docs/service.template
index c28bddc9..639990ed 100644
--- a/docs/service.template
+++ b/docs/service.template
@@ -54,4 +54,4 @@
   
   {{#scenario}}{{{scenario}}}{{/scenario}}
 
-{{/example}}
\ No newline at end of file
+{{/example}}
diff --git a/docs/spec/domSpec.js b/docs/spec/domSpec.js
new file mode 100644
index 00000000..af1a8faa
--- /dev/null
+++ b/docs/spec/domSpec.js
@@ -0,0 +1,24 @@
+var DOM = require('dom.js').DOM;
+
+describe('dom', function(){
+  describe('example', function(){
+    it('should render code, live, test', function(){
+      var dom = new DOM();
+      dom.example('desc', 'src', 'scenario');
+      expect(dom.toString()).toEqual('

Example

\ndescsrc\nscenario\n\n'); + }); + + it('should render non-live, test with description', function(){ + var dom = new DOM(); + dom.example('desc', 'src', false); + expect(dom.toString()).toEqual('

Example

\ndesc
src
\n
\n'); + }); + + it('should render non-live, test', function(){ + var dom = new DOM(); + dom.example('desc', 'src', false); + expect(dom.toString()).toContain('
src
'); + }); + + }); +}); diff --git a/docs/spec/ngdocSpec.js b/docs/spec/ngdocSpec.js index 7d024cb5..2bea6e9a 100644 --- a/docs/spec/ngdocSpec.js +++ b/docs/spec/ngdocSpec.js @@ -279,6 +279,16 @@ describe('ngdoc', function(){ doc.parse(); expect(doc.html()).toContain('

some\n text'); }); + + it('should render description in related method', function(){ + var doc = new Doc(); + doc.ngdoc = 'service'; + doc.methods = [new Doc('@ngdoc method\n@exampleDescription MDesc\n@example MExmp').parse()]; + doc.properties = [new Doc('@ngdoc property\n@exampleDescription PDesc\n@example PExmp').parse()]; + expect(doc.html()).toContain('

MDesc

MExmp
'); + expect(doc.html()).toContain('

PDesc

PExmp
'); + }); + }); describe('@deprecated', function() { diff --git a/docs/spec/writerSpec.js b/docs/spec/writerSpec.js index 1a722ca6..8354ad5d 100644 --- a/docs/spec/writerSpec.js +++ b/docs/spec/writerSpec.js @@ -2,17 +2,17 @@ var writer = require('writer.js'); describe('writer', function(){ describe('toString', function(){ var toString = writer.toString; - + it('should merge string', function(){ expect(toString('abc')).toEqual('abc'); }); - + it('should merge obj', function(){ expect(toString({a:1})).toEqual('{"a":1}'); }); - + it('should merge array', function(){ expect(toString(['abc',{}])).toEqual('abc{}'); }); }); -}); \ No newline at end of file +}); diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js index 0dee586b..1c03a0f1 100644 --- a/docs/src/gen-docs.js +++ b/docs/src/gen-docs.js @@ -38,7 +38,7 @@ var writes = callback.chain(function(){ writer.copy('jquery.min.js', writes.waitFor()); }); writes.onDone(function(){ - console.log('DONE. Generated ' + docs.length + ' pages in ' + + console.log('DONE. Generated ' + docs.length + ' pages in ' + (now()-start) + 'ms.' ); }); work.onDone(writes); diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 8481f7dc..daa44fef 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -76,6 +76,7 @@ Doc.prototype = { this.description = markdown(this.description); this['this'] = markdown(this['this']); this.exampleDescription = markdown(this.exampleDescription || this.exampleDesc); + return this; function flush(){ if (atName) { @@ -144,13 +145,13 @@ Doc.prototype = { dom.h(method.shortName + '(' + signature.join(', ') + ')', method, function(){ dom.html(method.description); method.html_usage_parameters(dom); - dom.example(method.example, false); + dom.example(method.exampleDescription, method.example, false); }); }); dom.h('Properties', self.properties, function(property){ dom.h(property.name, function(){ dom.text(property.description); - dom.example(property.example, false); + dom.example(property.exampleDescription, property.example, false); }); }); diff --git a/docs/src/reader.js b/docs/src/reader.js index 8f9f22c3..5a653cd6 100644 --- a/docs/src/reader.js +++ b/docs/src/reader.js @@ -88,4 +88,4 @@ function findNgDocInJsFile(file, callback) { -exports.collect = collect; \ No newline at end of file +exports.collect = collect; diff --git a/docs/src/templates/doc_widgets.css b/docs/src/templates/doc_widgets.css index 8361f105..9f007f0e 100644 --- a/docs/src/templates/doc_widgets.css +++ b/docs/src/templates/doc_widgets.css @@ -32,4 +32,4 @@ li.doc-example-live { div.syntaxhighlighter { padding-bottom: 1px !important; /* fix to remove unnecessary scrollbars http://is.gd/gSMgC */ -} \ No newline at end of file +} diff --git a/docs/src/templates/doc_widgets.js b/docs/src/templates/doc_widgets.js index 18aeeacb..2d1ab8c6 100644 --- a/docs/src/templates/doc_widgets.js +++ b/docs/src/templates/doc_widgets.js @@ -1,5 +1,5 @@ (function(){ - + var angularJsUrl; var scripts = document.getElementsByTagName("script"); var filename = /(.*\/)angular([^\/]*)/; @@ -10,7 +10,7 @@ } } - + var HTML_TEMPLATE = '\n' + '\n' + @@ -32,15 +32,15 @@ var tabs = angular.element( '
    ' + '
  • Source

  • ' + - '
  • ' + - '
    ' +
    +            '
  • ' + '
  • Live Preview

  • ' + '
  • ' + exampleSrc +'
  • ' + '
  • Scenario Test

  • ' + '
  • ' + scenario.text() + '
  • ' + '
'); - + tabs.find('li.doc-example-source > pre').text(HTML_TEMPLATE.replace('_HTML_SOURCE_', code.html)); element.html(''); @@ -54,7 +54,7 @@ alert(e); } }); - + function indent(text) { var lines = text.split(/\n/); var lineNo = []; @@ -66,5 +66,5 @@ } return {html: lines.join('\n'), hilite: lineNo.join(',') }; }; - -})(); \ No newline at end of file + +})(); diff --git a/docs/src/templates/docs-scenario.html b/docs/src/templates/docs-scenario.html index c75155c5..bc244d5d 100644 --- a/docs/src/templates/docs-scenario.html +++ b/docs/src/templates/docs-scenario.html @@ -7,4 +7,4 @@ - \ No newline at end of file + diff --git a/docs/src/templates/docs.js b/docs/src/templates/docs.js index 6bf86ed3..f1cfc3e7 100644 --- a/docs/src/templates/docs.js +++ b/docs/src/templates/docs.js @@ -2,7 +2,7 @@ DocsController.$inject = ['$location', '$browser', '$window']; function DocsController($location, $browser, $window) { this.pages = NG_PAGES; window.$root = this.$root; - + this.getUrl = function(page){ return '#!' + page.name; }; @@ -10,7 +10,7 @@ function DocsController($location, $browser, $window) { this.getCurrentPartial = function(){ return './' + this.getTitle() + '.html'; }; - + this.getTitle = function(){ var hashPath = $location.hashPath || '!angular'; if (hashPath.match(/^!angular/)) { @@ -18,7 +18,7 @@ function DocsController($location, $browser, $window) { } return this.partialTitle; }; - + this.getClass = function(page) { var depth = page.name.split(/\./).length - 1, cssClass = 'level-' + depth + (page.name == this.getTitle() ? ' selected' : ''); @@ -37,7 +37,7 @@ function DocsController($location, $browser, $window) { "subject=" + escape("Feedback on " + $location.href) + "&" + "body=" + escape("Hi there,\n\nI read " + $location.href + " and wanted to ask ...."); }; - + } angular.filter('short', function(name){ diff --git a/docs/src/templates/syntaxhighlighter/shBrushJScript.js b/docs/src/templates/syntaxhighlighter/shBrushJScript.js index ff98daba..d52a77b2 100644 --- a/docs/src/templates/syntaxhighlighter/shBrushJScript.js +++ b/docs/src/templates/syntaxhighlighter/shBrushJScript.js @@ -7,7 +7,7 @@ * * @version * 3.0.83 (July 02 2010) - * + * * @copyright * Copyright (C) 2004-2010 Alex Gorbatchev. * @@ -29,7 +29,7 @@ ; var r = SyntaxHighlighter.regexLib; - + this.regexList = [ { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings @@ -38,7 +38,7 @@ { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords ]; - + this.forHtmlScript(r.scriptScriptTags); }; diff --git a/docs/src/templates/syntaxhighlighter/shBrushXml.js b/docs/src/templates/syntaxhighlighter/shBrushXml.js index 69d9fd0b..ac879949 100644 --- a/docs/src/templates/syntaxhighlighter/shBrushXml.js +++ b/docs/src/templates/syntaxhighlighter/shBrushXml.js @@ -7,7 +7,7 @@ * * @version * 3.0.83 (July 02 2010) - * + * * @copyright * Copyright (C) 2004-2010 Alex Gorbatchev. * @@ -28,8 +28,8 @@ tag = new XRegExp('(<|<)[\\s\\/\\?]*(?[:\\w-\\.]+)', 'xg').exec(code), result = [] ; - - if (match.attributes != null) + + if (match.attributes != null) { var attributes, regex = new XRegExp('(? [\\w:\\-\\.]+)' + @@ -37,7 +37,7 @@ '(? ".*?"|\'.*?\'|\\w+)', 'xg'); - while ((attributes = regex.exec(code)) != null) + while ((attributes = regex.exec(code)) != null) { result.push(new constructor(attributes.name, match.index + attributes.index, 'color1')); result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string')); @@ -51,7 +51,7 @@ return result; } - + this.regexList = [ { regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // diff --git a/docs/src/templates/syntaxhighlighter/shCore.css b/docs/src/templates/syntaxhighlighter/shCore.css index 34f6864a..4f0021e2 100644 --- a/docs/src/templates/syntaxhighlighter/shCore.css +++ b/docs/src/templates/syntaxhighlighter/shCore.css @@ -7,7 +7,7 @@ * * @version * 3.0.83 (July 02 2010) - * + * * @copyright * Copyright (C) 2004-2010 Alex Gorbatchev. * diff --git a/docs/src/templates/syntaxhighlighter/shCore.js b/docs/src/templates/syntaxhighlighter/shCore.js index b47b6454..effcf59d 100644 --- a/docs/src/templates/syntaxhighlighter/shCore.js +++ b/docs/src/templates/syntaxhighlighter/shCore.js @@ -7,7 +7,7 @@ * * @version * 3.0.83 (July 02 2010) - * + * * @copyright * Copyright (C) 2004-2010 Alex Gorbatchev. * diff --git a/docs/src/templates/syntaxhighlighter/shThemeDefault.css b/docs/src/templates/syntaxhighlighter/shThemeDefault.css index 13654117..8a870e4e 100644 --- a/docs/src/templates/syntaxhighlighter/shThemeDefault.css +++ b/docs/src/templates/syntaxhighlighter/shThemeDefault.css @@ -7,7 +7,7 @@ * * @version * 3.0.83 (July 02 2010) - * + * * @copyright * Copyright (C) 2004-2010 Alex Gorbatchev. * diff --git a/docs/src/writer.js b/docs/src/writer.js index eb1b190f..c72a54a4 100644 --- a/docs/src/writer.js +++ b/docs/src/writer.js @@ -13,17 +13,17 @@ function output(docs, content, callback){ exports.output = function(file, content, callback){ //console.log('writing', OUTPUT_DIR + file, '...'); fs.writeFile( - OUTPUT_DIR + file, - exports.toString(content), + OUTPUT_DIR + file, + exports.toString(content), callback); }; exports.toString = function toString(obj){ switch (typeof obj) { - case 'string': + case 'string': return obj; - case 'object': + case 'object': if (obj instanceof Array) { obj.forEach(function (value, key){ obj[key] = toString(value); @@ -54,8 +54,8 @@ exports.copy = function(filename, callback){ fs.readFile('docs/src/templates/' + filename, function(err, content){ if (err) return callback.error(err); fs.writeFile( - OUTPUT_DIR + filename, - content, + OUTPUT_DIR + filename, + content, callback); }); }; diff --git a/src/AngularPublic.js b/src/AngularPublic.js index ec41d0d9..4654acb1 100644 --- a/src/AngularPublic.js +++ b/src/AngularPublic.js @@ -4,7 +4,7 @@ var browserSingleton; * @ngdoc service * @name angular.service.$browser * @requires $log - * + * * @description * Represents the browser. */ diff --git a/src/Browser.js b/src/Browser.js index 671ec1cc..c67608cd 100644 --- a/src/Browser.js +++ b/src/Browser.js @@ -67,12 +67,12 @@ function Browser(window, document, body, XHR, $log) { * @ngdoc method * @name angular.service.$browser#xhr * @methodOf angular.service.$browser - * + * * @param {string} method Requested method (get|post|put|delete|head|json) * @param {string} url Requested url - * @param {string=} post Post data to send + * @param {string=} post Post data to send * @param {function(number, string)} callback Function that will be called on response - * + * * @description * Send ajax request */ @@ -113,7 +113,7 @@ function Browser(window, document, body, XHR, $log) { * @ngdoc method * @name angular.service.$browser#notifyWhenNoOutstandingRequests * @methodOf angular.service.$browser - * + * * @param {function()} callback Function that will be called when no outstanding request */ self.notifyWhenNoOutstandingRequests = function(callback) { @@ -144,12 +144,12 @@ function Browser(window, document, body, XHR, $log) { * @ngdoc method * @name angular.service.$browser#addPollFn * @methodOf angular.service.$browser - * + * * @param {function()} fn Poll function to add - * + * * @description * Adds a function to the list of functions that poller periodically executes - * + * * @returns {function()} the added function */ self.addPollFn = function(fn) { @@ -162,10 +162,10 @@ function Browser(window, document, body, XHR, $log) { * @ngdoc method * @name angular.service.$browser#startPoller * @methodOf angular.service.$browser - * + * * @param {number} interval How often should browser call poll functions (ms) * @param {function()} setTimeout Reference to a real or fake `setTimeout` function. - * + * * @description * Configures the poller to run in the specified intervals, using the specified * setTimeout fn and kicks it off. @@ -180,15 +180,15 @@ function Browser(window, document, body, XHR, $log) { ////////////////////////////////////////////////////////////// // URL API ////////////////////////////////////////////////////////////// - + /** * @workInProgress * @ngdoc method * @name angular.service.$browser#setUrl * @methodOf angular.service.$browser - * + * * @param {string} url New url - * + * * @description * Sets browser's url */ @@ -204,10 +204,10 @@ function Browser(window, document, body, XHR, $log) { * @ngdoc method * @name angular.service.$browser#getUrl * @methodOf angular.service.$browser - * + * * @description * Get current browser's url - * + * * @returns {string} Browser's url */ self.getUrl = function() { @@ -261,10 +261,10 @@ function Browser(window, document, body, XHR, $log) { * @ngdoc method * @name angular.service.$browser#cookies * @methodOf angular.service.$browser - * + * * @param {string=} name Cookie name * @param {string=} value Cokkie value - * + * * @description * The cookies method provides a 'private' low level access to browser cookies. * It is not meant to be used directly, use the $cookie service instead. @@ -275,7 +275,7 @@ function Browser(window, document, body, XHR, $log) { *
  • cookies(name, value) -> set name to value, if value is undefined delete the cookie
  • *
  • cookies(name) -> the same as (name, undefined) == DELETES (no one calls it right now that way)
  • * - * + * * @returns {Object} Hash of all cookies (if called without any parameter) */ self.cookies = function (name, value) { @@ -342,7 +342,7 @@ function Browser(window, document, body, XHR, $log) { // Misc API ////////////////////////////////////////////////////////////// var hoverListener = noop; - + /** * @workInProgress * @ngdoc method @@ -356,13 +356,13 @@ function Browser(window, document, body, XHR, $log) { * occurs. */ self.hover = function(listener) { hoverListener = listener; }; - + /** * @workInProgress * @ngdoc method * @name angular.service.$browser#bind * @methodOf angular.service.$browser - * + * * @description * Register hover function to real browser */ @@ -383,7 +383,7 @@ function Browser(window, document, body, XHR, $log) { * @ngdoc method * @name angular.service.$browser#addCss * @methodOf angular.service.$browser - * + * * @param {string} url Url to css file * @description * Adds a stylesheet tag to the head. @@ -402,10 +402,10 @@ function Browser(window, document, body, XHR, $log) { * @ngdoc method * @name angular.service.$browser#addJs * @methodOf angular.service.$browser - * + * * @param {string} url Url to js file - * @param {string=} dom_id Optional id for the script tag - * + * @param {string=} dom_id Optional id for the script tag + * * @description * Adds a script tag to the head. */ diff --git a/src/Compiler.js b/src/Compiler.js index 58a7a47b..c2c56650 100644 --- a/src/Compiler.js +++ b/src/Compiler.js @@ -123,19 +123,19 @@ Compiler.prototype = { }; }, - + /** * @workInProgress * @ngdoc directive * @name angular.directive.ng:eval-order * * @description - * Normally the view is updated from top to bottom. This usually is - * not a problem, but under some circumstances the values for data - * is not available until after the full view is computed. If such - * values are needed before they are computed the order of + * Normally the view is updated from top to bottom. This usually is + * not a problem, but under some circumstances the values for data + * is not available until after the full view is computed. If such + * values are needed before they are computed the order of * evaluation can be change using ng:eval-order - * + * * @element ANY * @param {integer|string=} [priority=0] priority integer, or FIRST, LAST constant * @@ -164,7 +164,7 @@ Compiler.prototype = { {{ items.$sum('total') | currency }} - * + * * @scenario it('should check ng:format', function(){ expect(using('.doc-example-live div:first').binding("items.$sum('total')")).toBe('$9.99'); diff --git a/src/Injector.js b/src/Injector.js index cd9438e7..c7ee6f82 100644 --- a/src/Injector.js +++ b/src/Injector.js @@ -31,7 +31,7 @@ function createInjector(providerScope, providers, cache) { * array of keys: returns an array of instances. * function: look at $inject property of function to determine instances * and then call the function with instances and `scope`. Any - * additional arguments (`args`) are appended to the function + * additional arguments (`args`) are appended to the function * arguments. * object: initialize eager providers and publish them the ones with publish here. * none: same as object but use providerScope as place to publish. diff --git a/src/markups.js b/src/markups.js index 16ca9ba8..21dab128 100644 --- a/src/markups.js +++ b/src/markups.js @@ -74,18 +74,18 @@ angularTextMarkup('OPTION', function(text, textNode, parentElement){ * @name angular.directive.ng:href * * @description - * Using markup like {{hash}} in an href attribute makes - * the page open to a wrong URL, ff the user clicks that link before - * angular has a chance to replace the {{hash}} with actual URL, the - * link will be broken and will most likely return a 404 error. - * The `ng:href` solves this problem by placing the `href` in the + * Using markup like {{hash}} in an href attribute makes + * the page open to a wrong URL, ff the user clicks that link before + * angular has a chance to replace the {{hash}} with actual URL, the + * link will be broken and will most likely return a 404 error. + * The `ng:href` solves this problem by placing the `href` in the * `ng:` namespace. * * The buggy way to write it: *
      * 
      * 
    - * + * * The correct way to write it: *
      * 
    @@ -101,8 +101,8 @@ angularTextMarkup('OPTION', function(text, textNode, parentElement){
      * @name angular.directive.ng:src
      *
      * @description
    - * Using  markup like `{{hash}}` in a `src` attribute doesn't 
    - * work right: The browser will fetch from the URL with the literal 
    + * Using  markup like `{{hash}}` in a `src` attribute doesn't
    + * work right: The browser will fetch from the URL with the literal
      * text `{{hash}}` until  replaces the expression inside
      * `{{hash}}`. The `ng:src` attribute solves this problem by placing
      *  the `src` attribute in the `ng:` namespace.
    @@ -111,7 +111,7 @@ angularTextMarkup('OPTION', function(text, textNode, parentElement){
      * 
      * 
      * 
    - * + * * The correct way to write it: *
      * 
    diff --git a/src/parser.js b/src/parser.js
    index ac62fb97..f2ca7a80 100644
    --- a/src/parser.js
    +++ b/src/parser.js
    @@ -49,8 +49,8 @@ function lex(text, parseStringsForObjects){
           }
         } else if (is('(){}[].,;:')) {
           tokens.push({
    -        index:index, 
    -        text:ch, 
    +        index:index,
    +        text:ch,
             json:(was(':[,') && is('{[')) || is('}]:,')
           });
           if (is('{[')) json.unshift(ch);
    @@ -108,8 +108,8 @@ function lex(text, parseStringsForObjects){
         end = end || index;
         throw Error("Lexer Error: " + error + " at column" +
             (isDefined(start) ?
    -            "s " + start +  "-" + index + " [" + text.substring(start, end) + "]" : 
    -            " " + end) + 
    +            "s " + start +  "-" + index + " [" + text.substring(start, end) + "]" :
    +            " " + end) +
             " in expression [" + text + "].");
       }
     
    @@ -157,8 +157,8 @@ function lex(text, parseStringsForObjects){
         }
         fn = OPERATORS[ident];
         tokens.push({
    -      index:start, 
    -      text:ident, 
    +      index:start,
    +      text:ident,
           json: fn,
           fn:fn||extend(getterFn(ident), {
             assign:function(self, value){
    @@ -167,7 +167,7 @@ function lex(text, parseStringsForObjects){
           })
         });
       }
    -  
    +
       function readString(quote) {
         var start = index;
         index++;
    @@ -217,25 +217,25 @@ function lex(text, parseStringsForObjects){
     function parser(text, json){
       var ZERO = valueFn(0),
           tokens = lex(text, json),
    -      assignment = _assignment, 
    +      assignment = _assignment,
           assignable = logicalOR,
    -      functionCall = _functionCall, 
    -      fieldAccess = _fieldAccess, 
    -      objectIndex = _objectIndex, 
    -      filterChain = _filterChain, 
    -      functionIdent = _functionIdent, 
    +      functionCall = _functionCall,
    +      fieldAccess = _fieldAccess,
    +      objectIndex = _objectIndex,
    +      filterChain = _filterChain,
    +      functionIdent = _functionIdent,
           pipeFunction = _pipeFunction;
       if(json){
    -    // The extra level of aliasing is here, just in case the lexer misses something, so that 
    +    // The extra level of aliasing is here, just in case the lexer misses something, so that
         // we prevent any accidental execution in JSON.
         assignment = logicalOR;
    -    functionCall = 
    -      fieldAccess = 
    -      objectIndex = 
    +    functionCall =
    +      fieldAccess =
    +      objectIndex =
           assignable =
    -      filterChain = 
    -      functionIdent = 
    -      pipeFunction = 
    +      filterChain =
    +      functionIdent =
    +      pipeFunction =
             function (){ throwError("is not valid json", {text:text, index:0}); };
       }
       return {
    @@ -368,7 +368,7 @@ function parser(text, json){
             argFns.push(expression());
           } else {
             return valueFn({
    -          format:invokeFn(formatter.format), 
    +          format:invokeFn(formatter.format),
               parse:invokeFn(formatter.parse)
             });
           }
    diff --git a/src/sanitizer.js b/src/sanitizer.js
    index 5e99ec71..c8a7b9f1 100644
    --- a/src/sanitizer.js
    +++ b/src/sanitizer.js
    @@ -214,7 +214,7 @@ function decodeEntities(value) {
     }
     
     /**
    - * Escapes all potentially dangerous characters, so that the 
    + * Escapes all potentially dangerous characters, so that the
      * resulting string can be safely inserted into attribute or
      * element text.
      * @param value
    diff --git a/src/scenario/output/Json.js b/src/scenario/output/Json.js
    index 94212301..2c852496 100644
    --- a/src/scenario/output/Json.js
    +++ b/src/scenario/output/Json.js
    @@ -3,7 +3,7 @@
      */
     angular.scenario.output('json', function(context, runner) {
       var model = new angular.scenario.ObjectModel(runner);
    -  
    +
       runner.on('RunnerEnd', function() {
         context.text(angular.toJson(model.value));
       });
    diff --git a/src/services.js b/src/services.js
    index 1a7b91ac..aa4a2090 100644
    --- a/src/services.js
    +++ b/src/services.js
    @@ -11,16 +11,16 @@ function angularServiceInject(name, fn, inject, eager) {
      * @workInProgress
      * @ngdoc service
      * @name angular.service.$window
    - * 
    + *
      * @description
      * Is reference to the browser's window object. While window
      * is globally available in JavaScript, it causes testability problems, because
      * it is a global variable. In  we always refer to it through the
      * $window service, so it may be overriden, removed or mocked for testing.
    - * 
    + *
      * All expressions are evaluated with respect to current scope so they don't
      * suffer from window globality.
    - * 
    + *
      * @example
        
        
    @@ -32,7 +32,7 @@ angularServiceInject("$window", bind(window, identity, window), [], EAGER);
      * @ngdoc service
      * @name angular.service.$document
      * @requires $window
    - * 
    + *
      * @description
      * Reference to the browser window.document, but wrapped into angular.element().
      */
    @@ -45,7 +45,7 @@ angularServiceInject("$document", function(window){
      * @ngdoc service
      * @name angular.service.$location
      * @requires $browser
    - * 
    + *
      * @property {string} href
      * @property {string} protocol
      * @property {string} host
    @@ -55,15 +55,15 @@ angularServiceInject("$document", function(window){
      * @property {string} hash
      * @property {string} hashPath
      * @property {Object.} hashSearch
    - * 
    + *
      * @description
      * Parses the browser location url and makes it available to your application.
      * Any changes to the url are reflected into $location service and changes to
      * $location are reflected to url.
      * Notice that using browser's forward/back buttons changes the $location.
    - * 
    + *
      * @example
    -   clear hash | 
    +   clear hash |
        test hash
    $location = {{$location}}
    @@ -91,7 +91,7 @@ angularServiceInject("$location", function($browser) { * @ngdoc method * @name angular.service.$location#update * @methodOf angular.service.$location - * + * * @description * Update location object * Does not immediately update the browser @@ -127,7 +127,7 @@ angularServiceInject("$location", function($browser) { * @ngdoc method * @name angular.service.$location#updateHash * @methodOf angular.service.$location - * + * * @description * Update location hash part * @see update() @@ -288,13 +288,13 @@ angularServiceInject("$location", function($browser) { * @ngdoc service * @name angular.service.$log * @requires $window - * + * * @description * Is simple service for logging. Default implementation writes the message * into the browser's console (if present). - * + * * This is useful for debugging. - * + * * @example

    Reload this page with open console, enter text and hit the log button...

    Message: @@ -311,46 +311,46 @@ angularServiceInject("$log", function($window){ * @ngdoc method * @name angular.service.$log#log * @methodOf angular.service.$log - * + * * @description * Write a log message */ log: consoleLog('log'), - + /** * @workInProgress * @ngdoc method * @name angular.service.$log#warn * @methodOf angular.service.$log - * + * * @description * Write a warning message */ warn: consoleLog('warn'), - + /** * @workInProgress * @ngdoc method * @name angular.service.$log#info * @methodOf angular.service.$log - * + * * @description * Write an information message */ info: consoleLog('info'), - + /** * @workInProgress * @ngdoc method * @name angular.service.$log#error * @methodOf angular.service.$log - * + * * @description * Write an error message */ error: consoleLog('error') }; - + function consoleLog(type) { var console = $window.console || {}; var logFn = console[type] || console.log || noop; @@ -374,17 +374,17 @@ angularServiceInject("$log", function($window){ * @ngdoc service * @name angular.service.$exceptionHandler * @requires $log - * + * * @description * Any uncaught exception in is delegated to this service. * The default implementation simply delegates to $log.error which logs it into * the browser console. - * + * * When unit testing it is useful to have uncaught exceptions propagate * to the test so the test will fail rather than silently log the exception * to the browser console. For this purpose you can override this service with - * a simple rethrow. - * + * a simple rethrow. + * * @example */ angularServiceInject('$exceptionHandler', function($log){ @@ -459,9 +459,9 @@ angularServiceInject('$updateView', serviceUpdateViewFactory, ['$browser']); * @name angular.service.$hover * @requires $browser * @requires $document - * + * * @description - * + * * @example */ angularServiceInject("$hover", function(browser, document) { @@ -514,11 +514,11 @@ angularServiceInject("$hover", function(browser, document) { * @workInProgress * @ngdoc service * @name angular.service.$invalidWidgets - * + * * @description * Keeps references to all invalid widgets found during validation. * Can be queried to find whether there are any invalid widgets currently displayed. - * + * * @example */ angularServiceInject("$invalidWidgets", function(){ @@ -608,45 +608,45 @@ function switchRouteMatcher(on, when, dstName) { * @ngdoc service * @name angular.service.$route * @requires $location - * + * * @property {Object} current Name of the current route * @property {Array.} routes List of configured routes - * + * * @description * Watches $location.hashPath and tries to map the hash to an existing route * definition. It is used for deep-linking URLs to controllers and views (HTML partials). - * + * * $route is typically used in conjunction with {@link angular.widget.ng:view ng:view} widget. - * + * * @example

    - This example shows how changing the URL hash causes the $route - to match a route against the URL, and the [[ng:include]] pulls in the partial. - Try changing the URL in the input box to see changes. + This example shows how changing the URL hash causes the $route + to match a route against the URL, and the [[ng:include]] pulls in the partial. + Try changing the URL in the input box to see changes.

    - + -Chose: -Moby | -Moby: Ch1 | -Gatsby | +Chose: +Moby | +Moby: Ch1 | +Gatsby | Gatsby: Ch4
    $location={{$location}}
    @@ -664,31 +664,31 @@ angularServiceInject('$route', function(location) { dirty = 0, $route = { routes: routes, - + /** * @workInProgress * @ngdoc method * @name angular.service.$route#onChange * @methodOf angular.service.$route - * + * * @param {function()} fn Function that will be called on route change - * + * * @description * Register a handler function that will be called when route changes */ onChange: bind(onChange, onChange.push), - + /** * @workInProgress * @ngdoc method * @name angular.service.$route#when * @methodOf angular.service.$route - * + * * @param {string} path Route path (matched against $location.hash) * @param {Object} params Mapping information to be assigned to `$route.current` on route * match. * @returns {Object} route object - * + * * @description * Add new route */ @@ -732,9 +732,9 @@ angularServiceInject('$route', function(location) { * @requires $browser * @requires $xhr.error * @requires $log - * + * * @description - * + * * @example */ angularServiceInject('$xhr', function($browser, $error, $log){ @@ -773,9 +773,9 @@ angularServiceInject('$xhr', function($browser, $error, $log){ * @ngdoc service * @name angular.service.$xhr.error * @requires $log - * + * * @description - * + * * @example */ angularServiceInject('$xhr.error', function($log){ @@ -791,9 +791,9 @@ angularServiceInject('$xhr.error', function($log){ * @requires $xhr * @requires $xhr.error * @requires $log - * + * * @description - * + * * @example */ angularServiceInject('$xhr.bulk', function($xhr, $error, $log){ @@ -885,9 +885,9 @@ angularServiceInject('$defer', function($browser, $exceptionHandler, $updateView * @ngdoc service * @name angular.service.$xhr.cache * @requires $xhr - * + * * @description - * + * * @example */ angularServiceInject('$xhr.cache', function($xhr, $defer, $log){ @@ -942,7 +942,7 @@ angularServiceInject('$xhr.cache', function($xhr, $defer, $log){ * @requires $xhr * * @description - * Is a factory which creates a resource object which lets you interact with + * Is a factory which creates a resource object which lets you interact with * RESTful * server-side data sources. * Resource object has action methods which provide high-level behaviors without @@ -1051,7 +1051,7 @@ angularServiceInject('$xhr.cache', function($xhr, $defer, $log){ {get:{method:'JSON', params:{visibility:'@self'}}, replies: {method:'JSON', params:{visibility:'@self', comments:'@comments'}}} ); } - + BuzzController.prototype = { fetch: function() { this.activities = this.Activity.get({userId:this.userId}); @@ -1069,9 +1069,9 @@ angularServiceInject('$xhr.cache', function($xhr, $defer, $log){

    - - {{item.actor.name}} - Expand replies: {{item.links.replies[0].count}} + + {{item.actor.name}} + Expand replies: {{item.links.replies[0].count}}

    {{item.object.content | html}}
    @@ -1091,13 +1091,13 @@ angularServiceInject('$resource', function($xhr){ * @ngdoc service * @name angular.service.$cookies * @requires $browser - * + * * @description * Provides read/write access to browser's cookies. - * + * * Only a simple Object is exposed and by adding or removing properties to/from * this object, new cookies are created/deleted at the end of current $eval. - * + * * @example */ angularServiceInject('$cookies', function($browser) { @@ -1181,7 +1181,7 @@ angularServiceInject('$cookies', function($browser) { * @ngdoc service * @name angular.service.$cookieStore * @requires $cookies - * + * * @description * Provides a key-value (string-object) storage, that is backed by session cookies. * Objects put or retrieved from this storage are automatically serialized or @@ -1196,10 +1196,10 @@ angularServiceInject('$cookieStore', function($store) { * @ngdoc method * @name angular.service.$cookieStore#get * @methodOf angular.service.$cookieStore - * + * * @description * Returns the value of given cookie key - * + * * @param {string} key Id to use for lookup. * @returns {Object} Deserialized cookie value. */ @@ -1212,10 +1212,10 @@ angularServiceInject('$cookieStore', function($store) { * @ngdoc method * @name angular.service.$cookieStore#put * @methodOf angular.service.$cookieStore - * + * * @description * Sets a value for given cookie key - * + * * @param {string} key Id for the `value`. * @param {Object} value Value to be stored. */ @@ -1228,10 +1228,10 @@ angularServiceInject('$cookieStore', function($store) { * @ngdoc method * @name angular.service.$cookieStore#remove * @methodOf angular.service.$cookieStore - * + * * @description * Remove given cookie - * + * * @param {string} key Id of the key-value pair to delete. */ remove: function(key) { diff --git a/src/validators.js b/src/validators.js index 7d115518..30936574 100644 --- a/src/validators.js +++ b/src/validators.js @@ -7,32 +7,32 @@ extend(angularValidator, { * @name angular.validator.regexp * @description * Use regexp validator to restrict the input to any Regular Expression. - * + * * @param {string} value value to validate * @param {string|regexp} expression regular expression. * @param {string=} msg error message to display. * @css ng-validation-error - * + * * @example * * Enter valid SSN: *
    * *
    - * + * * @scenario * it('should invalidate non ssn', function(){ * var textBox = element('.doc-example :input'); * expect(textBox.attr('className')).not().toMatch(/ng-validation-error/); * expect(textBox.val()).toEqual('123-45-6789'); - * + * * input('ssn').enter('123-45-67890'); * expect(textBox.attr('className')).toMatch(/ng-validation-error/); * }); - * + * */ 'regexp': function(value, regexp, msg) { if (!value.match(regexp)) { @@ -48,38 +48,38 @@ extend(angularValidator, { * @ngdoc validator * @name angular.validator.number * @description - * Use number validator to restrict the input to numbers with an + * Use number validator to restrict the input to numbers with an * optional range. (See integer for whole numbers validator). - * + * * @param {string} value value to validate * @param {int=} [min=MIN_INT] minimum value. * @param {int=} [max=MAX_INT] maximum value. * @css ng-validation-error - * + * * @example * Enter number:
    * Enter number greater than 10:
    * Enter number between 100 and 200:
    - * + * * @scenario * it('should invalidate number', function(){ * var n1 = element('.doc-example :input[name=n1]'); * expect(n1.attr('className')).not().toMatch(/ng-validation-error/); * input('n1').enter('1.x'); * expect(n1.attr('className')).toMatch(/ng-validation-error/); - * + * * var n2 = element('.doc-example :input[name=n2]'); * expect(n2.attr('className')).not().toMatch(/ng-validation-error/); * input('n2').enter('9'); * expect(n2.attr('className')).toMatch(/ng-validation-error/); - * + * * var n3 = element('.doc-example :input[name=n3]'); * expect(n3.attr('className')).not().toMatch(/ng-validation-error/); * input('n3').enter('201'); * expect(n3.attr('className')).toMatch(/ng-validation-error/); - * + * * }); - * + * */ 'number': function(value, min, max) { var num = 1 * value; @@ -101,36 +101,36 @@ extend(angularValidator, { * @ngdoc validator * @name angular.validator.integer * @description - * Use number validator to restrict the input to integers with an + * Use number validator to restrict the input to integers with an * optional range. (See integer for whole numbers validator). - * + * * @param {string} value value to validate * @param {int=} [min=MIN_INT] minimum value. * @param {int=} [max=MAX_INT] maximum value. * @css ng-validation-error - * + * * @example * Enter integer:
    * Enter integer equal or greater than 10:
    * Enter integer between 100 and 200 (inclusive):
    - * + * * @scenario * it('should invalidate integer', function(){ * var n1 = element('.doc-example :input[name=n1]'); * expect(n1.attr('className')).not().toMatch(/ng-validation-error/); * input('n1').enter('1.1'); * expect(n1.attr('className')).toMatch(/ng-validation-error/); - * + * * var n2 = element('.doc-example :input[name=n2]'); * expect(n2.attr('className')).not().toMatch(/ng-validation-error/); * input('n2').enter('10.1'); * expect(n2.attr('className')).toMatch(/ng-validation-error/); - * + * * var n3 = element('.doc-example :input[name=n3]'); * expect(n3.attr('className')).not().toMatch(/ng-validation-error/); * input('n3').enter('100.1'); * expect(n3.attr('className')).toMatch(/ng-validation-error/); - * + * * }); */ 'integer': function(value, min, max) { @@ -149,14 +149,14 @@ extend(angularValidator, { * @description * Use date validator to restrict the user input to a valid date * in format in format MM/DD/YYYY. - * + * * @param {string} value value to validate * @css ng-validation-error - * + * * @example * Enter valid date: * - * + * * @scenario * it('should invalidate date', function(){ * var n1 = element('.doc-example :input'); @@ -164,7 +164,7 @@ extend(angularValidator, { * input('text').enter('123/123/123'); * expect(n1.attr('className')).toMatch(/ng-validation-error/); * }); - * + * */ 'date': function(value) { var fields = /^(\d\d?)\/(\d\d?)\/(\d\d\d\d)$/.exec(value); @@ -182,14 +182,14 @@ extend(angularValidator, { * @name angular.validator.email * @description * Use email validator if you wist to restrict the user input to a valid email. - * + * * @param {string} value value to validate * @css ng-validation-error - * + * * @example * Enter valid email: * - * + * * @scenario * it('should invalidate email', function(){ * var n1 = element('.doc-example :input'); @@ -197,7 +197,7 @@ extend(angularValidator, { * input('text').enter('a@b.c'); * expect(n1.attr('className')).toMatch(/ng-validation-error/); * }); - * + * */ 'email': function(value) { if (value.match(/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/)) { @@ -212,14 +212,14 @@ extend(angularValidator, { * @name angular.validator.phone * @description * Use phone validator to restrict the input phone numbers. - * + * * @param {string} value value to validate * @css ng-validation-error - * + * * @example * Enter valid phone number: * - * + * * @scenario * it('should invalidate phone', function(){ * var n1 = element('.doc-example :input'); @@ -227,7 +227,7 @@ extend(angularValidator, { * input('text').enter('+12345678'); * expect(n1.attr('className')).toMatch(/ng-validation-error/); * }); - * + * */ 'phone': function(value) { if (value.match(/^1\(\d\d\d\)\d\d\d-\d\d\d\d$/)) { @@ -245,14 +245,14 @@ extend(angularValidator, { * @name angular.validator.url * @description * Use phone validator to restrict the input URLs. - * + * * @param {string} value value to validate * @css ng-validation-error - * + * * @example * Enter valid phone number: * - * + * * @scenario * it('should invalidate url', function(){ * var n1 = element('.doc-example :input'); @@ -260,7 +260,7 @@ extend(angularValidator, { * input('text').enter('abc://server/path'); * expect(n1.attr('className')).toMatch(/ng-validation-error/); * }); - * + * */ 'url': function(value) { if (value.match(/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/)) { @@ -275,15 +275,15 @@ extend(angularValidator, { * @name angular.validator.json * @description * Use json validator if you wish to restrict the user input to a valid JSON. - * + * * @param {string} value value to validate * @css ng-validation-error - * + * * @example * - * + * * @scenario * it('should invalidate json', function(){ * var n1 = element('.doc-example :input'); @@ -291,7 +291,7 @@ extend(angularValidator, { * input('json').enter('{name}'); * expect(n1.attr('className')).toMatch(/ng-validation-error/); * }); - * + * */ 'json': function(value) { try { @@ -307,36 +307,36 @@ extend(angularValidator, { * @ngdoc validator * @name angular.validator.asynchronous * @description - * Use asynchronous validator if the validation can not be computed - * immediately, but is provided through a callback. The widget - * automatically shows a spinning indicator while the validity of + * Use asynchronous validator if the validation can not be computed + * immediately, but is provided through a callback. The widget + * automatically shows a spinning indicator while the validity of * the widget is computed. This validator caches the result. - * + * * @param {string} value value to validate * @param {function(inputToValidate,validationDone)} validate function to call to validate the state * of the input. - * @param {function(data)=} [update=noop] function to call when state of the + * @param {function(data)=} [update=noop] function to call when state of the * validator changes - * + * * @paramDescription - * The `validate` function (specified by you) is called as + * The `validate` function (specified by you) is called as * `validate(inputToValidate, validationDone)`: - * + * * * `inputToValidate`: value of the input box. * * `validationDone`: `function(error, data){...}` * * `error`: error text to display if validation fails * * `data`: data object to pass to update function - * + * * The `update` function is optionally specified by you and is - * called by on input change. Since the - * asynchronous validator caches the results, the update - * function can be called without a call to `validate` + * called by on input change. Since the + * asynchronous validator caches the results, the update + * function can be called without a call to `validate` * function. The function is called as `update(data)`: - * + * * * `data`: data object as passed from validate function - * + * * @css ng-input-indicator-wait, ng-validation-error - * + * * @example *