forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocs-data.js
1 lines (1 loc) · 143 KB
/
docs-data.js
1
NG_DOC={"section":{"overview":[{"raw":{"file":"src/Angular.js","line":96},"ngdoc":"overview","name":"angular.widget","shortName":"widget","namespace":"Namespace for all widgets.","description":"<h2>Overview</h2>\n\n<p>Widgets allow you to create DOM elements that the browser doesn't \nalready understand. You create the widget in your namespace and \nassign it behavior. You can only bind one widget per DOM element \n(unlike directives, in which you can use any number per DOM \nelement). Widgets are expected to manipulate the DOM tree by \nadding new elements whereas directives are expected to only modify\nelement properties.</p>\n\n<p>Widgets come in two flavors: element and attribute.</p>\n\n<h2>Element Widget</h2>\n\n<p>Let's say we would like to create a new element type in the \nnamespace <code>my</code> that can watch an expression and alert() the user \nwith each new value.</p>\n\n<pre class=\"brush: xml; brush: js;\" ng:non-bindable>\n<my:watch exp=\"name\"/>\n</pre>\n\n<p>You can implement <code>my:watch</code> like this:</p>\n\n<pre class=\"brush: xml; brush: js;\" ng:non-bindable>\nangular.widget('my:watch', function(compileElement) {\n var compiler = this;\n var exp = compileElement.attr('exp');\n return function(linkElement) {\n var currentScope = this;\n currentScope.$watch(exp, function(value){\n alert(value);\n }};\n };\n});\n</pre>\n\n<h2>Attribute Widget</h2>\n\n<p>Let's implement the same widget, but this time as an attribute \nthat can be added to any existing DOM element.</p>\n\n<pre class=\"brush: xml; brush: js;\" ng:non-bindable>\n<div my-watch=\"name\">text</div>\n</pre>\n\n<p>You can implement <code>my:watch</code> attribute like this:</p>\n\n<pre class=\"brush: xml; brush: js;\" ng:non-bindable>\nangular.widget('@my:watch', function(expression, compileElement) {\n var compiler = this;\n return function(linkElement) {\n var currentScope = this;\n currentScope.$watch(expression, function(value){\n alert(value);\n });\n };\n});\n</pre>","example":"<script>\n angular.widget('my:time', function(compileElement){\n compileElement.css('display', 'block');\n return function(linkElement){\n function update(){\n linkElement.text('Current time is: ' + new Date());\n setTimeout(update, 1000);\n }\n update();\n };\n });\n</script>\n<my:time></my:time>"},{"raw":{"file":"src/Angular.js","line":171},"ngdoc":"overview","name":"angular.validator","shortName":"validator","namespace":"Namespace for all filters.","description":"<h2>Overview</h2>\n\n<p>Validators are a standard way to check the user input against a specific criteria. For \nexample, you might need to check that an input field contains a well-formed phone number.</p>\n\n<h2>Syntax</h2>\n\n<p>Attach a validator on user input widgets using the <code>ng:validate</code> attribute.</p>\n\n<p><doc:example>\n <doc:source>\n Change me: <input type=\"text\" name=\"number\" ng:validate=\"integer\" value=\"123\">\n </doc:source>\n <doc:scenario>\n it('should validate the default number string', function() {\n expect(element('input[name=number]').attr('class')).\n not().toMatch(/ng-validation-error/);\n });\n it('should not validate \"foo\"', function() {\n input('number').enter('foo');\n expect(element('input[name=number]').attr('class')).\n toMatch(/ng-validation-error/);\n });\n </doc:scenario>\n</doc:example></p>\n\n<h2>Writing your own Validators</h2>\n\n<p>Writing your own validator is easy. To make a function available as a \nvalidator, just define the JavaScript function on the <code>angular.validator</code> \nobject. <tt><angular/></tt> passes in the input to validate as the first argument \nto your function. Any additional validator arguments are passed in as \nadditional arguments to your function.</p>\n\n<p>You can use these variables in the function:</p>\n\n<ul>\n<li><code>this</code> \u2014 The current scope.</li>\n<li><code>this.$element</code> \u2014 The DOM element containing the binding. This allows the filter to manipulate\nthe DOM in addition to transforming the input.</li>\n</ul>\n\n<p>In this example we have written a upsTrackingNo validator. \nIt marks the input text \"valid\" only when the user enters a well-formed \nUPS tracking number.</p>","css":"ng-validation-error\n When validation fails, this css class is applied to the binding, making its borders red by\n default.","example":"<script>\n angular.validator('upsTrackingNo', function(input, format) {\n var regexp = new RegExp(\"^\" + format.replace(/9/g, '\\\\d') + \"$\");\n return input.match(regexp)?\"\":\"The format must match \" + format;\n });\n</script>\n<input type=\"text\" name=\"trackNo\" size=\"40\"\n ng:validate=\"upsTrackingNo:'1Z 999 999 99 9999 999 9'\" \n value=\"1Z 123 456 78 9012 345 6\"/>","scenario":"it('should validate correct UPS tracking number', function() {\n expect(element('input[name=trackNo]').attr('class')).\n not().toMatch(/ng-validation-error/);\n});\n\nit('should not validate in correct UPS tracking number', function() {\n input('trackNo').enter('foo');\n expect(element('input[name=trackNo]').attr('class')).\n toMatch(/ng-validation-error/);\n});\n"},{"raw":{"file":"src/Angular.js","line":249},"ngdoc":"overview","name":"angular.filter","shortName":"filter","namespace":"Namespace for all filters.","description":"<h2>Overview</h2>\n\n<p>Filters are a standard way to format your data for display to the user. For example, you\nmight have the number 1234.5678 and would like to display it as US currency: $1,234.57.\nFilters allow you to do just that. In addition to transforming the data, filters also modify\nthe DOM. This allows the filters to for example apply css styles to the filtered output if\ncertain conditions were met.</p>\n\n<h2>Standard Filters</h2>\n\n<p>The Angular framework provides a standard set of filters for common operations, including:\n{@link angular.filter.currency}, {@link angular.filter.json}, {@link angular.filter.number},\nand {@link angular.filter.html}. You can also add your own filters.</p>\n\n<h2>Syntax</h2>\n\n<p>Filters can be part of any {@link angular.scope} evaluation but are typically used with\n{{bindings}}. Filters typically transform the data to a new data type, formating the data in\nthe process. Filters can be chained and take optional arguments. Here are few examples:</p>\n\n<ul>\n<li>No filter: {{1234.5678}} => 1234.5678</li>\n<li>Number filter: {{1234.5678|number}} => 1,234.57. Notice the \u201c,\u201d and rounding to two\nsignificant digits.</li>\n<li>Filter with arguments: {{1234.5678|number:5}} => 1,234.56780. Filters can take optional\narguments, separated by colons in a binding. To number, the argument \u201c5\u201d requests 5 digits\nto the right of the decimal point.</li>\n</ul>\n\n<h2>Writing your own Filters</h2>\n\n<p>Writing your own filter is very easy: just define a JavaScript function on <code>angular.filter</code>.\nThe framework passes in the input value as the first argument to your function. Any filter\narguments are passed in as additional function arguments.</p>\n\n<p>You can use these variables in the function:</p>\n\n<ul>\n<li><code>this</code> \u2014 The current scope.</li>\n<li><code>this.$element</code> \u2014 The DOM element containing the binding. This allows the filter to manipulate\nthe DOM in addition to transforming the input.</li>\n</ul>","exampleDescription":"<p>The following example filter reverses a text string. In addition, it conditionally makes the\ntext upper-case (to demonstrate optional arguments) and assigns color (to demonstrate DOM\nmodification).</p>","example":" <script type=\"text/javascript\">\n angular.filter('reverse', function(input, uppercase, color) {\n var out = \"\";\n for (var i = 0; i < input.length; i++) {\n out = input.charAt(i) + out;\n }\n if (uppercase) {\n out = out.toUpperCase();\n }\n if (color) {\n this.$element.css('color', color);\n }\n return out;\n });\n </script>\n\n <input name=\"text\" type=\"text\" value=\"hello\" /><br>\n No filter: {{text}}<br>\n Reverse: {{text|reverse}}<br>\n Reverse + uppercase: {{text|reverse:true}}<br>\n Reverse + uppercase + blue: {{text|reverse:true:\"blue\"}}\n"},{"raw":{"file":"src/Angular.js","line":326},"ngdoc":"overview","name":"angular.formatter","shortName":"formatter","namespace":"Namespace for all formats.","description":"<h2>Overview</h2>\n\n<p>The formatters are responsible for translating user readable text in an input widget to a\ndata model stored in an application.</p>\n\n<h2>Writting your own Fromatter</h2>\n\n<p>Writing your own formatter is easy. Just register a pair of JavaScript functions with \n<code>angular.formatter</code>. One function for parsing user input text to the stored form, \nand one for formatting the stored data to user-visible text.</p>\n\n<p>Here is an example of a \"reverse\" formatter: The data is stored in uppercase and in \nreverse, while it is displayed in lower case and non-reversed. User edits are \nautomatically parsed into the internal form and data changes are automatically \nformatted to the viewed form.</p>\n\n<pre class=\"brush: xml; brush: js;\" ng:non-bindable>\nfunction reverse(text) {\n var reversed = [];\n for (var i = 0; i < text.length; i++) {\n reversed.unshift(text.charAt(i));\n }\n return reversed.join('');\n}\n\nangular.formatter('reverse', {\n parse: function(value){\n return reverse(value||'').toUpperCase();\n },\n format: function(value){\n return reverse(value||'').toLowerCase();\n }\n});\n</pre>","example":"<script type=\"text/javascript\">\nfunction reverse(text) {\n var reversed = [];\n for (var i = 0; i < text.length; i++) {\n reversed.unshift(text.charAt(i));\n }\n return reversed.join('');\n}\n\nangular.formatter('reverse', {\n parse: function(value){\n return reverse(value||'').toUpperCase();\n },\n format: function(value){\n return reverse(value||'').toLowerCase();\n }\n});\n</script>\n\nFormatted: \n<input type=\"text\" name=\"data\" value=\"angular\" ng:format=\"reverse\"/>\n<br/>\n\nStored: \n<input type=\"text\" name=\"data\"/><br/>\n<pre>{{data}}</pre>","scenario":"it('should store reverse', function(){\n expect(element('.doc-example input:first').val()).toEqual('angular');\n expect(element('.doc-example input:last').val()).toEqual('RALUGNA');\n \n this.addFutureAction('change to XYZ', function($window, $document, done){\n $document.elements('.doc-example input:last').val('XYZ').trigger('change');\n done();\n });\n expect(element('input:first').val()).toEqual('zyx');\n});"}],"directive":[{"raw":{"file":"src/directives.js","line":1},"ngdoc":"directive","name":"angular.directive.ng:init","shortName":"ng:init","description":"<p><code>ng:init</code> attribute allows the for initialization tasks to be executed \n before the template enters execution mode during bootstrap.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval."},"example":"<div ng:init=\"greeting='Hello'; person='World'\">\n {{greeting}} {{person}}!\n</div>","scenario":" it('should check greeting', function(){\n expect(binding('greeting')).toBe('Hello');\n expect(binding('person')).toBe('World');\n });"},{"raw":{"file":"src/directives.js","line":29},"ngdoc":"directive","name":"angular.directive.ng:controller","shortName":"ng:controller","description":"<p>To support the Model-View-Controller design pattern, it is possible \nto assign behavior to a scope through <code>ng:controller</code>. The scope is \nthe MVC model. The HTML (with data bindings) is the MVC view. \nThe <code>ng:controller</code> directive specifies the MVC controller class</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval."},"example":"<script type=\"text/javascript\">\n function SettingsController() {\n this.name = \"John Smith\";\n this.contacts = [\n {type:'phone', value:'408 555 1212'},\n {type:'email', value:'[email protected]'} ];\n }\n SettingsController.prototype = {\n greet: function(){\n alert(this.name);\n },\n addContact: function(){\n this.contacts.push({type:'email', value:'[email protected]'});\n },\n removeContact: function(contactToRemove) {\n angular.Array.remove(this.contacts, contactToRemove);\n },\n clearContact: function(contact) {\n contact.type = 'phone';\n contact.value = '';\n }\n };\n</script>\n<div ng:controller=\"SettingsController\">\n Name: <input type=\"text\" name=\"name\"/> \n [ <a href=\"\" ng:click=\"greet()\">greet</a> ]<br/>\n Contact:\n <ul>\n <li ng:repeat=\"contact in contacts\">\n <select name=\"contact.type\">\n <option>phone</option>\n <option>email</option>\n </select>\n <input type=\"text\" name=\"contact.value\"/>\n [ <a href=\"\" ng:click=\"clearContact(contact)\">clear</a> \n | <a href=\"\" ng:click=\"removeContact(contact)\">X</a> ]\n </li>\n <li>[ <a href=\"\" ng:click=\"addContact()\">add</a> ]</li>\n </ul>\n</div>","scenario":" it('should check controller', function(){\n expect(element('.doc-example-live div>:input').val()).toBe('John Smith');\n expect(element('.doc-example-live li[ng\\\\:repeat-index=\"0\"] input').val()).toBe('408 555 1212');\n expect(element('.doc-example-live li[ng\\\\:repeat-index=\"1\"] input').val()).toBe('[email protected]');\n element('.doc-example-live li:first a:contains(\"clear\")').click();\n expect(element('.doc-example-live li:first input').val()).toBe('');\n element('.doc-example-live li:last a:contains(\"add\")').click();\n expect(element('.doc-example-live li[ng\\\\:repeat-index=\"2\"] input').val()).toBe('[email protected]');\n });"},{"raw":{"file":"src/directives.js","line":107},"ngdoc":"directive","name":"angular.directive.ng:eval","shortName":"ng:eval","description":"<p>The <code>ng:eval</code> allows you to execute a binding which has side effects \nwithout displaying the result to the user.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval."},"exampleDescription":"<p>Notice that <code>{{</code> <code>obj.multiplied = obj.a * obj.b</code> <code>}}</code> has a side effect of assigning \na value to <code>obj.multiplied</code> and displaying the result to the user. Sometimes, \nhowever, it is desirable to execute a side effect without showing the value to \nthe user. In such a case <code>ng:eval</code> allows you to execute code without updating \nthe display.</p>","example":"<input name=\"obj.a\" value=\"6\" > \n * <input name=\"obj.b\" value=\"2\"> \n = {{obj.multiplied = obj.a * obj.b}} <br>\n<span ng:eval=\"obj.divide = obj.a / obj.b\"></span>\n<span ng:eval=\"obj.updateCount = 1 + (obj.updateCount||0)\"></span>\n<tt>obj.divide = {{obj.divide}}</tt><br/>\n<tt>obj.updateCount = {{obj.updateCount}}</tt>","scenario":" it('should check eval', function(){\n expect(binding('obj.divide')).toBe('3');\n expect(binding('obj.updateCount')).toBe('2');\n input('obj.a').enter('12');\n expect(binding('obj.divide')).toBe('6');\n expect(binding('obj.updateCount')).toBe('3');\n });"},{"raw":{"file":"src/directives.js","line":149},"ngdoc":"directive","name":"angular.directive.ng:bind","shortName":"ng:bind","description":"<p>The <code>ng:bind</code> attribute asks <tt><angular/></tt> to replace the text content of this \nHTML element with the value of the given expression and kept it up to \ndate when the expression's value changes. Usually you just write \n{{expression}} and let <tt><angular/></tt> compile it into \n<span ng:bind=\"expression\"></span> at bootstrap time.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval."},"exampleDescription":"<p>Try it here: enter text in text box and watch the greeting change.</p>","example":"Enter name: <input type=\"text\" name=\"name\" value=\"Whirled\">. <br>\nHello <span ng:bind=\"name\" />!","scenario":" it('should check ng:bind', function(){\n expect(using('.doc-example-live').binding('name')).toBe('Whirled');\n using('.doc-example-live').input('name').enter('world');\n expect(using('.doc-example-live').binding('name')).toBe('world');\n });"},{"raw":{"file":"src/directives.js","line":252},"ngdoc":"directive","name":"angular.directive.ng:bind-template","shortName":"ng:bind-template","description":"<p>The <code>ng:bind-template</code> attribute specifies that the element \ntext should be replaced with the template in ng:bind-template. \nUnlike ng:bind the ng:bind-template can contain multiple <code>{{</code> <code>}}</code> \nexpressions. (This is required since some HTML elements \ncan not have SPAN elements such as TITLE, or OPTION to name a few.</p>","element":"ANY","param":[{"type":"string","name":"template","description":"of form\n <tt>{{</tt> <tt>expression</tt> <tt>}}</tt> to eval."}],"paramRest":[],"paramFirst":{"type":"string","name":"template","description":"of form\n <tt>{{</tt> <tt>expression</tt> <tt>}}</tt> to eval."},"exampleDescription":"<p>Try it here: enter text in text box and watch the greeting change.</p>","example":"Salutation: <input type=\"text\" name=\"salutation\" value=\"Hello\"><br/>\nName: <input type=\"text\" name=\"name\" value=\"World\"><br/>\n<pre ng:bind-template=\"{{salutation}} {{name}}!\"></pre>","scenario":" it('should check ng:bind', function(){\n expect(using('.doc-example-live').binding('{{salutation}} {{name}}')).\n toBe('Hello World!');\n using('.doc-example-live').input('salutation').enter('Greetings');\n using('.doc-example-live').input('name').enter('user');\n expect(using('.doc-example-live').binding('{{salutation}} {{name}}')).\n toBe('Greetings user!');\n });"},{"raw":{"file":"src/directives.js","line":304},"ngdoc":"directive","name":"angular.directive.ng:bind-attr","shortName":"ng:bind-attr","description":"<p>The <code>ng:bind-attr</code> attribute specifies that the element attributes \nwhich should be replaced by the expression in it. Unlike <code>ng:bind</code> \nthe <code>ng:bind-attr</code> contains a JSON key value pairs representing \nwhich attributes need to be changed. You don\u2019t usually write the \n<code>ng:bind-attr</code> in the HTML since embedding \n<tt ng:non-bindable>{{expression}}</tt> into the \nattribute directly is the preferred way. The attributes get\ntranslated into <span ng:bind-attr=\"{attr:expression}\"/> at\nbootstrap time.</p>\n\n<p>This HTML snippet is preferred way of working with <code>ng:bind-attr</code></p>\n\n<pre class=\"brush: xml; brush: js;\" ng:non-bindable>\n <a href=\"http://www.google.com/search?q={{query}}\">Google</a>\n</pre>\n\n<p>The above gets translated to bellow during bootstrap time.</p>\n\n<pre class=\"brush: xml; brush: js;\" ng:non-bindable>\n <a ng:bind-attr='{\"href\":\"http://www.google.com/search?q={{query}}\"}'>Google</a>\n</pre>","element":"ANY","param":[{"type":"string","name":"attribute_json","description":"a JSON key-value pairs representing \n the attributes to replace. Each key matches the attribute \n which needs to be replaced. Each value is a text template of \n the attribute with embedded \n <tt ng:non-bindable>{{expression}}</tt>s. Any number of \n key-value pairs can be specified."}],"paramRest":[],"paramFirst":{"type":"string","name":"attribute_json","description":"a JSON key-value pairs representing \n the attributes to replace. Each key matches the attribute \n which needs to be replaced. Each value is a text template of \n the attribute with embedded \n <tt ng:non-bindable>{{expression}}</tt>s. Any number of \n key-value pairs can be specified."},"exampleDescription":"<p>Try it here: enter text in text box and click Google.</p>","example":"Google for: \n<input type=\"text\" name=\"query\" value=\"AngularJS\"/> \n<a href=\"http://www.google.com/search?q={{query}}\">Google</a>","scenario":" it('should check ng:bind-attr', function(){\n expect(using('.doc-example-live').element('a').attr('href')).\n toBe('http://www.google.com/search?q=AngularJS');\n using('.doc-example-live').input('query').enter('google');\n expect(using('.doc-example-live').element('a').attr('href')).\n toBe('http://www.google.com/search?q=google');\n });"},{"raw":{"file":"src/directives.js","line":381},"ngdoc":"directive","name":"angular.directive.ng:non-bindable","shortName":"ng:non-bindable","description":"<p>Sometimes it is necessary to write code which looks like \nbindings but which should be left alone by <tt><angular/></tt>. \nUse <code>ng:non-bindable</code> to ignore a chunk of HTML.</p>","element":"ANY","param":[{"type":"string","name":"ignore","description":""}],"paramRest":[],"paramFirst":{"type":"string","name":"ignore","description":""},"exampleDescription":"<p>In this example there are two location where \n<tt ng:non-bindable>{{1 + 2}}</tt> is present, but the one \nwrapped in <code>ng:non-bindable</code> is left alone</p>","example":"<div>Normal: {{1 + 2}}</div>\n<div ng:non-bindable>Ignored: {{1 + 2}}</div>","scenario":" it('should check ng:non-bindable', function(){\n expect(using('.doc-example-live').binding('1 + 2')).toBe('3');\n expect(using('.doc-example-live').element('div:last').text()).\n toMatch(/1 \\+ 2/);\n });"},{"raw":{"file":"src/directives.js","line":410},"ngdoc":"directive","name":"angular.directive.ng:repeat","shortName":"ng:repeat","description":"<p><code>ng:repeat</code> instantiates a template once per item from a \ncollection. The collection is enumerated with \n<code>ng:repeat-index</code> attribute starting from 0. Each template \ninstance gets its own scope where the given loop variable \nis set to the current collection item and <code>$index</code> is set \nto the item index or key.</p>\n\n<p>NOTE: <code>ng:repeat</code> looks like a directive, but is actually a \nattribute widget.</p>","element":"ANY","param":[{"type":"repeat","name":"repeat_expression","description":"to itterate over.</p>\n\n<ul>\n<li><code>variable in expression</code>, where variable is the user \ndefined loop variable and expression is a scope expression \ngiving the collection to enumerate. For example: \n<code>track in cd.tracks</code>.</li>\n<li><code>(key, value) in expression</code>, where key and value can \nbe any user defined identifiers, and expression is the \nscope expression giving the collection to enumerate. \nFor example: <code>(name, age) in {'adam':10, 'amalie':12}</code>.</li>\n</ul>\n\n<p>Special properties set on the local scope:\n * {number} $index - iterator offset of the repeated element (0..length-1)\n * {string} $position - position of the repeated element in the iterator ('first', 'middle', 'last')"}],"paramRest":[],"paramFirst":{"type":"repeat","name":"repeat_expression","description":"to itterate over.</p>\n\n<ul>\n<li><code>variable in expression</code>, where variable is the user \ndefined loop variable and expression is a scope expression \ngiving the collection to enumerate. For example: \n<code>track in cd.tracks</code>.</li>\n<li><code>(key, value) in expression</code>, where key and value can \nbe any user defined identifiers, and expression is the \nscope expression giving the collection to enumerate. \nFor example: <code>(name, age) in {'adam':10, 'amalie':12}</code>.</li>\n</ul>\n\n<p>Special properties set on the local scope:\n * {number} $index - iterator offset of the repeated element (0..length-1)\n * {string} $position - position of the repeated element in the iterator ('first', 'middle', 'last')"},"exampleDescription":"<p>This example initializes the scope to a list of names and \nthan uses <code>ng:repeat</code> to display every person.</p>","example":"<div ng:init=\"friends = [{name:'John', age:25}, {name:'Mary', age:28}]\">\n I have {{friends.length}} friends. They are:\n <ul>\n <li ng:repeat=\"friend in friends\"> \n [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.\n </li>\n </ul>\n</div>","scenario":" it('should check ng:repeat', function(){\n var r = using('.doc-example-live').repeater('ul li'); \n expect(r.count()).toBe(2);\n expect(r.row(0)).toEqual([\"1\",\"John\",\"25\"]);\n expect(r.row(1)).toEqual([\"2\",\"Mary\",\"28\"]);\n });"},{"raw":{"file":"src/directives.js","line":536},"ngdoc":"directive","name":"angular.directive.ng:click","shortName":"ng:click","description":"<p>The ng:click allows you to specify custom behavior when \nelement is clicked.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval upon click."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval upon click."},"example":"<button ng:click=\"count = count + 1\" ng:init=\"count=0\">\n Increment\n</button>\ncount: {{count}}","scenario":" it('should check ng:click', function(){\n expect(binding('count')).toBe('0');\n element('.doc-example-live :button').click();\n expect(binding('count')).toBe('1');\n });"},{"raw":{"file":"src/directives.js","line":579},"ngdoc":"directive","name":"angular.directive.ng:submit","shortName":"ng:submit","description":"","element":"form","param":[{"type":"expression","name":"expression","description":"to eval."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval."},"exampleDescription":"","example":"<form ng:submit=\"list.push(text);text='';\" ng:init=\"list=[]\">\n Enter text and hit enter: \n <input type=\"text\" name=\"text\" value=\"hello\"/>\n</form>\n<pre>list={{list}}</pre>","scenario":" it('should check ng:submit', function(){\n expect(binding('list')).toBe('list=[]');\n element('.doc-example-live form input').click();\n this.addFutureAction('submit from', function($window, $document, done) {\n $window.angular.element(\n $document.elements('.doc-example-live form')).\n trigger('submit');\n done();\n });\n expect(binding('list')).toBe('list=[\"hello\"]');\n });"},{"raw":{"file":"src/directives.js","line":626},"ngdoc":"directive","name":"angular.directive.ng:watch","shortName":"ng:watch","description":"<p>The <code>ng:watch</code> allows you watch a variable and then execute \nan evaluation on variable change.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval."},"exampleDescription":"<p>Notice that the counter is incremented \nevery time you change the text.</p>","example":"<div ng:init=\"counter=0\" ng:watch=\"name: counter = counter+1\">\n <input type=\"text\" name=\"name\" value=\"hello\"><br/>\n Change counter: {{counter}} Name: {{name}}\n</div>","scenario":" it('should check ng:watch', function(){\n expect(using('.doc-example-live').binding('counter')).toBe('2');\n using('.doc-example-live').input('name').enter('abc');\n expect(using('.doc-example-live').binding('counter')).toBe('3');\n });"},{"raw":{"file":"src/directives.js","line":680},"ngdoc":"directive","name":"angular.directive.ng:class","shortName":"ng:class","description":"<p>The <code>ng:class</code> allows you to set CSS class on HTML element \nconditionally.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval."},"exampleDescription":"","example":"<input type=\"button\" value=\"set\" ng:click=\"myVar='ng-input-indicator-wait'\">\n<input type=\"button\" value=\"clear\" ng:click=\"myVar=''\">\n<br>\n<span ng:class=\"myVar\">Sample Text &nbsp;&nbsp;&nbsp;&nbsp;</span>","scenario":" it('should check ng:class', function(){\n expect(element('.doc-example-live span').attr('className')).not().\n toMatch(/ng-input-indicator-wait/);\n\n using('.doc-example-live').element(':button:first').click();\n\n expect(element('.doc-example-live span').attr('className')).\n toMatch(/ng-input-indicator-wait/);\n\n using('.doc-example-live').element(':button:last').click();\n \n expect(element('.doc-example-live span').attr('className')).not().\n toMatch(/ng-input-indicator-wait/);\n });"},{"raw":{"file":"src/directives.js","line":716},"ngdoc":"directive","name":"angular.directive.ng:class-odd","shortName":"ng:class-odd","description":"<p>The <code>ng:class-odd</code> and <code>ng:class-even</code> works exactly as \n<code>ng:class</code>, except it works in conjunction with <code>ng:repeat</code> \nand takes affect only on odd (even) rows.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval. Must be inside \n<code>ng:repeat</code>."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval. Must be inside \n<code>ng:repeat</code>."},"exampleDescription":"","example":"<ol ng:init=\"names=['John', 'Mary', 'Cate', 'Suz']\">\n <li ng:repeat=\"name in names\">\n <span ng:class-odd=\"'ng-format-negative'\"\n ng:class-even=\"'ng-input-indicator-wait'\">\n {{name}} &nbsp; &nbsp; &nbsp; \n </span>\n </li>\n</ol>","scenario":" it('should check ng:class-odd and ng:class-even', function(){\n expect(element('.doc-example-live li:first span').attr('className')).\n toMatch(/ng-format-negative/);\n expect(element('.doc-example-live li:last span').attr('className')).\n toMatch(/ng-input-indicator-wait/);\n });"},{"raw":{"file":"src/directives.js","line":751},"ngdoc":"directive","name":"angular.directive.ng:class-even","shortName":"ng:class-even","description":"<p>The <code>ng:class-odd</code> and <code>ng:class-even</code> works exactly as \n<code>ng:class</code>, except it works in conjunction with <code>ng:repeat</code> \nand takes affect only on odd (even) rows.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval. Must be inside \n<code>ng:repeat</code>."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval. Must be inside \n<code>ng:repeat</code>."},"exampleDescription":"","example":"<ol ng:init=\"names=['John', 'Mary', 'Cate', 'Suz']\">\n <li ng:repeat=\"name in names\">\n <span ng:class-odd=\"'ng-format-negative'\"\n ng:class-even=\"'ng-input-indicator-wait'\">\n {{name}} &nbsp; &nbsp; &nbsp; \n </span>\n </li>\n</ol>","scenario":" it('should check ng:class-odd and ng:class-even', function(){\n expect(element('.doc-example-live li:first span').attr('className')).\n toMatch(/ng-format-negative/);\n expect(element('.doc-example-live li:last span').attr('className')).\n toMatch(/ng-input-indicator-wait/);\n });"},{"raw":{"file":"src/directives.js","line":786},"ngdoc":"directive","name":"angular.directive.ng:show","shortName":"ng:show","description":"<p>The <code>ng:show</code> and <code>ng:hide</code> allows you to show or hide a portion\nof the HTML conditionally.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"if truthy then the element is \nshown or hidden respectively."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"if truthy then the element is \nshown or hidden respectively."},"exampleDescription":"","example":"Click me: <input type=\"checkbox\" name=\"checked\"><br/>\nShow: <span ng:show=\"checked\">I show up when you checkbox is checked?</span> <br/>\nHide: <span ng:hide=\"checked\">I hide when you checkbox is checked?</span>","scenario":" it('should check ng:show / ng:hide', function(){\n expect(element('.doc-example-live span:first:hidden').count()).toEqual(1);\n expect(element('.doc-example-live span:last:visible').count()).toEqual(1);\n \n input('checked').check();\n \n expect(element('.doc-example-live span:first:visible').count()).toEqual(1);\n expect(element('.doc-example-live span:last:hidden').count()).toEqual(1);\n });"},{"raw":{"file":"src/directives.js","line":823},"ngdoc":"directive","name":"angular.directive.ng:hide","shortName":"ng:hide","description":"<p>The <code>ng:show</code> and <code>ng:hide</code> allows you to show or hide a portion\nof the HTML conditionally.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"if truthy then the element is \nshown or hidden respectively."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"if truthy then the element is \nshown or hidden respectively."},"exampleDescription":"","example":"Click me: <input type=\"checkbox\" name=\"checked\"><br/>\nShow: <span ng:show=\"checked\">I show up when you checkbox is checked?</span> <br/>\nHide: <span ng:hide=\"checked\">I hide when you checkbox is checked?</span>","scenario":" it('should check ng:show / ng:hide', function(){\n expect(element('.doc-example-live span:first:hidden').count()).toEqual(1);\n expect(element('.doc-example-live span:last:visible').count()).toEqual(1);\n \n input('checked').check();\n \n expect(element('.doc-example-live span:first:visible').count()).toEqual(1);\n expect(element('.doc-example-live span:last:hidden').count()).toEqual(1);\n });"},{"raw":{"file":"src/directives.js","line":860},"ngdoc":"directive","name":"angular.directive.ng:style","shortName":"ng:style","description":"","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval."},"exampleDescription":"","example":"","scenario":" it('should check ng:style', function(){\n });"}],"filter":[{"raw":{"file":"src/filters.js","line":1},"ngdoc":"filter","name":"angular.filter.currency","shortName":"currency","function":"","description":"<p>Formats a number as a currency (ie $1,234.56).</p>","param":[{"type":"number","name":"amount","description":"Input to filter."}],"paramRest":[],"paramFirst":{"type":"number","name":"amount","description":"Input to filter."},"returns":"<p>{string} Formated number.</p>","css":"ng-format-negative\n When the value is negative, this css class is applied to the binding making it by default red.","example":"<input type=\"text\" name=\"amount\" value=\"1234.56\"/> <br/>\n{{amount | currency}}","scenario":" it('should init with 1234.56', function(){\n expect(binding('amount | currency')).toBe('$1,234.56');\n });\n it('should update', function(){\n input('amount').enter('-1234');\n expect(binding('amount | currency')).toBe('$-1,234.00');\n expect(element('.doc-example-live .ng-binding').attr('className')).\n toMatch(/ng-format-negative/);\n });"},{"raw":{"file":"src/filters.js","line":35},"ngdoc":"filter","name":"angular.filter.number","shortName":"number","function":"","description":"<p>Formats a number as text.</p>\n\n<p>If the input is not a number empty string is returned.</p>","param":[{"type":"(number|string)","name":"number","description":"Number to format."},{"type":"(number|string)","name":"fractionSize","default":"2","description":"Number of decimal places to round the number to. Default 2."}],"paramRest":[{"type":"(number|string)","name":"fractionSize","default":"2","description":"Number of decimal places to round the number to. Default 2."}],"paramFirst":{"type":"(number|string)","name":"number","description":"Number to format."},"returns":"<p>{string} Number rounded to decimalPlaces and places a \u201c,\u201d after each third digit.</p>","example":"Enter number: <input name='val' value='1234.56789' /><br/>\nDefault formatting: {{val | number}}<br/>\nNo fractions: {{val | number:0}}<br/>\nNegative number: {{-val | number:4}}","scenario":" it('should format numbers', function(){\n expect(binding('val | number')).toBe('1,234.57');\n expect(binding('val | number:0')).toBe('1,235');\n expect(binding('-val | number:4')).toBe('-1,234.5679');\n });\n\n it('should update', function(){\n input('val').enter('3374.333');\n expect(binding('val | number')).toBe('3,374.33');\n expect(binding('val | number:0')).toBe('3,374');\n expect(binding('-val | number:4')).toBe('-3,374.3330');\n });"},{"raw":{"file":"src/filters.js","line":150},"ngdoc":"filter","name":"angular.filter.date","shortName":"date","function":"","description":"<p>Formats <code>date</code> to a string based on the requested <code>format</code>.</p>\n\n<p><code>format</code> string can be composed of the following elements:</p>\n\n<ul>\n<li><code>'yyyy'</code>: 4 digit representation of year e.g. 2010</li>\n<li><code>'yy'</code>: 2 digit representation of year, padded (00-99)</li>\n<li><code>'MM'</code>: Month in year, padded (01\u201212)</li>\n<li><code>'M'</code>: Month in year (1\u201212)</li>\n<li><code>'dd'</code>: Day in month, padded (01\u201231)</li>\n<li><code>'d'</code>: Day in month (1-31)</li>\n<li><code>'HH'</code>: Hour in day, padded (00\u201223)</li>\n<li><code>'H'</code>: Hour in day (0-23)</li>\n<li><code>'hh'</code>: Hour in am/pm, padded (01\u201212)</li>\n<li><code>'h'</code>: Hour in am/pm, (1-12)</li>\n<li><code>'mm'</code>: Minute in hour, padded (00\u201259)</li>\n<li><code>'m'</code>: Minute in hour (0-59)</li>\n<li><code>'ss'</code>: Second in minute, padded (00\u201259)</li>\n<li><code>'s'</code>: Second in minute (0\u201259)</li>\n<li><code>'a'</code>: am/pm marker</li>\n<li><code>'Z'</code>: 4 digit (+sign) representation of the timezone offset (-1200\u20121200)</li>\n</ul>","param":[{"type":"(Date|number|string)","name":"date","description":"Date to format either as Date object, milliseconds (string or\n number) or ISO 8601 extended datetime string (yyyy-MM-ddTHH:mm:ss.SSSZ)."},{"type":"string","name":"format","description":"Formatting rules. If not specified, Date#toLocaleDateString is used."}],"paramRest":[{"type":"string","name":"format","description":"Formatting rules. If not specified, Date#toLocaleDateString is used."}],"paramFirst":{"type":"(Date|number|string)","name":"date","description":"Date to format either as Date object, milliseconds (string or\n number) or ISO 8601 extended datetime string (yyyy-MM-ddTHH:mm:ss.SSSZ)."},"returns":"<p>{string} Formatted string or the input if input is not recognized as date/millis.</p>","example":"<span ng:non-bindable>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span>:\n {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}<br/>\n<span ng:non-bindable>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span>:\n {{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}<br/>","scenario":" it('should format date', function(){\n expect(binding(\"1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'\")).\n toMatch(/2010\\-10\\-2\\d \\d{2}:\\d{2}:\\d{2} \\-?\\d{4}/);\n expect(binding(\"'1288323623006' | date:'MM/dd/yyyy @ h:mma'\")).\n toMatch(/10\\/2\\d\\/2010 @ \\d{1,2}:\\d{2}(am|pm)/);\n });\n"},{"raw":{"file":"src/filters.js","line":231},"ngdoc":"filter","name":"angular.filter.json","shortName":"json","function":"","description":"<p>Allows you to convert a JavaScript object into JSON string.</p>\n\n<p>This filter is mostly useful for debugging. When using the double curly {{value}} notation\nthe binding is automatically converted to JSON.</p>","param":[{"type":"*","name":"object","description":"Any JavaScript object (including arrays and primitive types) to filter."}],"paramRest":[],"paramFirst":{"type":"*","name":"object","description":"Any JavaScript object (including arrays and primitive types) to filter."},"returns":"<p>{string} JSON string.</p>","css":"ng-monospace Always applied to the encapsulating element.","example":"<input type=\"text\" name=\"objTxt\" value=\"{a:1, b:[]}\"\n ng:eval=\"obj = $eval(objTxt)\"/>\n<pre>{{ obj | json }}</pre>","scenario":" it('should jsonify filtered objects', function() {\n expect(binding('obj | json')).toBe('{\\n \"a\":1,\\n \"b\":[]}');\n });\n\n it('should update', function() {\n input('objTxt').enter('[1, 2, 3]');\n expect(binding('obj | json')).toBe('[1,2,3]');\n });\n"},{"raw":{"file":"src/filters.js","line":269},"ngdoc":"filter","name":"angular.filter.lowercase","shortName":"lowercase","function":"","see":"angular.lowercase"},{"raw":{"file":"src/filters.js","line":279},"ngdoc":"filter","name":"angular.filter.uppercase","shortName":"uppercase","function":"","see":"angular.uppercase"},{"raw":{"file":"src/filters.js","line":289},"ngdoc":"filter","name":"angular.filter.html","shortName":"html","function":"","description":"<p>Prevents the input from getting escaped by angular. By default the input is sanitized and\ninserted into the DOM as is.</p>\n\n<p>The input is sanitized by parsing the html into tokens. All safe tokens (from a whitelist) are\nthen serialized back to properly escaped html string. This means that no unsafe input can make\nit into the returned string, however since our parser is more strict than a typical browser\nparser, it's possible that some obscure input, which would be recognized as valid HTML by a\nbrowser, won't make it through the sanitizer.</p>\n\n<p>If you hate your users, you may call the filter with optional 'unsafe' argument, which bypasses\nthe html sanitizer, but makes your application vulnerable to XSS and other attacks. Using this\noption is strongly discouraged and should be used only if you absolutely trust the input being\nfiltered and you can't get the content through the sanitizer.</p>","param":[{"type":"string","name":"html","description":"Html input."},{"type":"string","name":"option","description":"If 'unsafe' then do not sanitize the HTML input."}],"paramRest":[{"type":"string","name":"option","description":"If 'unsafe' then do not sanitize the HTML input."}],"paramFirst":{"type":"string","name":"html","description":"Html input."},"returns":"<p>{string} Sanitized or raw html.</p>","example":" Snippet: <textarea name=\"snippet\" cols=\"60\" rows=\"3\">\n&lt;p style=\"color:blue\"&gt;an html\n&lt;em onmouseover=\"this.textContent='PWN3D!'\"&gt;click here&lt;/em&gt;\nsnippet&lt;/p&gt;</textarea>\n <table>\n <tr>\n <td>Filter</td>\n <td>Source</td>\n <td>Rendered</td>\n </tr>\n <tr id=\"html-filter\">\n <td>html filter</td>\n <td>\n <pre>&lt;div ng:bind=\"snippet | html\"&gt;<br/>&lt;/div&gt;</pre>\n </td>\n <td>\n <div ng:bind=\"snippet | html\"></div>\n </td>\n </tr>\n <tr id=\"escaped-html\">\n <td>no filter</td>\n <td><pre>&lt;div ng:bind=\"snippet\"&gt;<br/>&lt;/div&gt;</pre></td>\n <td><div ng:bind=\"snippet\"></div></td>\n </tr>\n <tr id=\"html-unsafe-filter\">\n <td>unsafe html filter</td>\n <td><pre>&lt;div ng:bind=\"snippet | html:'unsafe'\"&gt;<br/>&lt;/div&gt;</pre></td>\n <td><div ng:bind=\"snippet | html:'unsafe'\"></div></td>\n </tr>\n </table>","scenario":" it('should sanitize the html snippet ', function(){\n expect(using('#html-filter').binding('snippet | html')).\n toBe('<p>an html\\n<em>click here</em>\\nsnippet</p>');\n });\n\n it ('should escape snippet without any filter', function() {\n expect(using('#escaped-html').binding('snippet')).\n toBe(\"<p style=\\\"color:blue\\\">an html\\n\" +\n \"<em onmouseover=\\\"this.textContent='PWN3D!'\\\">click here</em>\\n\" +\n \"snippet</p>\");\n });\n\n it ('should inline raw snippet if filtered as unsafe', function() {\n expect(using('#html-unsafe-filter').binding(\"snippet | html:'unsafe'\")).\n toBe(\"<p style=\\\"color:blue\\\">an html\\n\" +\n \"<em onmouseover=\\\"this.textContent='PWN3D!'\\\">click here</em>\\n\" +\n \"snippet</p>\");\n });\n\n it('should update', function(){\n input('snippet').enter('new <b>text</b>');\n expect(using('#html-filter').binding('snippet | html')).toBe('new <b>text</b>');\n expect(using('#escaped-html').binding('snippet')).toBe(\"new <b>text</b>\");\n expect(using('#html-unsafe-filter').binding(\"snippet | html:'unsafe'\")).toBe('new <b>text</b>');\n });"},{"raw":{"file":"src/filters.js","line":377},"ngdoc":"filter","name":"angular.filter.linky","shortName":"linky","function":"","description":"<p>Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and\nplane email address links.</p>","param":[{"type":"string","name":"text","description":"Input text."}],"paramRest":[],"paramFirst":{"type":"string","name":"text","description":"Input text."},"returns":"<p>{string} Html-linkified text.</p>","example":" Snippet: <textarea name=\"snippet\" cols=\"60\" rows=\"3\">\nPretty text with some links:\nhttp://angularjs.org/,\nmailto:[email protected],\[email protected],\nand one more: ftp://127.0.0.1/.</textarea>\n <table>\n <tr>\n <td>Filter</td>\n <td>Source</td>\n <td>Rendered</td>\n </tr>\n <tr id=\"linky-filter\">\n <td>linky filter</td>\n <td>\n <pre>&lt;div ng:bind=\"snippet | linky\"&gt;<br/>&lt;/div&gt;</pre>\n </td>\n <td>\n <div ng:bind=\"snippet | linky\"></div>\n </td>\n </tr>\n <tr id=\"escaped-html\">\n <td>no filter</td>\n <td><pre>&lt;div ng:bind=\"snippet\"&gt;<br/>&lt;/div&gt;</pre></td>\n <td><div ng:bind=\"snippet\"></div></td>\n </tr>\n </table>","scenario":" it('should linkify the snippet with urls', function(){\n expect(using('#linky-filter').binding('snippet | linky')).\n toBe('Pretty text with some links:\\n' +\n '<a href=\"http://angularjs.org/\">http://angularjs.org/</a>,\\n' +\n '<a href=\"mailto:[email protected]\">[email protected]</a>,\\n' +\n '<a href=\"mailto:[email protected]\">[email protected]</a>,\\n' +\n 'and one more: <a href=\"ftp://127.0.0.1/\">ftp://127.0.0.1/</a>.');\n });\n\n it ('should not linkify snippet without the linky filter', function() {\n expect(using('#escaped-html').binding('snippet')).\n toBe(\"Pretty text with some links:\\n\" +\n \"http://angularjs.org/,\\n\" +\n \"mailto:[email protected],\\n\" +\n \"[email protected],\\n\" +\n \"and one more: ftp://127.0.0.1/.\");\n });\n\n it('should update', function(){\n input('snippet').enter('new http://link.');\n expect(using('#linky-filter').binding('snippet | linky')).\n toBe('new <a href=\"http://link\">http://link</a>.');\n expect(using('#escaped-html').binding('snippet')).toBe('new http://link.');\n });"}],"formatter":[{"raw":{"file":"src/formatters.js","line":10},"ngdoc":"formatter","name":"angular.formatter.json","shortName":"json","description":"<p>Formats the user input as JSON text.</p>","returns":"<p>{string} A JSON string representation of the model.</p>","example":"<div ng:init=\"data={name:'misko', project:'angular'}\">\n <input type=\"text\" size='50' name=\"data\" ng:format=\"json\"/>\n <pre>data={{data}}</pre>\n</div>","scenario":"it('should format json', function(){\n expect(binding('data')).toEqual('data={\\n \\\"name\\\":\\\"misko\\\",\\n \\\"project\\\":\\\"angular\\\"}');\n input('data').enter('{}');\n expect(binding('data')).toEqual('data={\\n }');\n});"},{"raw":{"file":"src/formatters.js","line":34},"ngdoc":"formatter","name":"angular.formatter.boolean","shortName":"boolean","description":"<p>Use boolean formatter if you wish to store the data as boolean.</p>","returns":"<p>Convert to <code>true</code> unless user enters (blank), <code>f</code>, <code>false</code>, <code>0</code>, <code>no</code>, <code>[]</code>.</p>","example":"Enter truthy text:\n<input type=\"text\" name=\"value\" ng:format=\"boolean\" value=\"no\"/>\n<input type=\"checkbox\" name=\"value\"/>\n<pre>value={{value}}</pre>","scenario":"it('should format boolean', function(){\n expect(binding('value')).toEqual('value=false');\n input('value').enter('truthy');\n expect(binding('value')).toEqual('value=true');\n});"},{"raw":{"file":"src/formatters.js","line":58},"ngdoc":"formatter","name":"angular.formatter.number","shortName":"number","description":"<p>Use number formatter if you wish to convert the user entered string to a number.</p>","returns":"<p>parse string to number.</p>","example":"Enter valid number:\n<input type=\"text\" name=\"value\" ng:format=\"number\" value=\"1234\"/>\n<pre>value={{value}}</pre>","scenario":"it('should format numbers', function(){\n expect(binding('value')).toEqual('value=1234');\n input('value').enter('5678');\n expect(binding('value')).toEqual('value=5678');\n});"},{"raw":{"file":"src/formatters.js","line":87},"ngdoc":"formatter","name":"angular.formatter.list","shortName":"list","description":"<p>Use number formatter if you wish to convert the user entered string to a number.</p>","returns":"<p>parse string to number.</p>","example":"Enter a list of items:\n<input type=\"text\" name=\"value\" ng:format=\"list\" value=\" chair ,, table\"/>\n<input type=\"text\" name=\"value\" ng:format=\"list\"/>\n<pre>value={{value}}</pre>","scenario":"it('should format lists', function(){\n expect(binding('value')).toEqual('value=[\"chair\",\"table\"]');\n this.addFutureAction('change to XYZ', function($window, $document, done){\n $document.elements('.doc-example :input:last').val(',,a,b,').trigger('change');\n done();\n });\n expect(binding('value')).toEqual('value=[\"a\",\"b\"]');\n});"},{"raw":{"file":"src/formatters.js","line":124},"ngdoc":"formatter","name":"angular.formatter.trim","shortName":"trim","description":"<p>Use trim formatter if you wish to trim extra spaces in user text.</p>","returns":"<p>{String} Trim excess leading and trailing space.</p>","example":"Enter text with leading/trailing spaces:\n<input type=\"text\" name=\"value\" ng:format=\"trim\" value=\" book \"/>\n<input type=\"text\" name=\"value\" ng:format=\"trim\"/>\n<pre>value={{value|json}}</pre>","scenario":"it('should format trim', function(){\n expect(binding('value')).toEqual('value=\"book\"');\n this.addFutureAction('change to XYZ', function($window, $document, done){\n $document.elements('.doc-example :input:last').val(' text ').trigger('change');\n done();\n });\n expect(binding('value')).toEqual('value=\"text\"');\n});"}],"validator":[{"raw":{"file":"src/validators.js","line":4},"ngdoc":"validator","name":"angular.validator.regexp","shortName":"regexp","description":"<p>Use regexp validator to restrict the input to any Regular Expression.</p>","param":[{"type":"string","name":"value","description":"value to validate"},{"type":"regexp","name":"expression","description":"regular expression."}],"paramRest":[{"type":"regexp","name":"expression","description":"regular expression."}],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"css":"ng-validation-error","example":"Enter valid SSN:\n<input name=\"ssn\" value=\"123-45-6789\" ng:validate=\"regexp:/^\\d\\d\\d-\\d\\d-\\d\\d\\d\\d$/\" >","scenario":"it('should invalidate non ssn', function(){\n var textBox = element('.doc-example :input');\n expect(textBox.attr('className')).not().toMatch(/ng-validation-error/);\n expect(textBox.val()).toEqual('123-45-6789');\n \n input('ssn').enter('123-45-67890');\n expect(textBox.attr('className')).toMatch(/ng-validation-error/);\n});\n"},{"raw":{"file":"src/validators.js","line":38},"ngdoc":"validator","name":"angular.validator.number","shortName":"number","description":"<p>Use number validator to restrict the input to numbers with an \noptional range. (See integer for whole numbers validator).</p>","param":[{"type":"string","name":"value","description":"value to validate"},{"type":"int","name":"min","default":"MIN_INT","description":"minimum value."},{"type":"int","name":"max","default":"MAX_INT","description":"maximum value."}],"paramRest":[{"type":"int","name":"min","default":"MIN_INT","description":"minimum value."},{"type":"int","name":"max","default":"MAX_INT","description":"maximum value."}],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"css":"ng-validation-error","example":"Enter number: <input name=\"n1\" ng:validate=\"number\" > <br>\nEnter number greater than 10: <input name=\"n2\" ng:validate=\"number:10\" > <br>\nEnter number between 100 and 200: <input name=\"n3\" ng:validate=\"number:100:200\" > <br>","scenario":"it('should invalidate number', function(){\n var n1 = element('.doc-example :input[name=n1]');\n expect(n1.attr('className')).not().toMatch(/ng-validation-error/);\n input('n1').enter('1.x');\n expect(n1.attr('className')).toMatch(/ng-validation-error/);\n \n var n2 = element('.doc-example :input[name=n2]');\n expect(n2.attr('className')).not().toMatch(/ng-validation-error/);\n input('n2').enter('9');\n expect(n2.attr('className')).toMatch(/ng-validation-error/);\n \n var n3 = element('.doc-example :input[name=n3]');\n expect(n3.attr('className')).not().toMatch(/ng-validation-error/);\n input('n3').enter('201');\n expect(n3.attr('className')).toMatch(/ng-validation-error/);\n \n});\n"},{"raw":{"file":"src/validators.js","line":90},"ngdoc":"validator","name":"angular.validator.integer","shortName":"integer","description":"<p>Use number validator to restrict the input to integers with an \noptional range. (See integer for whole numbers validator).</p>","param":[{"type":"string","name":"value","description":"value to validate"},{"type":"int","name":"min","default":"MIN_INT","description":"minimum value."},{"type":"int","name":"max","default":"MAX_INT","description":"maximum value."}],"paramRest":[{"type":"int","name":"min","default":"MIN_INT","description":"minimum value."},{"type":"int","name":"max","default":"MAX_INT","description":"maximum value."}],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"css":"ng-validation-error","example":"Enter integer: <input name=\"n1\" ng:validate=\"integer\" > <br>\nEnter integer equal or greater than 10: <input name=\"n2\" ng:validate=\"integer:10\" > <br>\nEnter integer between 100 and 200 (inclusive): <input name=\"n3\" ng:validate=\"integer:100:200\" > <br>","scenario":"it('should invalidate integer', function(){\n var n1 = element('.doc-example :input[name=n1]');\n expect(n1.attr('className')).not().toMatch(/ng-validation-error/);\n input('n1').enter('1.1');\n expect(n1.attr('className')).toMatch(/ng-validation-error/);\n \n var n2 = element('.doc-example :input[name=n2]');\n expect(n2.attr('className')).not().toMatch(/ng-validation-error/);\n input('n2').enter('10.1');\n expect(n2.attr('className')).toMatch(/ng-validation-error/);\n \n var n3 = element('.doc-example :input[name=n3]');\n expect(n3.attr('className')).not().toMatch(/ng-validation-error/);\n input('n3').enter('100.1');\n expect(n3.attr('className')).toMatch(/ng-validation-error/);\n \n});"},{"raw":{"file":"src/validators.js","line":135},"ngdoc":"validator","name":"angular.validator.date","shortName":"date","description":"<p>Use date validator to restrict the user input to a valid date\nin format in format MM/DD/YYYY.</p>","param":[{"type":"string","name":"value","description":"value to validate"}],"paramRest":[],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"css":"ng-validation-error","example":"Enter valid date:\n<input name=\"text\" value=\"1/1/2009\" ng:validate=\"date\" >","scenario":"it('should invalidate date', function(){\n var n1 = element('.doc-example :input');\n expect(n1.attr('className')).not().toMatch(/ng-validation-error/);\n input('text').enter('123/123/123');\n expect(n1.attr('className')).toMatch(/ng-validation-error/);\n});\n"},{"raw":{"file":"src/validators.js","line":168},"ngdoc":"validator","name":"angular.validator.email","shortName":"email","description":"<p>Use email validator if you wist to restrict the user input to a valid email.</p>","param":[{"type":"string","name":"value","description":"value to validate"}],"paramRest":[],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"css":"ng-validation-error","example":"Enter valid email:\n<input name=\"text\" ng:validate=\"email\" value=\"[email protected]\">","scenario":"it('should invalidate email', function(){\n var n1 = element('.doc-example :input');\n expect(n1.attr('className')).not().toMatch(/ng-validation-error/);\n input('text').enter('[email protected]');\n expect(n1.attr('className')).toMatch(/ng-validation-error/);\n});\n"},{"raw":{"file":"src/validators.js","line":197},"ngdoc":"validator","name":"angular.validator.phone","shortName":"phone","description":"<p>Use phone validator to restrict the input phone numbers.</p>","param":[{"type":"string","name":"value","description":"value to validate"}],"paramRest":[],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"css":"ng-validation-error","example":"Enter valid phone number:\n<input name=\"text\" value=\"1(234)567-8901\" ng:validate=\"phone\" >","scenario":"it('should invalidate phone', function(){\n var n1 = element('.doc-example :input');\n expect(n1.attr('className')).not().toMatch(/ng-validation-error/);\n input('text').enter('+12345678');\n expect(n1.attr('className')).toMatch(/ng-validation-error/);\n});\n"},{"raw":{"file":"src/validators.js","line":229},"ngdoc":"validator","name":"angular.validator.url","shortName":"url","description":"<p>Use phone validator to restrict the input URLs.</p>","param":[{"type":"string","name":"value","description":"value to validate"}],"paramRest":[],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"css":"ng-validation-error","example":"Enter valid phone number:\n<input name=\"text\" value=\"http://example.com/abc.html\" size=\"40\" ng:validate=\"url\" >","scenario":"it('should invalidate url', function(){\n var n1 = element('.doc-example :input');\n expect(n1.attr('className')).not().toMatch(/ng-validation-error/);\n input('text').enter('abc://server/path');\n expect(n1.attr('className')).toMatch(/ng-validation-error/);\n});\n"},{"raw":{"file":"src/validators.js","line":258},"ngdoc":"validator","name":"angular.validator.json","shortName":"json","description":"<p>Use json validator if you wish to restrict the user input to a valid JSON.</p>","param":[{"type":"string","name":"value","description":"value to validate"}],"paramRest":[],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"css":"ng-validation-error","example":"<textarea name=\"json\" cols=\"60\" rows=\"5\" ng:validate=\"json\">\n{name:'abc'}\n</textarea>","scenario":"it('should invalidate json', function(){\n var n1 = element('.doc-example :input');\n expect(n1.attr('className')).not().toMatch(/ng-validation-error/);\n input('json').enter('{name}');\n expect(n1.attr('className')).toMatch(/ng-validation-error/);\n});\n"},{"raw":{"file":"src/validators.js","line":290},"ngdoc":"validator","name":"angular.validator.asynchronous","shortName":"asynchronous","description":"<p>Use asynchronous validator if the validation can not be computed \nimmediately, but is provided through a callback. The widget \nautomatically shows a spinning indicator while the validity of \nthe widget is computed. This validator caches the result.</p>","param":[{"type":"string","name":"value","description":"value to validate"},{"type":"function(inputToValidate,validationDone)","name":"validate","description":"function to call to validate the state\n of the input."},{"type":"function(data)","name":"update","default":"noop","description":"function to call when state of the \n validator changes"}],"paramRest":[{"type":"function(inputToValidate,validationDone)","name":"validate","description":"function to call to validate the state\n of the input."},{"type":"function(data)","name":"update","default":"noop","description":"function to call when state of the \n validator changes"}],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"paramDescription":"<p>The <code>validate</code> function (specified by you) is called as \n<code>validate(inputToValidate, validationDone)</code>:</p>\n\n<ul>\n<li><code>inputToValidate</code>: value of the input box.</li>\n<li><code>validationDone</code>: <code>function(error, data){...}</code>\n<ul><li><code>error</code>: error text to display if validation fails</li>\n<li><code>data</code>: data object to pass to update function</li></ul></li>\n</ul>\n\n<p>The <code>update</code> function is optionally specified by you and is\ncalled by <tt><angular/></tt> on input change. Since the \nasynchronous validator caches the results, the update \nfunction can be called without a call to <code>validate</code> \nfunction. The function is called as <code>update(data)</code>:</p>\n\n<ul>\n<li><code>data</code>: data object as passed from validate function</li>\n</ul>","css":"ng-input-indicator-wait, ng-validation-error","example":"<script>\n function myValidator(inputToValidate, validationDone) {\n setTimeout(function(){\n validationDone(inputToValidate.length % 2);\n }, 500);\n }\n</script>\n This input is validated asynchronously:\n <input name=\"text\" ng:validate=\"asynchronous:$window.myValidator\">","scenario":"it('should change color in delayed way', function(){\n var textBox = element('.doc-example :input');\n expect(textBox.attr('className')).not().toMatch(/ng-input-indicator-wait/);\n expect(textBox.attr('className')).not().toMatch(/ng-validation-error/);\n \n input('text').enter('X');\n expect(textBox.attr('className')).toMatch(/ng-input-indicator-wait/);\n \n pause(.6);\n \n expect(textBox.attr('className')).not().toMatch(/ng-input-indicator-wait/);\n expect(textBox.attr('className')).toMatch(/ng-validation-error/);\n \n});\n"}],"widget":[{"raw":{"file":"src/widgets.js","line":1},"ngdoc":"widget","name":"angular.widget.HTML","shortName":"HTML","description":"<p>The most common widgets you will use will be in the from of the\nstandard HTML set. These widgets are bound using the name attribute\nto an expression. In addition they can have <code>ng:validate</code>, <code>ng:required</code>,\n<code>ng:format</code>, <code>ng:change</code> attribute to further control their behavior.</p>","usageContent":"see example below for usage\n\n<input type=\"text|checkbox|...\" ... />\n<textarea ... />\n<select ...>\n <option>...</option>\n</select>","example":"<table style=\"font-size:.9em;\">\n <tr>\n <th>Name</th>\n <th>Format</th>\n <th>HTML</th>\n <th>UI</th>\n <th ng:non-bindable>{{input#}}</th>\n </tr>\n <tr>\n <th>text</th>\n <td>String</td>\n <td><tt>&lt;input type=\"text\" name=\"input1\"&gt;</tt></td>\n <td><input type=\"text\" name=\"input1\" size=\"4\"></td>\n <td><tt>{{input1|json}}</tt></td>\n </tr>\n <tr>\n <th>textarea</th>\n <td>String</td>\n <td><tt>&lt;textarea name=\"input2\"&gt;&lt;/textarea&gt;</tt></td>\n <td><textarea name=\"input2\" cols='6'></textarea></td>\n <td><tt>{{input2|json}}</tt></td>\n </tr>\n <tr>\n <th>radio</th>\n <td>String</td>\n <td><tt>\n &lt;input type=\"radio\" name=\"input3\" value=\"A\"&gt;<br>\n &lt;input type=\"radio\" name=\"input3\" value=\"B\"&gt;\n </tt></td>\n <td>\n <input type=\"radio\" name=\"input3\" value=\"A\">\n <input type=\"radio\" name=\"input3\" value=\"B\">\n </td>\n <td><tt>{{input3|json}}</tt></td>\n </tr>\n <tr>\n <th>checkbox</th>\n <td>Boolean</td>\n <td><tt>&lt;input type=\"checkbox\" name=\"input4\" value=\"checked\"&gt;</tt></td>\n <td><input type=\"checkbox\" name=\"input4\" value=\"checked\"></td>\n <td><tt>{{input4|json}}</tt></td>\n </tr>\n <tr>\n <th>pulldown</th>\n <td>String</td>\n <td><tt>\n &lt;select name=\"input5\"&gt;<br>\n &nbsp;&nbsp;&lt;option value=\"c\"&gt;C&lt;/option&gt;<br>\n &nbsp;&nbsp;&lt;option value=\"d\"&gt;D&lt;/option&gt;<br>\n &lt;/select&gt;<br>\n </tt></td>\n <td>\n <select name=\"input5\">\n <option value=\"c\">C</option>\n <option value=\"d\">D</option>\n </select>\n </td>\n <td><tt>{{input5|json}}</tt></td>\n </tr>\n <tr>\n <th>multiselect</th>\n <td>Array</td>\n <td><tt>\n &lt;select name=\"input6\" multiple size=\"4\"&gt;<br>\n &nbsp;&nbsp;&lt;option value=\"e\"&gt;E&lt;/option&gt;<br>\n &nbsp;&nbsp;&lt;option value=\"f\"&gt;F&lt;/option&gt;<br>\n &lt;/select&gt;<br>\n </tt></td>\n <td>\n <select name=\"input6\" multiple size=\"4\">\n <option value=\"e\">E</option>\n <option value=\"f\">F</option>\n </select>\n </td>\n <td><tt>{{input6|json}}</tt></td>\n </tr>\n</table>","scenario":"it('should exercise text', function(){\n input('input1').enter('Carlos');\n expect(binding('input1')).toEqual('\"Carlos\"');\n});\nit('should exercise textarea', function(){\n input('input2').enter('Carlos');\n expect(binding('input2')).toEqual('\"Carlos\"');\n});\nit('should exercise radio', function(){\n expect(binding('input3')).toEqual('null');\n input('input3').select('A');\n expect(binding('input3')).toEqual('\"A\"');\n input('input3').select('B');\n expect(binding('input3')).toEqual('\"B\"');\n});\nit('should exercise checkbox', function(){\n expect(binding('input4')).toEqual('false');\n input('input4').check();\n expect(binding('input4')).toEqual('true');\n});\nit('should exercise pulldown', function(){\n expect(binding('input5')).toEqual('\"c\"');\n select('input5').option('d');\n expect(binding('input5')).toEqual('\"d\"');\n});\nit('should exercise multiselect', function(){\n expect(binding('input6')).toEqual('[]');\n select('input6').options('e');\n expect(binding('input6')).toEqual('[\"e\"]');\n select('input6').options('e', 'f');\n expect(binding('input6')).toEqual('[\"e\",\"f\"]');\n});"},{"raw":{"file":"src/widgets.js","line":376},"ngdoc":"widget","name":"angular.widget.ng:include","shortName":"ng:include","description":"<p>Include external HTML fragment.</p>\n\n<p>Keep in mind that Same Origin Policy applies to included resources \n(e.g. ng:include won't work for file:// access).</p>","param":[{"type":"string","name":"src","description":"expression evaluating to URL."},{"type":"Scope","name":"scope","default":"new_child_scope","description":"expression evaluating to angular.scope"}],"paramRest":[{"type":"Scope","name":"scope","default":"new_child_scope","description":"expression evaluating to angular.scope"}],"paramFirst":{"type":"string","name":"src","description":"expression evaluating to URL."},"example":"<select name=\"url\">\n <option value=\"angular.filter.date.html\">date filter</option>\n <option value=\"angular.filter.html.html\">html filter</option>\n <option value=\"\">(blank)</option>\n</select>\n<tt>url = <a href=\"{{url}}\">{{url}}</a></tt>\n<hr/>\n<ng:include src=\"url\"></ng:include>","scenario":"it('should load date filter', function(){\n expect(element('.doc-example ng\\\\:include').text()).toMatch(/angular\\.filter\\.date/);\n});\nit('should change to hmtl filter', function(){\n select('url').option('angular.filter.html.html');\n expect(element('.doc-example ng\\\\:include').text()).toMatch(/angular\\.filter\\.html/);\n});\nit('should change to blank', function(){\n select('url').option('(blank)');\n expect(element('.doc-example ng\\\\:include').text()).toEqual('');\n});"},{"raw":{"file":"src/widgets.js","line":457},"ngdoc":"widget","name":"angular.widget.ng:switch","shortName":"ng:switch","description":"<p>Conditionally change the DOM structure.</p>","usageContent":"<any ng:switch-when=\"matchValue1\">...</any>\n <any ng:switch-when=\"matchValue2\">...</any>\n ...\n <any ng:switch-default>...</any>","param":[{"type":"*","name":"on","description":"expression to match against <tt>ng:switch-when</tt>."}],"paramRest":[],"paramFirst":{"type":"*","name":"on","description":"expression to match against <tt>ng:switch-when</tt>."},"paramDescription":"<p>On child elments add:</p>\n\n<ul>\n<li><code>ng:switch-when</code>: the case statement to match against. If match then this\ncase will be displayed.</li>\n<li><code>ng:switch-default</code>: the default case when no other casses match.</li>\n</ul>","example":"<select name=\"switch\">\n <option>settings</option>\n <option>home</option>\n <option>other</option>\n</select>\n<tt>switch={{switch}}</tt>\n</hr>\n<ng:switch on=\"switch\" >\n <div ng:switch-when=\"settings\">Settings Div</div>\n <span ng:switch-when=\"home\">Home Span</span>\n <span ng:switch-default>default</span>\n</ng:switch>\n</code>","scenario":"it('should start in settings', function(){\n expect(element('.doc-example ng\\\\:switch').text()).toEqual('Settings Div');\n});\nit('should change to home', function(){\n select('switch').option('home');\n expect(element('.doc-example ng\\\\:switch').text()).toEqual('Home Span');\n});\nit('should select deafault', function(){\n select('switch').option('other');\n expect(element('.doc-example ng\\\\:switch').text()).toEqual('default');\n});"}]},"all":[{"raw":{"file":"src/Angular.js","line":96},"ngdoc":"overview","name":"angular.widget","shortName":"widget","namespace":"Namespace for all widgets.","description":"<h2>Overview</h2>\n\n<p>Widgets allow you to create DOM elements that the browser doesn't \nalready understand. You create the widget in your namespace and \nassign it behavior. You can only bind one widget per DOM element \n(unlike directives, in which you can use any number per DOM \nelement). Widgets are expected to manipulate the DOM tree by \nadding new elements whereas directives are expected to only modify\nelement properties.</p>\n\n<p>Widgets come in two flavors: element and attribute.</p>\n\n<h2>Element Widget</h2>\n\n<p>Let's say we would like to create a new element type in the \nnamespace <code>my</code> that can watch an expression and alert() the user \nwith each new value.</p>\n\n<pre class=\"brush: xml; brush: js;\" ng:non-bindable>\n<my:watch exp=\"name\"/>\n</pre>\n\n<p>You can implement <code>my:watch</code> like this:</p>\n\n<pre class=\"brush: xml; brush: js;\" ng:non-bindable>\nangular.widget('my:watch', function(compileElement) {\n var compiler = this;\n var exp = compileElement.attr('exp');\n return function(linkElement) {\n var currentScope = this;\n currentScope.$watch(exp, function(value){\n alert(value);\n }};\n };\n});\n</pre>\n\n<h2>Attribute Widget</h2>\n\n<p>Let's implement the same widget, but this time as an attribute \nthat can be added to any existing DOM element.</p>\n\n<pre class=\"brush: xml; brush: js;\" ng:non-bindable>\n<div my-watch=\"name\">text</div>\n</pre>\n\n<p>You can implement <code>my:watch</code> attribute like this:</p>\n\n<pre class=\"brush: xml; brush: js;\" ng:non-bindable>\nangular.widget('@my:watch', function(expression, compileElement) {\n var compiler = this;\n return function(linkElement) {\n var currentScope = this;\n currentScope.$watch(expression, function(value){\n alert(value);\n });\n };\n});\n</pre>","example":"<script>\n angular.widget('my:time', function(compileElement){\n compileElement.css('display', 'block');\n return function(linkElement){\n function update(){\n linkElement.text('Current time is: ' + new Date());\n setTimeout(update, 1000);\n }\n update();\n };\n });\n</script>\n<my:time></my:time>"},{"raw":{"file":"src/Angular.js","line":171},"ngdoc":"overview","name":"angular.validator","shortName":"validator","namespace":"Namespace for all filters.","description":"<h2>Overview</h2>\n\n<p>Validators are a standard way to check the user input against a specific criteria. For \nexample, you might need to check that an input field contains a well-formed phone number.</p>\n\n<h2>Syntax</h2>\n\n<p>Attach a validator on user input widgets using the <code>ng:validate</code> attribute.</p>\n\n<p><doc:example>\n <doc:source>\n Change me: <input type=\"text\" name=\"number\" ng:validate=\"integer\" value=\"123\">\n </doc:source>\n <doc:scenario>\n it('should validate the default number string', function() {\n expect(element('input[name=number]').attr('class')).\n not().toMatch(/ng-validation-error/);\n });\n it('should not validate \"foo\"', function() {\n input('number').enter('foo');\n expect(element('input[name=number]').attr('class')).\n toMatch(/ng-validation-error/);\n });\n </doc:scenario>\n</doc:example></p>\n\n<h2>Writing your own Validators</h2>\n\n<p>Writing your own validator is easy. To make a function available as a \nvalidator, just define the JavaScript function on the <code>angular.validator</code> \nobject. <tt><angular/></tt> passes in the input to validate as the first argument \nto your function. Any additional validator arguments are passed in as \nadditional arguments to your function.</p>\n\n<p>You can use these variables in the function:</p>\n\n<ul>\n<li><code>this</code> \u2014 The current scope.</li>\n<li><code>this.$element</code> \u2014 The DOM element containing the binding. This allows the filter to manipulate\nthe DOM in addition to transforming the input.</li>\n</ul>\n\n<p>In this example we have written a upsTrackingNo validator. \nIt marks the input text \"valid\" only when the user enters a well-formed \nUPS tracking number.</p>","css":"ng-validation-error\n When validation fails, this css class is applied to the binding, making its borders red by\n default.","example":"<script>\n angular.validator('upsTrackingNo', function(input, format) {\n var regexp = new RegExp(\"^\" + format.replace(/9/g, '\\\\d') + \"$\");\n return input.match(regexp)?\"\":\"The format must match \" + format;\n });\n</script>\n<input type=\"text\" name=\"trackNo\" size=\"40\"\n ng:validate=\"upsTrackingNo:'1Z 999 999 99 9999 999 9'\" \n value=\"1Z 123 456 78 9012 345 6\"/>","scenario":"it('should validate correct UPS tracking number', function() {\n expect(element('input[name=trackNo]').attr('class')).\n not().toMatch(/ng-validation-error/);\n});\n\nit('should not validate in correct UPS tracking number', function() {\n input('trackNo').enter('foo');\n expect(element('input[name=trackNo]').attr('class')).\n toMatch(/ng-validation-error/);\n});\n"},{"raw":{"file":"src/Angular.js","line":249},"ngdoc":"overview","name":"angular.filter","shortName":"filter","namespace":"Namespace for all filters.","description":"<h2>Overview</h2>\n\n<p>Filters are a standard way to format your data for display to the user. For example, you\nmight have the number 1234.5678 and would like to display it as US currency: $1,234.57.\nFilters allow you to do just that. In addition to transforming the data, filters also modify\nthe DOM. This allows the filters to for example apply css styles to the filtered output if\ncertain conditions were met.</p>\n\n<h2>Standard Filters</h2>\n\n<p>The Angular framework provides a standard set of filters for common operations, including:\n{@link angular.filter.currency}, {@link angular.filter.json}, {@link angular.filter.number},\nand {@link angular.filter.html}. You can also add your own filters.</p>\n\n<h2>Syntax</h2>\n\n<p>Filters can be part of any {@link angular.scope} evaluation but are typically used with\n{{bindings}}. Filters typically transform the data to a new data type, formating the data in\nthe process. Filters can be chained and take optional arguments. Here are few examples:</p>\n\n<ul>\n<li>No filter: {{1234.5678}} => 1234.5678</li>\n<li>Number filter: {{1234.5678|number}} => 1,234.57. Notice the \u201c,\u201d and rounding to two\nsignificant digits.</li>\n<li>Filter with arguments: {{1234.5678|number:5}} => 1,234.56780. Filters can take optional\narguments, separated by colons in a binding. To number, the argument \u201c5\u201d requests 5 digits\nto the right of the decimal point.</li>\n</ul>\n\n<h2>Writing your own Filters</h2>\n\n<p>Writing your own filter is very easy: just define a JavaScript function on <code>angular.filter</code>.\nThe framework passes in the input value as the first argument to your function. Any filter\narguments are passed in as additional function arguments.</p>\n\n<p>You can use these variables in the function:</p>\n\n<ul>\n<li><code>this</code> \u2014 The current scope.</li>\n<li><code>this.$element</code> \u2014 The DOM element containing the binding. This allows the filter to manipulate\nthe DOM in addition to transforming the input.</li>\n</ul>","exampleDescription":"<p>The following example filter reverses a text string. In addition, it conditionally makes the\ntext upper-case (to demonstrate optional arguments) and assigns color (to demonstrate DOM\nmodification).</p>","example":" <script type=\"text/javascript\">\n angular.filter('reverse', function(input, uppercase, color) {\n var out = \"\";\n for (var i = 0; i < input.length; i++) {\n out = input.charAt(i) + out;\n }\n if (uppercase) {\n out = out.toUpperCase();\n }\n if (color) {\n this.$element.css('color', color);\n }\n return out;\n });\n </script>\n\n <input name=\"text\" type=\"text\" value=\"hello\" /><br>\n No filter: {{text}}<br>\n Reverse: {{text|reverse}}<br>\n Reverse + uppercase: {{text|reverse:true}}<br>\n Reverse + uppercase + blue: {{text|reverse:true:\"blue\"}}\n"},{"raw":{"file":"src/Angular.js","line":326},"ngdoc":"overview","name":"angular.formatter","shortName":"formatter","namespace":"Namespace for all formats.","description":"<h2>Overview</h2>\n\n<p>The formatters are responsible for translating user readable text in an input widget to a\ndata model stored in an application.</p>\n\n<h2>Writting your own Fromatter</h2>\n\n<p>Writing your own formatter is easy. Just register a pair of JavaScript functions with \n<code>angular.formatter</code>. One function for parsing user input text to the stored form, \nand one for formatting the stored data to user-visible text.</p>\n\n<p>Here is an example of a \"reverse\" formatter: The data is stored in uppercase and in \nreverse, while it is displayed in lower case and non-reversed. User edits are \nautomatically parsed into the internal form and data changes are automatically \nformatted to the viewed form.</p>\n\n<pre class=\"brush: xml; brush: js;\" ng:non-bindable>\nfunction reverse(text) {\n var reversed = [];\n for (var i = 0; i < text.length; i++) {\n reversed.unshift(text.charAt(i));\n }\n return reversed.join('');\n}\n\nangular.formatter('reverse', {\n parse: function(value){\n return reverse(value||'').toUpperCase();\n },\n format: function(value){\n return reverse(value||'').toLowerCase();\n }\n});\n</pre>","example":"<script type=\"text/javascript\">\nfunction reverse(text) {\n var reversed = [];\n for (var i = 0; i < text.length; i++) {\n reversed.unshift(text.charAt(i));\n }\n return reversed.join('');\n}\n\nangular.formatter('reverse', {\n parse: function(value){\n return reverse(value||'').toUpperCase();\n },\n format: function(value){\n return reverse(value||'').toLowerCase();\n }\n});\n</script>\n\nFormatted: \n<input type=\"text\" name=\"data\" value=\"angular\" ng:format=\"reverse\"/>\n<br/>\n\nStored: \n<input type=\"text\" name=\"data\"/><br/>\n<pre>{{data}}</pre>","scenario":"it('should store reverse', function(){\n expect(element('.doc-example input:first').val()).toEqual('angular');\n expect(element('.doc-example input:last').val()).toEqual('RALUGNA');\n \n this.addFutureAction('change to XYZ', function($window, $document, done){\n $document.elements('.doc-example input:last').val('XYZ').trigger('change');\n done();\n });\n expect(element('input:first').val()).toEqual('zyx');\n});"},{"raw":{"file":"src/directives.js","line":1},"ngdoc":"directive","name":"angular.directive.ng:init","shortName":"ng:init","description":"<p><code>ng:init</code> attribute allows the for initialization tasks to be executed \n before the template enters execution mode during bootstrap.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval."},"example":"<div ng:init=\"greeting='Hello'; person='World'\">\n {{greeting}} {{person}}!\n</div>","scenario":" it('should check greeting', function(){\n expect(binding('greeting')).toBe('Hello');\n expect(binding('person')).toBe('World');\n });"},{"raw":{"file":"src/directives.js","line":29},"ngdoc":"directive","name":"angular.directive.ng:controller","shortName":"ng:controller","description":"<p>To support the Model-View-Controller design pattern, it is possible \nto assign behavior to a scope through <code>ng:controller</code>. The scope is \nthe MVC model. The HTML (with data bindings) is the MVC view. \nThe <code>ng:controller</code> directive specifies the MVC controller class</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval."},"example":"<script type=\"text/javascript\">\n function SettingsController() {\n this.name = \"John Smith\";\n this.contacts = [\n {type:'phone', value:'408 555 1212'},\n {type:'email', value:'[email protected]'} ];\n }\n SettingsController.prototype = {\n greet: function(){\n alert(this.name);\n },\n addContact: function(){\n this.contacts.push({type:'email', value:'[email protected]'});\n },\n removeContact: function(contactToRemove) {\n angular.Array.remove(this.contacts, contactToRemove);\n },\n clearContact: function(contact) {\n contact.type = 'phone';\n contact.value = '';\n }\n };\n</script>\n<div ng:controller=\"SettingsController\">\n Name: <input type=\"text\" name=\"name\"/> \n [ <a href=\"\" ng:click=\"greet()\">greet</a> ]<br/>\n Contact:\n <ul>\n <li ng:repeat=\"contact in contacts\">\n <select name=\"contact.type\">\n <option>phone</option>\n <option>email</option>\n </select>\n <input type=\"text\" name=\"contact.value\"/>\n [ <a href=\"\" ng:click=\"clearContact(contact)\">clear</a> \n | <a href=\"\" ng:click=\"removeContact(contact)\">X</a> ]\n </li>\n <li>[ <a href=\"\" ng:click=\"addContact()\">add</a> ]</li>\n </ul>\n</div>","scenario":" it('should check controller', function(){\n expect(element('.doc-example-live div>:input').val()).toBe('John Smith');\n expect(element('.doc-example-live li[ng\\\\:repeat-index=\"0\"] input').val()).toBe('408 555 1212');\n expect(element('.doc-example-live li[ng\\\\:repeat-index=\"1\"] input').val()).toBe('[email protected]');\n element('.doc-example-live li:first a:contains(\"clear\")').click();\n expect(element('.doc-example-live li:first input').val()).toBe('');\n element('.doc-example-live li:last a:contains(\"add\")').click();\n expect(element('.doc-example-live li[ng\\\\:repeat-index=\"2\"] input').val()).toBe('[email protected]');\n });"},{"raw":{"file":"src/directives.js","line":107},"ngdoc":"directive","name":"angular.directive.ng:eval","shortName":"ng:eval","description":"<p>The <code>ng:eval</code> allows you to execute a binding which has side effects \nwithout displaying the result to the user.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval."},"exampleDescription":"<p>Notice that <code>{{</code> <code>obj.multiplied = obj.a * obj.b</code> <code>}}</code> has a side effect of assigning \na value to <code>obj.multiplied</code> and displaying the result to the user. Sometimes, \nhowever, it is desirable to execute a side effect without showing the value to \nthe user. In such a case <code>ng:eval</code> allows you to execute code without updating \nthe display.</p>","example":"<input name=\"obj.a\" value=\"6\" > \n * <input name=\"obj.b\" value=\"2\"> \n = {{obj.multiplied = obj.a * obj.b}} <br>\n<span ng:eval=\"obj.divide = obj.a / obj.b\"></span>\n<span ng:eval=\"obj.updateCount = 1 + (obj.updateCount||0)\"></span>\n<tt>obj.divide = {{obj.divide}}</tt><br/>\n<tt>obj.updateCount = {{obj.updateCount}}</tt>","scenario":" it('should check eval', function(){\n expect(binding('obj.divide')).toBe('3');\n expect(binding('obj.updateCount')).toBe('2');\n input('obj.a').enter('12');\n expect(binding('obj.divide')).toBe('6');\n expect(binding('obj.updateCount')).toBe('3');\n });"},{"raw":{"file":"src/directives.js","line":149},"ngdoc":"directive","name":"angular.directive.ng:bind","shortName":"ng:bind","description":"<p>The <code>ng:bind</code> attribute asks <tt><angular/></tt> to replace the text content of this \nHTML element with the value of the given expression and kept it up to \ndate when the expression's value changes. Usually you just write \n{{expression}} and let <tt><angular/></tt> compile it into \n<span ng:bind=\"expression\"></span> at bootstrap time.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval."},"exampleDescription":"<p>Try it here: enter text in text box and watch the greeting change.</p>","example":"Enter name: <input type=\"text\" name=\"name\" value=\"Whirled\">. <br>\nHello <span ng:bind=\"name\" />!","scenario":" it('should check ng:bind', function(){\n expect(using('.doc-example-live').binding('name')).toBe('Whirled');\n using('.doc-example-live').input('name').enter('world');\n expect(using('.doc-example-live').binding('name')).toBe('world');\n });"},{"raw":{"file":"src/directives.js","line":252},"ngdoc":"directive","name":"angular.directive.ng:bind-template","shortName":"ng:bind-template","description":"<p>The <code>ng:bind-template</code> attribute specifies that the element \ntext should be replaced with the template in ng:bind-template. \nUnlike ng:bind the ng:bind-template can contain multiple <code>{{</code> <code>}}</code> \nexpressions. (This is required since some HTML elements \ncan not have SPAN elements such as TITLE, or OPTION to name a few.</p>","element":"ANY","param":[{"type":"string","name":"template","description":"of form\n <tt>{{</tt> <tt>expression</tt> <tt>}}</tt> to eval."}],"paramRest":[],"paramFirst":{"type":"string","name":"template","description":"of form\n <tt>{{</tt> <tt>expression</tt> <tt>}}</tt> to eval."},"exampleDescription":"<p>Try it here: enter text in text box and watch the greeting change.</p>","example":"Salutation: <input type=\"text\" name=\"salutation\" value=\"Hello\"><br/>\nName: <input type=\"text\" name=\"name\" value=\"World\"><br/>\n<pre ng:bind-template=\"{{salutation}} {{name}}!\"></pre>","scenario":" it('should check ng:bind', function(){\n expect(using('.doc-example-live').binding('{{salutation}} {{name}}')).\n toBe('Hello World!');\n using('.doc-example-live').input('salutation').enter('Greetings');\n using('.doc-example-live').input('name').enter('user');\n expect(using('.doc-example-live').binding('{{salutation}} {{name}}')).\n toBe('Greetings user!');\n });"},{"raw":{"file":"src/directives.js","line":304},"ngdoc":"directive","name":"angular.directive.ng:bind-attr","shortName":"ng:bind-attr","description":"<p>The <code>ng:bind-attr</code> attribute specifies that the element attributes \nwhich should be replaced by the expression in it. Unlike <code>ng:bind</code> \nthe <code>ng:bind-attr</code> contains a JSON key value pairs representing \nwhich attributes need to be changed. You don\u2019t usually write the \n<code>ng:bind-attr</code> in the HTML since embedding \n<tt ng:non-bindable>{{expression}}</tt> into the \nattribute directly is the preferred way. The attributes get\ntranslated into <span ng:bind-attr=\"{attr:expression}\"/> at\nbootstrap time.</p>\n\n<p>This HTML snippet is preferred way of working with <code>ng:bind-attr</code></p>\n\n<pre class=\"brush: xml; brush: js;\" ng:non-bindable>\n <a href=\"http://www.google.com/search?q={{query}}\">Google</a>\n</pre>\n\n<p>The above gets translated to bellow during bootstrap time.</p>\n\n<pre class=\"brush: xml; brush: js;\" ng:non-bindable>\n <a ng:bind-attr='{\"href\":\"http://www.google.com/search?q={{query}}\"}'>Google</a>\n</pre>","element":"ANY","param":[{"type":"string","name":"attribute_json","description":"a JSON key-value pairs representing \n the attributes to replace. Each key matches the attribute \n which needs to be replaced. Each value is a text template of \n the attribute with embedded \n <tt ng:non-bindable>{{expression}}</tt>s. Any number of \n key-value pairs can be specified."}],"paramRest":[],"paramFirst":{"type":"string","name":"attribute_json","description":"a JSON key-value pairs representing \n the attributes to replace. Each key matches the attribute \n which needs to be replaced. Each value is a text template of \n the attribute with embedded \n <tt ng:non-bindable>{{expression}}</tt>s. Any number of \n key-value pairs can be specified."},"exampleDescription":"<p>Try it here: enter text in text box and click Google.</p>","example":"Google for: \n<input type=\"text\" name=\"query\" value=\"AngularJS\"/> \n<a href=\"http://www.google.com/search?q={{query}}\">Google</a>","scenario":" it('should check ng:bind-attr', function(){\n expect(using('.doc-example-live').element('a').attr('href')).\n toBe('http://www.google.com/search?q=AngularJS');\n using('.doc-example-live').input('query').enter('google');\n expect(using('.doc-example-live').element('a').attr('href')).\n toBe('http://www.google.com/search?q=google');\n });"},{"raw":{"file":"src/directives.js","line":381},"ngdoc":"directive","name":"angular.directive.ng:non-bindable","shortName":"ng:non-bindable","description":"<p>Sometimes it is necessary to write code which looks like \nbindings but which should be left alone by <tt><angular/></tt>. \nUse <code>ng:non-bindable</code> to ignore a chunk of HTML.</p>","element":"ANY","param":[{"type":"string","name":"ignore","description":""}],"paramRest":[],"paramFirst":{"type":"string","name":"ignore","description":""},"exampleDescription":"<p>In this example there are two location where \n<tt ng:non-bindable>{{1 + 2}}</tt> is present, but the one \nwrapped in <code>ng:non-bindable</code> is left alone</p>","example":"<div>Normal: {{1 + 2}}</div>\n<div ng:non-bindable>Ignored: {{1 + 2}}</div>","scenario":" it('should check ng:non-bindable', function(){\n expect(using('.doc-example-live').binding('1 + 2')).toBe('3');\n expect(using('.doc-example-live').element('div:last').text()).\n toMatch(/1 \\+ 2/);\n });"},{"raw":{"file":"src/directives.js","line":410},"ngdoc":"directive","name":"angular.directive.ng:repeat","shortName":"ng:repeat","description":"<p><code>ng:repeat</code> instantiates a template once per item from a \ncollection. The collection is enumerated with \n<code>ng:repeat-index</code> attribute starting from 0. Each template \ninstance gets its own scope where the given loop variable \nis set to the current collection item and <code>$index</code> is set \nto the item index or key.</p>\n\n<p>NOTE: <code>ng:repeat</code> looks like a directive, but is actually a \nattribute widget.</p>","element":"ANY","param":[{"type":"repeat","name":"repeat_expression","description":"to itterate over.</p>\n\n<ul>\n<li><code>variable in expression</code>, where variable is the user \ndefined loop variable and expression is a scope expression \ngiving the collection to enumerate. For example: \n<code>track in cd.tracks</code>.</li>\n<li><code>(key, value) in expression</code>, where key and value can \nbe any user defined identifiers, and expression is the \nscope expression giving the collection to enumerate. \nFor example: <code>(name, age) in {'adam':10, 'amalie':12}</code>.</li>\n</ul>\n\n<p>Special properties set on the local scope:\n * {number} $index - iterator offset of the repeated element (0..length-1)\n * {string} $position - position of the repeated element in the iterator ('first', 'middle', 'last')"}],"paramRest":[],"paramFirst":{"type":"repeat","name":"repeat_expression","description":"to itterate over.</p>\n\n<ul>\n<li><code>variable in expression</code>, where variable is the user \ndefined loop variable and expression is a scope expression \ngiving the collection to enumerate. For example: \n<code>track in cd.tracks</code>.</li>\n<li><code>(key, value) in expression</code>, where key and value can \nbe any user defined identifiers, and expression is the \nscope expression giving the collection to enumerate. \nFor example: <code>(name, age) in {'adam':10, 'amalie':12}</code>.</li>\n</ul>\n\n<p>Special properties set on the local scope:\n * {number} $index - iterator offset of the repeated element (0..length-1)\n * {string} $position - position of the repeated element in the iterator ('first', 'middle', 'last')"},"exampleDescription":"<p>This example initializes the scope to a list of names and \nthan uses <code>ng:repeat</code> to display every person.</p>","example":"<div ng:init=\"friends = [{name:'John', age:25}, {name:'Mary', age:28}]\">\n I have {{friends.length}} friends. They are:\n <ul>\n <li ng:repeat=\"friend in friends\"> \n [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.\n </li>\n </ul>\n</div>","scenario":" it('should check ng:repeat', function(){\n var r = using('.doc-example-live').repeater('ul li'); \n expect(r.count()).toBe(2);\n expect(r.row(0)).toEqual([\"1\",\"John\",\"25\"]);\n expect(r.row(1)).toEqual([\"2\",\"Mary\",\"28\"]);\n });"},{"raw":{"file":"src/directives.js","line":536},"ngdoc":"directive","name":"angular.directive.ng:click","shortName":"ng:click","description":"<p>The ng:click allows you to specify custom behavior when \nelement is clicked.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval upon click."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval upon click."},"example":"<button ng:click=\"count = count + 1\" ng:init=\"count=0\">\n Increment\n</button>\ncount: {{count}}","scenario":" it('should check ng:click', function(){\n expect(binding('count')).toBe('0');\n element('.doc-example-live :button').click();\n expect(binding('count')).toBe('1');\n });"},{"raw":{"file":"src/directives.js","line":579},"ngdoc":"directive","name":"angular.directive.ng:submit","shortName":"ng:submit","description":"","element":"form","param":[{"type":"expression","name":"expression","description":"to eval."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval."},"exampleDescription":"","example":"<form ng:submit=\"list.push(text);text='';\" ng:init=\"list=[]\">\n Enter text and hit enter: \n <input type=\"text\" name=\"text\" value=\"hello\"/>\n</form>\n<pre>list={{list}}</pre>","scenario":" it('should check ng:submit', function(){\n expect(binding('list')).toBe('list=[]');\n element('.doc-example-live form input').click();\n this.addFutureAction('submit from', function($window, $document, done) {\n $window.angular.element(\n $document.elements('.doc-example-live form')).\n trigger('submit');\n done();\n });\n expect(binding('list')).toBe('list=[\"hello\"]');\n });"},{"raw":{"file":"src/directives.js","line":626},"ngdoc":"directive","name":"angular.directive.ng:watch","shortName":"ng:watch","description":"<p>The <code>ng:watch</code> allows you watch a variable and then execute \nan evaluation on variable change.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval."},"exampleDescription":"<p>Notice that the counter is incremented \nevery time you change the text.</p>","example":"<div ng:init=\"counter=0\" ng:watch=\"name: counter = counter+1\">\n <input type=\"text\" name=\"name\" value=\"hello\"><br/>\n Change counter: {{counter}} Name: {{name}}\n</div>","scenario":" it('should check ng:watch', function(){\n expect(using('.doc-example-live').binding('counter')).toBe('2');\n using('.doc-example-live').input('name').enter('abc');\n expect(using('.doc-example-live').binding('counter')).toBe('3');\n });"},{"raw":{"file":"src/directives.js","line":680},"ngdoc":"directive","name":"angular.directive.ng:class","shortName":"ng:class","description":"<p>The <code>ng:class</code> allows you to set CSS class on HTML element \nconditionally.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval."},"exampleDescription":"","example":"<input type=\"button\" value=\"set\" ng:click=\"myVar='ng-input-indicator-wait'\">\n<input type=\"button\" value=\"clear\" ng:click=\"myVar=''\">\n<br>\n<span ng:class=\"myVar\">Sample Text &nbsp;&nbsp;&nbsp;&nbsp;</span>","scenario":" it('should check ng:class', function(){\n expect(element('.doc-example-live span').attr('className')).not().\n toMatch(/ng-input-indicator-wait/);\n\n using('.doc-example-live').element(':button:first').click();\n\n expect(element('.doc-example-live span').attr('className')).\n toMatch(/ng-input-indicator-wait/);\n\n using('.doc-example-live').element(':button:last').click();\n \n expect(element('.doc-example-live span').attr('className')).not().\n toMatch(/ng-input-indicator-wait/);\n });"},{"raw":{"file":"src/directives.js","line":716},"ngdoc":"directive","name":"angular.directive.ng:class-odd","shortName":"ng:class-odd","description":"<p>The <code>ng:class-odd</code> and <code>ng:class-even</code> works exactly as \n<code>ng:class</code>, except it works in conjunction with <code>ng:repeat</code> \nand takes affect only on odd (even) rows.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval. Must be inside \n<code>ng:repeat</code>."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval. Must be inside \n<code>ng:repeat</code>."},"exampleDescription":"","example":"<ol ng:init=\"names=['John', 'Mary', 'Cate', 'Suz']\">\n <li ng:repeat=\"name in names\">\n <span ng:class-odd=\"'ng-format-negative'\"\n ng:class-even=\"'ng-input-indicator-wait'\">\n {{name}} &nbsp; &nbsp; &nbsp; \n </span>\n </li>\n</ol>","scenario":" it('should check ng:class-odd and ng:class-even', function(){\n expect(element('.doc-example-live li:first span').attr('className')).\n toMatch(/ng-format-negative/);\n expect(element('.doc-example-live li:last span').attr('className')).\n toMatch(/ng-input-indicator-wait/);\n });"},{"raw":{"file":"src/directives.js","line":751},"ngdoc":"directive","name":"angular.directive.ng:class-even","shortName":"ng:class-even","description":"<p>The <code>ng:class-odd</code> and <code>ng:class-even</code> works exactly as \n<code>ng:class</code>, except it works in conjunction with <code>ng:repeat</code> \nand takes affect only on odd (even) rows.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval. Must be inside \n<code>ng:repeat</code>."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval. Must be inside \n<code>ng:repeat</code>."},"exampleDescription":"","example":"<ol ng:init=\"names=['John', 'Mary', 'Cate', 'Suz']\">\n <li ng:repeat=\"name in names\">\n <span ng:class-odd=\"'ng-format-negative'\"\n ng:class-even=\"'ng-input-indicator-wait'\">\n {{name}} &nbsp; &nbsp; &nbsp; \n </span>\n </li>\n</ol>","scenario":" it('should check ng:class-odd and ng:class-even', function(){\n expect(element('.doc-example-live li:first span').attr('className')).\n toMatch(/ng-format-negative/);\n expect(element('.doc-example-live li:last span').attr('className')).\n toMatch(/ng-input-indicator-wait/);\n });"},{"raw":{"file":"src/directives.js","line":786},"ngdoc":"directive","name":"angular.directive.ng:show","shortName":"ng:show","description":"<p>The <code>ng:show</code> and <code>ng:hide</code> allows you to show or hide a portion\nof the HTML conditionally.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"if truthy then the element is \nshown or hidden respectively."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"if truthy then the element is \nshown or hidden respectively."},"exampleDescription":"","example":"Click me: <input type=\"checkbox\" name=\"checked\"><br/>\nShow: <span ng:show=\"checked\">I show up when you checkbox is checked?</span> <br/>\nHide: <span ng:hide=\"checked\">I hide when you checkbox is checked?</span>","scenario":" it('should check ng:show / ng:hide', function(){\n expect(element('.doc-example-live span:first:hidden').count()).toEqual(1);\n expect(element('.doc-example-live span:last:visible').count()).toEqual(1);\n \n input('checked').check();\n \n expect(element('.doc-example-live span:first:visible').count()).toEqual(1);\n expect(element('.doc-example-live span:last:hidden').count()).toEqual(1);\n });"},{"raw":{"file":"src/directives.js","line":823},"ngdoc":"directive","name":"angular.directive.ng:hide","shortName":"ng:hide","description":"<p>The <code>ng:show</code> and <code>ng:hide</code> allows you to show or hide a portion\nof the HTML conditionally.</p>","element":"ANY","param":[{"type":"expression","name":"expression","description":"if truthy then the element is \nshown or hidden respectively."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"if truthy then the element is \nshown or hidden respectively."},"exampleDescription":"","example":"Click me: <input type=\"checkbox\" name=\"checked\"><br/>\nShow: <span ng:show=\"checked\">I show up when you checkbox is checked?</span> <br/>\nHide: <span ng:hide=\"checked\">I hide when you checkbox is checked?</span>","scenario":" it('should check ng:show / ng:hide', function(){\n expect(element('.doc-example-live span:first:hidden').count()).toEqual(1);\n expect(element('.doc-example-live span:last:visible').count()).toEqual(1);\n \n input('checked').check();\n \n expect(element('.doc-example-live span:first:visible').count()).toEqual(1);\n expect(element('.doc-example-live span:last:hidden').count()).toEqual(1);\n });"},{"raw":{"file":"src/directives.js","line":860},"ngdoc":"directive","name":"angular.directive.ng:style","shortName":"ng:style","description":"","element":"ANY","param":[{"type":"expression","name":"expression","description":"to eval."}],"paramRest":[],"paramFirst":{"type":"expression","name":"expression","description":"to eval."},"exampleDescription":"","example":"","scenario":" it('should check ng:style', function(){\n });"},{"raw":{"file":"src/filters.js","line":1},"ngdoc":"filter","name":"angular.filter.currency","shortName":"currency","function":"","description":"<p>Formats a number as a currency (ie $1,234.56).</p>","param":[{"type":"number","name":"amount","description":"Input to filter."}],"paramRest":[],"paramFirst":{"type":"number","name":"amount","description":"Input to filter."},"returns":"<p>{string} Formated number.</p>","css":"ng-format-negative\n When the value is negative, this css class is applied to the binding making it by default red.","example":"<input type=\"text\" name=\"amount\" value=\"1234.56\"/> <br/>\n{{amount | currency}}","scenario":" it('should init with 1234.56', function(){\n expect(binding('amount | currency')).toBe('$1,234.56');\n });\n it('should update', function(){\n input('amount').enter('-1234');\n expect(binding('amount | currency')).toBe('$-1,234.00');\n expect(element('.doc-example-live .ng-binding').attr('className')).\n toMatch(/ng-format-negative/);\n });"},{"raw":{"file":"src/filters.js","line":35},"ngdoc":"filter","name":"angular.filter.number","shortName":"number","function":"","description":"<p>Formats a number as text.</p>\n\n<p>If the input is not a number empty string is returned.</p>","param":[{"type":"(number|string)","name":"number","description":"Number to format."},{"type":"(number|string)","name":"fractionSize","default":"2","description":"Number of decimal places to round the number to. Default 2."}],"paramRest":[{"type":"(number|string)","name":"fractionSize","default":"2","description":"Number of decimal places to round the number to. Default 2."}],"paramFirst":{"type":"(number|string)","name":"number","description":"Number to format."},"returns":"<p>{string} Number rounded to decimalPlaces and places a \u201c,\u201d after each third digit.</p>","example":"Enter number: <input name='val' value='1234.56789' /><br/>\nDefault formatting: {{val | number}}<br/>\nNo fractions: {{val | number:0}}<br/>\nNegative number: {{-val | number:4}}","scenario":" it('should format numbers', function(){\n expect(binding('val | number')).toBe('1,234.57');\n expect(binding('val | number:0')).toBe('1,235');\n expect(binding('-val | number:4')).toBe('-1,234.5679');\n });\n\n it('should update', function(){\n input('val').enter('3374.333');\n expect(binding('val | number')).toBe('3,374.33');\n expect(binding('val | number:0')).toBe('3,374');\n expect(binding('-val | number:4')).toBe('-3,374.3330');\n });"},{"raw":{"file":"src/filters.js","line":150},"ngdoc":"filter","name":"angular.filter.date","shortName":"date","function":"","description":"<p>Formats <code>date</code> to a string based on the requested <code>format</code>.</p>\n\n<p><code>format</code> string can be composed of the following elements:</p>\n\n<ul>\n<li><code>'yyyy'</code>: 4 digit representation of year e.g. 2010</li>\n<li><code>'yy'</code>: 2 digit representation of year, padded (00-99)</li>\n<li><code>'MM'</code>: Month in year, padded (01\u201212)</li>\n<li><code>'M'</code>: Month in year (1\u201212)</li>\n<li><code>'dd'</code>: Day in month, padded (01\u201231)</li>\n<li><code>'d'</code>: Day in month (1-31)</li>\n<li><code>'HH'</code>: Hour in day, padded (00\u201223)</li>\n<li><code>'H'</code>: Hour in day (0-23)</li>\n<li><code>'hh'</code>: Hour in am/pm, padded (01\u201212)</li>\n<li><code>'h'</code>: Hour in am/pm, (1-12)</li>\n<li><code>'mm'</code>: Minute in hour, padded (00\u201259)</li>\n<li><code>'m'</code>: Minute in hour (0-59)</li>\n<li><code>'ss'</code>: Second in minute, padded (00\u201259)</li>\n<li><code>'s'</code>: Second in minute (0\u201259)</li>\n<li><code>'a'</code>: am/pm marker</li>\n<li><code>'Z'</code>: 4 digit (+sign) representation of the timezone offset (-1200\u20121200)</li>\n</ul>","param":[{"type":"(Date|number|string)","name":"date","description":"Date to format either as Date object, milliseconds (string or\n number) or ISO 8601 extended datetime string (yyyy-MM-ddTHH:mm:ss.SSSZ)."},{"type":"string","name":"format","description":"Formatting rules. If not specified, Date#toLocaleDateString is used."}],"paramRest":[{"type":"string","name":"format","description":"Formatting rules. If not specified, Date#toLocaleDateString is used."}],"paramFirst":{"type":"(Date|number|string)","name":"date","description":"Date to format either as Date object, milliseconds (string or\n number) or ISO 8601 extended datetime string (yyyy-MM-ddTHH:mm:ss.SSSZ)."},"returns":"<p>{string} Formatted string or the input if input is not recognized as date/millis.</p>","example":"<span ng:non-bindable>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span>:\n {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}<br/>\n<span ng:non-bindable>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span>:\n {{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}<br/>","scenario":" it('should format date', function(){\n expect(binding(\"1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'\")).\n toMatch(/2010\\-10\\-2\\d \\d{2}:\\d{2}:\\d{2} \\-?\\d{4}/);\n expect(binding(\"'1288323623006' | date:'MM/dd/yyyy @ h:mma'\")).\n toMatch(/10\\/2\\d\\/2010 @ \\d{1,2}:\\d{2}(am|pm)/);\n });\n"},{"raw":{"file":"src/filters.js","line":231},"ngdoc":"filter","name":"angular.filter.json","shortName":"json","function":"","description":"<p>Allows you to convert a JavaScript object into JSON string.</p>\n\n<p>This filter is mostly useful for debugging. When using the double curly {{value}} notation\nthe binding is automatically converted to JSON.</p>","param":[{"type":"*","name":"object","description":"Any JavaScript object (including arrays and primitive types) to filter."}],"paramRest":[],"paramFirst":{"type":"*","name":"object","description":"Any JavaScript object (including arrays and primitive types) to filter."},"returns":"<p>{string} JSON string.</p>","css":"ng-monospace Always applied to the encapsulating element.","example":"<input type=\"text\" name=\"objTxt\" value=\"{a:1, b:[]}\"\n ng:eval=\"obj = $eval(objTxt)\"/>\n<pre>{{ obj | json }}</pre>","scenario":" it('should jsonify filtered objects', function() {\n expect(binding('obj | json')).toBe('{\\n \"a\":1,\\n \"b\":[]}');\n });\n\n it('should update', function() {\n input('objTxt').enter('[1, 2, 3]');\n expect(binding('obj | json')).toBe('[1,2,3]');\n });\n"},{"raw":{"file":"src/filters.js","line":269},"ngdoc":"filter","name":"angular.filter.lowercase","shortName":"lowercase","function":"","see":"angular.lowercase"},{"raw":{"file":"src/filters.js","line":279},"ngdoc":"filter","name":"angular.filter.uppercase","shortName":"uppercase","function":"","see":"angular.uppercase"},{"raw":{"file":"src/filters.js","line":289},"ngdoc":"filter","name":"angular.filter.html","shortName":"html","function":"","description":"<p>Prevents the input from getting escaped by angular. By default the input is sanitized and\ninserted into the DOM as is.</p>\n\n<p>The input is sanitized by parsing the html into tokens. All safe tokens (from a whitelist) are\nthen serialized back to properly escaped html string. This means that no unsafe input can make\nit into the returned string, however since our parser is more strict than a typical browser\nparser, it's possible that some obscure input, which would be recognized as valid HTML by a\nbrowser, won't make it through the sanitizer.</p>\n\n<p>If you hate your users, you may call the filter with optional 'unsafe' argument, which bypasses\nthe html sanitizer, but makes your application vulnerable to XSS and other attacks. Using this\noption is strongly discouraged and should be used only if you absolutely trust the input being\nfiltered and you can't get the content through the sanitizer.</p>","param":[{"type":"string","name":"html","description":"Html input."},{"type":"string","name":"option","description":"If 'unsafe' then do not sanitize the HTML input."}],"paramRest":[{"type":"string","name":"option","description":"If 'unsafe' then do not sanitize the HTML input."}],"paramFirst":{"type":"string","name":"html","description":"Html input."},"returns":"<p>{string} Sanitized or raw html.</p>","example":" Snippet: <textarea name=\"snippet\" cols=\"60\" rows=\"3\">\n&lt;p style=\"color:blue\"&gt;an html\n&lt;em onmouseover=\"this.textContent='PWN3D!'\"&gt;click here&lt;/em&gt;\nsnippet&lt;/p&gt;</textarea>\n <table>\n <tr>\n <td>Filter</td>\n <td>Source</td>\n <td>Rendered</td>\n </tr>\n <tr id=\"html-filter\">\n <td>html filter</td>\n <td>\n <pre>&lt;div ng:bind=\"snippet | html\"&gt;<br/>&lt;/div&gt;</pre>\n </td>\n <td>\n <div ng:bind=\"snippet | html\"></div>\n </td>\n </tr>\n <tr id=\"escaped-html\">\n <td>no filter</td>\n <td><pre>&lt;div ng:bind=\"snippet\"&gt;<br/>&lt;/div&gt;</pre></td>\n <td><div ng:bind=\"snippet\"></div></td>\n </tr>\n <tr id=\"html-unsafe-filter\">\n <td>unsafe html filter</td>\n <td><pre>&lt;div ng:bind=\"snippet | html:'unsafe'\"&gt;<br/>&lt;/div&gt;</pre></td>\n <td><div ng:bind=\"snippet | html:'unsafe'\"></div></td>\n </tr>\n </table>","scenario":" it('should sanitize the html snippet ', function(){\n expect(using('#html-filter').binding('snippet | html')).\n toBe('<p>an html\\n<em>click here</em>\\nsnippet</p>');\n });\n\n it ('should escape snippet without any filter', function() {\n expect(using('#escaped-html').binding('snippet')).\n toBe(\"<p style=\\\"color:blue\\\">an html\\n\" +\n \"<em onmouseover=\\\"this.textContent='PWN3D!'\\\">click here</em>\\n\" +\n \"snippet</p>\");\n });\n\n it ('should inline raw snippet if filtered as unsafe', function() {\n expect(using('#html-unsafe-filter').binding(\"snippet | html:'unsafe'\")).\n toBe(\"<p style=\\\"color:blue\\\">an html\\n\" +\n \"<em onmouseover=\\\"this.textContent='PWN3D!'\\\">click here</em>\\n\" +\n \"snippet</p>\");\n });\n\n it('should update', function(){\n input('snippet').enter('new <b>text</b>');\n expect(using('#html-filter').binding('snippet | html')).toBe('new <b>text</b>');\n expect(using('#escaped-html').binding('snippet')).toBe(\"new <b>text</b>\");\n expect(using('#html-unsafe-filter').binding(\"snippet | html:'unsafe'\")).toBe('new <b>text</b>');\n });"},{"raw":{"file":"src/filters.js","line":377},"ngdoc":"filter","name":"angular.filter.linky","shortName":"linky","function":"","description":"<p>Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and\nplane email address links.</p>","param":[{"type":"string","name":"text","description":"Input text."}],"paramRest":[],"paramFirst":{"type":"string","name":"text","description":"Input text."},"returns":"<p>{string} Html-linkified text.</p>","example":" Snippet: <textarea name=\"snippet\" cols=\"60\" rows=\"3\">\nPretty text with some links:\nhttp://angularjs.org/,\nmailto:[email protected],\[email protected],\nand one more: ftp://127.0.0.1/.</textarea>\n <table>\n <tr>\n <td>Filter</td>\n <td>Source</td>\n <td>Rendered</td>\n </tr>\n <tr id=\"linky-filter\">\n <td>linky filter</td>\n <td>\n <pre>&lt;div ng:bind=\"snippet | linky\"&gt;<br/>&lt;/div&gt;</pre>\n </td>\n <td>\n <div ng:bind=\"snippet | linky\"></div>\n </td>\n </tr>\n <tr id=\"escaped-html\">\n <td>no filter</td>\n <td><pre>&lt;div ng:bind=\"snippet\"&gt;<br/>&lt;/div&gt;</pre></td>\n <td><div ng:bind=\"snippet\"></div></td>\n </tr>\n </table>","scenario":" it('should linkify the snippet with urls', function(){\n expect(using('#linky-filter').binding('snippet | linky')).\n toBe('Pretty text with some links:\\n' +\n '<a href=\"http://angularjs.org/\">http://angularjs.org/</a>,\\n' +\n '<a href=\"mailto:[email protected]\">[email protected]</a>,\\n' +\n '<a href=\"mailto:[email protected]\">[email protected]</a>,\\n' +\n 'and one more: <a href=\"ftp://127.0.0.1/\">ftp://127.0.0.1/</a>.');\n });\n\n it ('should not linkify snippet without the linky filter', function() {\n expect(using('#escaped-html').binding('snippet')).\n toBe(\"Pretty text with some links:\\n\" +\n \"http://angularjs.org/,\\n\" +\n \"mailto:[email protected],\\n\" +\n \"[email protected],\\n\" +\n \"and one more: ftp://127.0.0.1/.\");\n });\n\n it('should update', function(){\n input('snippet').enter('new http://link.');\n expect(using('#linky-filter').binding('snippet | linky')).\n toBe('new <a href=\"http://link\">http://link</a>.');\n expect(using('#escaped-html').binding('snippet')).toBe('new http://link.');\n });"},{"raw":{"file":"src/formatters.js","line":10},"ngdoc":"formatter","name":"angular.formatter.json","shortName":"json","description":"<p>Formats the user input as JSON text.</p>","returns":"<p>{string} A JSON string representation of the model.</p>","example":"<div ng:init=\"data={name:'misko', project:'angular'}\">\n <input type=\"text\" size='50' name=\"data\" ng:format=\"json\"/>\n <pre>data={{data}}</pre>\n</div>","scenario":"it('should format json', function(){\n expect(binding('data')).toEqual('data={\\n \\\"name\\\":\\\"misko\\\",\\n \\\"project\\\":\\\"angular\\\"}');\n input('data').enter('{}');\n expect(binding('data')).toEqual('data={\\n }');\n});"},{"raw":{"file":"src/formatters.js","line":34},"ngdoc":"formatter","name":"angular.formatter.boolean","shortName":"boolean","description":"<p>Use boolean formatter if you wish to store the data as boolean.</p>","returns":"<p>Convert to <code>true</code> unless user enters (blank), <code>f</code>, <code>false</code>, <code>0</code>, <code>no</code>, <code>[]</code>.</p>","example":"Enter truthy text:\n<input type=\"text\" name=\"value\" ng:format=\"boolean\" value=\"no\"/>\n<input type=\"checkbox\" name=\"value\"/>\n<pre>value={{value}}</pre>","scenario":"it('should format boolean', function(){\n expect(binding('value')).toEqual('value=false');\n input('value').enter('truthy');\n expect(binding('value')).toEqual('value=true');\n});"},{"raw":{"file":"src/formatters.js","line":58},"ngdoc":"formatter","name":"angular.formatter.number","shortName":"number","description":"<p>Use number formatter if you wish to convert the user entered string to a number.</p>","returns":"<p>parse string to number.</p>","example":"Enter valid number:\n<input type=\"text\" name=\"value\" ng:format=\"number\" value=\"1234\"/>\n<pre>value={{value}}</pre>","scenario":"it('should format numbers', function(){\n expect(binding('value')).toEqual('value=1234');\n input('value').enter('5678');\n expect(binding('value')).toEqual('value=5678');\n});"},{"raw":{"file":"src/formatters.js","line":87},"ngdoc":"formatter","name":"angular.formatter.list","shortName":"list","description":"<p>Use number formatter if you wish to convert the user entered string to a number.</p>","returns":"<p>parse string to number.</p>","example":"Enter a list of items:\n<input type=\"text\" name=\"value\" ng:format=\"list\" value=\" chair ,, table\"/>\n<input type=\"text\" name=\"value\" ng:format=\"list\"/>\n<pre>value={{value}}</pre>","scenario":"it('should format lists', function(){\n expect(binding('value')).toEqual('value=[\"chair\",\"table\"]');\n this.addFutureAction('change to XYZ', function($window, $document, done){\n $document.elements('.doc-example :input:last').val(',,a,b,').trigger('change');\n done();\n });\n expect(binding('value')).toEqual('value=[\"a\",\"b\"]');\n});"},{"raw":{"file":"src/formatters.js","line":124},"ngdoc":"formatter","name":"angular.formatter.trim","shortName":"trim","description":"<p>Use trim formatter if you wish to trim extra spaces in user text.</p>","returns":"<p>{String} Trim excess leading and trailing space.</p>","example":"Enter text with leading/trailing spaces:\n<input type=\"text\" name=\"value\" ng:format=\"trim\" value=\" book \"/>\n<input type=\"text\" name=\"value\" ng:format=\"trim\"/>\n<pre>value={{value|json}}</pre>","scenario":"it('should format trim', function(){\n expect(binding('value')).toEqual('value=\"book\"');\n this.addFutureAction('change to XYZ', function($window, $document, done){\n $document.elements('.doc-example :input:last').val(' text ').trigger('change');\n done();\n });\n expect(binding('value')).toEqual('value=\"text\"');\n});"},{"raw":{"file":"src/validators.js","line":4},"ngdoc":"validator","name":"angular.validator.regexp","shortName":"regexp","description":"<p>Use regexp validator to restrict the input to any Regular Expression.</p>","param":[{"type":"string","name":"value","description":"value to validate"},{"type":"regexp","name":"expression","description":"regular expression."}],"paramRest":[{"type":"regexp","name":"expression","description":"regular expression."}],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"css":"ng-validation-error","example":"Enter valid SSN:\n<input name=\"ssn\" value=\"123-45-6789\" ng:validate=\"regexp:/^\\d\\d\\d-\\d\\d-\\d\\d\\d\\d$/\" >","scenario":"it('should invalidate non ssn', function(){\n var textBox = element('.doc-example :input');\n expect(textBox.attr('className')).not().toMatch(/ng-validation-error/);\n expect(textBox.val()).toEqual('123-45-6789');\n \n input('ssn').enter('123-45-67890');\n expect(textBox.attr('className')).toMatch(/ng-validation-error/);\n});\n"},{"raw":{"file":"src/validators.js","line":38},"ngdoc":"validator","name":"angular.validator.number","shortName":"number","description":"<p>Use number validator to restrict the input to numbers with an \noptional range. (See integer for whole numbers validator).</p>","param":[{"type":"string","name":"value","description":"value to validate"},{"type":"int","name":"min","default":"MIN_INT","description":"minimum value."},{"type":"int","name":"max","default":"MAX_INT","description":"maximum value."}],"paramRest":[{"type":"int","name":"min","default":"MIN_INT","description":"minimum value."},{"type":"int","name":"max","default":"MAX_INT","description":"maximum value."}],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"css":"ng-validation-error","example":"Enter number: <input name=\"n1\" ng:validate=\"number\" > <br>\nEnter number greater than 10: <input name=\"n2\" ng:validate=\"number:10\" > <br>\nEnter number between 100 and 200: <input name=\"n3\" ng:validate=\"number:100:200\" > <br>","scenario":"it('should invalidate number', function(){\n var n1 = element('.doc-example :input[name=n1]');\n expect(n1.attr('className')).not().toMatch(/ng-validation-error/);\n input('n1').enter('1.x');\n expect(n1.attr('className')).toMatch(/ng-validation-error/);\n \n var n2 = element('.doc-example :input[name=n2]');\n expect(n2.attr('className')).not().toMatch(/ng-validation-error/);\n input('n2').enter('9');\n expect(n2.attr('className')).toMatch(/ng-validation-error/);\n \n var n3 = element('.doc-example :input[name=n3]');\n expect(n3.attr('className')).not().toMatch(/ng-validation-error/);\n input('n3').enter('201');\n expect(n3.attr('className')).toMatch(/ng-validation-error/);\n \n});\n"},{"raw":{"file":"src/validators.js","line":90},"ngdoc":"validator","name":"angular.validator.integer","shortName":"integer","description":"<p>Use number validator to restrict the input to integers with an \noptional range. (See integer for whole numbers validator).</p>","param":[{"type":"string","name":"value","description":"value to validate"},{"type":"int","name":"min","default":"MIN_INT","description":"minimum value."},{"type":"int","name":"max","default":"MAX_INT","description":"maximum value."}],"paramRest":[{"type":"int","name":"min","default":"MIN_INT","description":"minimum value."},{"type":"int","name":"max","default":"MAX_INT","description":"maximum value."}],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"css":"ng-validation-error","example":"Enter integer: <input name=\"n1\" ng:validate=\"integer\" > <br>\nEnter integer equal or greater than 10: <input name=\"n2\" ng:validate=\"integer:10\" > <br>\nEnter integer between 100 and 200 (inclusive): <input name=\"n3\" ng:validate=\"integer:100:200\" > <br>","scenario":"it('should invalidate integer', function(){\n var n1 = element('.doc-example :input[name=n1]');\n expect(n1.attr('className')).not().toMatch(/ng-validation-error/);\n input('n1').enter('1.1');\n expect(n1.attr('className')).toMatch(/ng-validation-error/);\n \n var n2 = element('.doc-example :input[name=n2]');\n expect(n2.attr('className')).not().toMatch(/ng-validation-error/);\n input('n2').enter('10.1');\n expect(n2.attr('className')).toMatch(/ng-validation-error/);\n \n var n3 = element('.doc-example :input[name=n3]');\n expect(n3.attr('className')).not().toMatch(/ng-validation-error/);\n input('n3').enter('100.1');\n expect(n3.attr('className')).toMatch(/ng-validation-error/);\n \n});"},{"raw":{"file":"src/validators.js","line":135},"ngdoc":"validator","name":"angular.validator.date","shortName":"date","description":"<p>Use date validator to restrict the user input to a valid date\nin format in format MM/DD/YYYY.</p>","param":[{"type":"string","name":"value","description":"value to validate"}],"paramRest":[],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"css":"ng-validation-error","example":"Enter valid date:\n<input name=\"text\" value=\"1/1/2009\" ng:validate=\"date\" >","scenario":"it('should invalidate date', function(){\n var n1 = element('.doc-example :input');\n expect(n1.attr('className')).not().toMatch(/ng-validation-error/);\n input('text').enter('123/123/123');\n expect(n1.attr('className')).toMatch(/ng-validation-error/);\n});\n"},{"raw":{"file":"src/validators.js","line":168},"ngdoc":"validator","name":"angular.validator.email","shortName":"email","description":"<p>Use email validator if you wist to restrict the user input to a valid email.</p>","param":[{"type":"string","name":"value","description":"value to validate"}],"paramRest":[],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"css":"ng-validation-error","example":"Enter valid email:\n<input name=\"text\" ng:validate=\"email\" value=\"[email protected]\">","scenario":"it('should invalidate email', function(){\n var n1 = element('.doc-example :input');\n expect(n1.attr('className')).not().toMatch(/ng-validation-error/);\n input('text').enter('[email protected]');\n expect(n1.attr('className')).toMatch(/ng-validation-error/);\n});\n"},{"raw":{"file":"src/validators.js","line":197},"ngdoc":"validator","name":"angular.validator.phone","shortName":"phone","description":"<p>Use phone validator to restrict the input phone numbers.</p>","param":[{"type":"string","name":"value","description":"value to validate"}],"paramRest":[],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"css":"ng-validation-error","example":"Enter valid phone number:\n<input name=\"text\" value=\"1(234)567-8901\" ng:validate=\"phone\" >","scenario":"it('should invalidate phone', function(){\n var n1 = element('.doc-example :input');\n expect(n1.attr('className')).not().toMatch(/ng-validation-error/);\n input('text').enter('+12345678');\n expect(n1.attr('className')).toMatch(/ng-validation-error/);\n});\n"},{"raw":{"file":"src/validators.js","line":229},"ngdoc":"validator","name":"angular.validator.url","shortName":"url","description":"<p>Use phone validator to restrict the input URLs.</p>","param":[{"type":"string","name":"value","description":"value to validate"}],"paramRest":[],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"css":"ng-validation-error","example":"Enter valid phone number:\n<input name=\"text\" value=\"http://example.com/abc.html\" size=\"40\" ng:validate=\"url\" >","scenario":"it('should invalidate url', function(){\n var n1 = element('.doc-example :input');\n expect(n1.attr('className')).not().toMatch(/ng-validation-error/);\n input('text').enter('abc://server/path');\n expect(n1.attr('className')).toMatch(/ng-validation-error/);\n});\n"},{"raw":{"file":"src/validators.js","line":258},"ngdoc":"validator","name":"angular.validator.json","shortName":"json","description":"<p>Use json validator if you wish to restrict the user input to a valid JSON.</p>","param":[{"type":"string","name":"value","description":"value to validate"}],"paramRest":[],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"css":"ng-validation-error","example":"<textarea name=\"json\" cols=\"60\" rows=\"5\" ng:validate=\"json\">\n{name:'abc'}\n</textarea>","scenario":"it('should invalidate json', function(){\n var n1 = element('.doc-example :input');\n expect(n1.attr('className')).not().toMatch(/ng-validation-error/);\n input('json').enter('{name}');\n expect(n1.attr('className')).toMatch(/ng-validation-error/);\n});\n"},{"raw":{"file":"src/validators.js","line":290},"ngdoc":"validator","name":"angular.validator.asynchronous","shortName":"asynchronous","description":"<p>Use asynchronous validator if the validation can not be computed \nimmediately, but is provided through a callback. The widget \nautomatically shows a spinning indicator while the validity of \nthe widget is computed. This validator caches the result.</p>","param":[{"type":"string","name":"value","description":"value to validate"},{"type":"function(inputToValidate,validationDone)","name":"validate","description":"function to call to validate the state\n of the input."},{"type":"function(data)","name":"update","default":"noop","description":"function to call when state of the \n validator changes"}],"paramRest":[{"type":"function(inputToValidate,validationDone)","name":"validate","description":"function to call to validate the state\n of the input."},{"type":"function(data)","name":"update","default":"noop","description":"function to call when state of the \n validator changes"}],"paramFirst":{"type":"string","name":"value","description":"value to validate"},"paramDescription":"<p>The <code>validate</code> function (specified by you) is called as \n<code>validate(inputToValidate, validationDone)</code>:</p>\n\n<ul>\n<li><code>inputToValidate</code>: value of the input box.</li>\n<li><code>validationDone</code>: <code>function(error, data){...}</code>\n<ul><li><code>error</code>: error text to display if validation fails</li>\n<li><code>data</code>: data object to pass to update function</li></ul></li>\n</ul>\n\n<p>The <code>update</code> function is optionally specified by you and is\ncalled by <tt><angular/></tt> on input change. Since the \nasynchronous validator caches the results, the update \nfunction can be called without a call to <code>validate</code> \nfunction. The function is called as <code>update(data)</code>:</p>\n\n<ul>\n<li><code>data</code>: data object as passed from validate function</li>\n</ul>","css":"ng-input-indicator-wait, ng-validation-error","example":"<script>\n function myValidator(inputToValidate, validationDone) {\n setTimeout(function(){\n validationDone(inputToValidate.length % 2);\n }, 500);\n }\n</script>\n This input is validated asynchronously:\n <input name=\"text\" ng:validate=\"asynchronous:$window.myValidator\">","scenario":"it('should change color in delayed way', function(){\n var textBox = element('.doc-example :input');\n expect(textBox.attr('className')).not().toMatch(/ng-input-indicator-wait/);\n expect(textBox.attr('className')).not().toMatch(/ng-validation-error/);\n \n input('text').enter('X');\n expect(textBox.attr('className')).toMatch(/ng-input-indicator-wait/);\n \n pause(.6);\n \n expect(textBox.attr('className')).not().toMatch(/ng-input-indicator-wait/);\n expect(textBox.attr('className')).toMatch(/ng-validation-error/);\n \n});\n"},{"raw":{"file":"src/widgets.js","line":1},"ngdoc":"widget","name":"angular.widget.HTML","shortName":"HTML","description":"<p>The most common widgets you will use will be in the from of the\nstandard HTML set. These widgets are bound using the name attribute\nto an expression. In addition they can have <code>ng:validate</code>, <code>ng:required</code>,\n<code>ng:format</code>, <code>ng:change</code> attribute to further control their behavior.</p>","usageContent":"see example below for usage\n\n<input type=\"text|checkbox|...\" ... />\n<textarea ... />\n<select ...>\n <option>...</option>\n</select>","example":"<table style=\"font-size:.9em;\">\n <tr>\n <th>Name</th>\n <th>Format</th>\n <th>HTML</th>\n <th>UI</th>\n <th ng:non-bindable>{{input#}}</th>\n </tr>\n <tr>\n <th>text</th>\n <td>String</td>\n <td><tt>&lt;input type=\"text\" name=\"input1\"&gt;</tt></td>\n <td><input type=\"text\" name=\"input1\" size=\"4\"></td>\n <td><tt>{{input1|json}}</tt></td>\n </tr>\n <tr>\n <th>textarea</th>\n <td>String</td>\n <td><tt>&lt;textarea name=\"input2\"&gt;&lt;/textarea&gt;</tt></td>\n <td><textarea name=\"input2\" cols='6'></textarea></td>\n <td><tt>{{input2|json}}</tt></td>\n </tr>\n <tr>\n <th>radio</th>\n <td>String</td>\n <td><tt>\n &lt;input type=\"radio\" name=\"input3\" value=\"A\"&gt;<br>\n &lt;input type=\"radio\" name=\"input3\" value=\"B\"&gt;\n </tt></td>\n <td>\n <input type=\"radio\" name=\"input3\" value=\"A\">\n <input type=\"radio\" name=\"input3\" value=\"B\">\n </td>\n <td><tt>{{input3|json}}</tt></td>\n </tr>\n <tr>\n <th>checkbox</th>\n <td>Boolean</td>\n <td><tt>&lt;input type=\"checkbox\" name=\"input4\" value=\"checked\"&gt;</tt></td>\n <td><input type=\"checkbox\" name=\"input4\" value=\"checked\"></td>\n <td><tt>{{input4|json}}</tt></td>\n </tr>\n <tr>\n <th>pulldown</th>\n <td>String</td>\n <td><tt>\n &lt;select name=\"input5\"&gt;<br>\n &nbsp;&nbsp;&lt;option value=\"c\"&gt;C&lt;/option&gt;<br>\n &nbsp;&nbsp;&lt;option value=\"d\"&gt;D&lt;/option&gt;<br>\n &lt;/select&gt;<br>\n </tt></td>\n <td>\n <select name=\"input5\">\n <option value=\"c\">C</option>\n <option value=\"d\">D</option>\n </select>\n </td>\n <td><tt>{{input5|json}}</tt></td>\n </tr>\n <tr>\n <th>multiselect</th>\n <td>Array</td>\n <td><tt>\n &lt;select name=\"input6\" multiple size=\"4\"&gt;<br>\n &nbsp;&nbsp;&lt;option value=\"e\"&gt;E&lt;/option&gt;<br>\n &nbsp;&nbsp;&lt;option value=\"f\"&gt;F&lt;/option&gt;<br>\n &lt;/select&gt;<br>\n </tt></td>\n <td>\n <select name=\"input6\" multiple size=\"4\">\n <option value=\"e\">E</option>\n <option value=\"f\">F</option>\n </select>\n </td>\n <td><tt>{{input6|json}}</tt></td>\n </tr>\n</table>","scenario":"it('should exercise text', function(){\n input('input1').enter('Carlos');\n expect(binding('input1')).toEqual('\"Carlos\"');\n});\nit('should exercise textarea', function(){\n input('input2').enter('Carlos');\n expect(binding('input2')).toEqual('\"Carlos\"');\n});\nit('should exercise radio', function(){\n expect(binding('input3')).toEqual('null');\n input('input3').select('A');\n expect(binding('input3')).toEqual('\"A\"');\n input('input3').select('B');\n expect(binding('input3')).toEqual('\"B\"');\n});\nit('should exercise checkbox', function(){\n expect(binding('input4')).toEqual('false');\n input('input4').check();\n expect(binding('input4')).toEqual('true');\n});\nit('should exercise pulldown', function(){\n expect(binding('input5')).toEqual('\"c\"');\n select('input5').option('d');\n expect(binding('input5')).toEqual('\"d\"');\n});\nit('should exercise multiselect', function(){\n expect(binding('input6')).toEqual('[]');\n select('input6').options('e');\n expect(binding('input6')).toEqual('[\"e\"]');\n select('input6').options('e', 'f');\n expect(binding('input6')).toEqual('[\"e\",\"f\"]');\n});"},{"raw":{"file":"src/widgets.js","line":376},"ngdoc":"widget","name":"angular.widget.ng:include","shortName":"ng:include","description":"<p>Include external HTML fragment.</p>\n\n<p>Keep in mind that Same Origin Policy applies to included resources \n(e.g. ng:include won't work for file:// access).</p>","param":[{"type":"string","name":"src","description":"expression evaluating to URL."},{"type":"Scope","name":"scope","default":"new_child_scope","description":"expression evaluating to angular.scope"}],"paramRest":[{"type":"Scope","name":"scope","default":"new_child_scope","description":"expression evaluating to angular.scope"}],"paramFirst":{"type":"string","name":"src","description":"expression evaluating to URL."},"example":"<select name=\"url\">\n <option value=\"angular.filter.date.html\">date filter</option>\n <option value=\"angular.filter.html.html\">html filter</option>\n <option value=\"\">(blank)</option>\n</select>\n<tt>url = <a href=\"{{url}}\">{{url}}</a></tt>\n<hr/>\n<ng:include src=\"url\"></ng:include>","scenario":"it('should load date filter', function(){\n expect(element('.doc-example ng\\\\:include').text()).toMatch(/angular\\.filter\\.date/);\n});\nit('should change to hmtl filter', function(){\n select('url').option('angular.filter.html.html');\n expect(element('.doc-example ng\\\\:include').text()).toMatch(/angular\\.filter\\.html/);\n});\nit('should change to blank', function(){\n select('url').option('(blank)');\n expect(element('.doc-example ng\\\\:include').text()).toEqual('');\n});"},{"raw":{"file":"src/widgets.js","line":457},"ngdoc":"widget","name":"angular.widget.ng:switch","shortName":"ng:switch","description":"<p>Conditionally change the DOM structure.</p>","usageContent":"<any ng:switch-when=\"matchValue1\">...</any>\n <any ng:switch-when=\"matchValue2\">...</any>\n ...\n <any ng:switch-default>...</any>","param":[{"type":"*","name":"on","description":"expression to match against <tt>ng:switch-when</tt>."}],"paramRest":[],"paramFirst":{"type":"*","name":"on","description":"expression to match against <tt>ng:switch-when</tt>."},"paramDescription":"<p>On child elments add:</p>\n\n<ul>\n<li><code>ng:switch-when</code>: the case statement to match against. If match then this\ncase will be displayed.</li>\n<li><code>ng:switch-default</code>: the default case when no other casses match.</li>\n</ul>","example":"<select name=\"switch\">\n <option>settings</option>\n <option>home</option>\n <option>other</option>\n</select>\n<tt>switch={{switch}}</tt>\n</hr>\n<ng:switch on=\"switch\" >\n <div ng:switch-when=\"settings\">Settings Div</div>\n <span ng:switch-when=\"home\">Home Span</span>\n <span ng:switch-default>default</span>\n</ng:switch>\n</code>","scenario":"it('should start in settings', function(){\n expect(element('.doc-example ng\\\\:switch').text()).toEqual('Settings Div');\n});\nit('should change to home', function(){\n select('switch').option('home');\n expect(element('.doc-example ng\\\\:switch').text()).toEqual('Home Span');\n});\nit('should select deafault', function(){\n select('switch').option('other');\n expect(element('.doc-example ng\\\\:switch').text()).toEqual('default');\n});"}]};