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) · 34.2 KB
/
docs-data.js
1
NG_DOC={"section":{"overview":[{"raw":{"file":"src/Angular.js","line":99},"ngdoc":"overview","name":"angular.filter","shortName":"filter","namespace":"Namespace for all filters.","description":"<h1>Overview</h1>\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<h1>Standard Filters</h1>\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<h1>Syntax</h1>\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><li>No filter: {{1234.5678}} => 1234.5678</li><li>Number filter: {{1234.5678|number}} => 1,234.57. Notice the \u201c,\u201d and rounding to two\nsignificant digits.</li><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></ul>\n\n<h1>Writing your own Filters</h1>\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><li><code>this</code> \u2014 The current scope.</li><li><code>$element</code> \u2014 The DOM element containing the binding. This allows the filter to manipulate\nthe DOM in addition to transforming the input.</li></ul>","example":" //TODO this example current doesn't show up anywhere because the overview template doesn't\n // render it.\n\n The following example filter reverses a text string. In addition, it conditionally makes the\n text upper-case (to demonstrate optional arguments) and assigns color (to demonstrate DOM\n modification).\n\n <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 <span ng:non-bindable=\"true\">{{\"hello\"|reverse}}</span>: {{\"hello\"|reverse}}<br>\n <span ng:non-bindable=\"true\">{{\"hello\"|reverse:true}}</span>: {{\"hello\"|reverse:true}}<br>\n <span ng:non-bindable=\"true\">{{\"hello\"|reverse:true:\"blue\"}}</span>:\n {{\"hello\"|reverse:true:\"blue\"}}\n\n//TODO: I completely dropped a mention of using the other option (setter method), it's\nconfusing to have two ways to do the same thing. I just wonder if we should prefer using the\nsetter way over direct assignment because in the future we might want to be able to intercept\nfilter registrations for some reason."}],"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.\n","example":" <input type=\"text\" name=\"amount\" value=\"1234.56\"/> <br/>\n {{amount | currency}}\n","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 // TODO: implement\n // expect(binding('amount')).toHaveColor('red'); //what about toHaveCssClass instead?\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=2]","description":"Number of decimal places to round the number to. Default 2."}],"paramRest":[{"type":"(number|string)","name":"[fractionSize=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":" <span ng:non-bindable>{{1234.56789 | number}}</span>: {{1234.56789 | number}}<br/>\n <span ng:non-bindable>{{1234.56789 | number:0}}</span>: {{1234.56789 | number:0}}<br/>\n <span ng:non-bindable>{{1234.56789 | number:2}}</span>: {{1234.56789 | number:2}}<br/>\n <span ng:non-bindable>{{-1234.56789 | number:4}}</span>: {{-1234.56789 | number:4}}\n","scenario":" it('should format numbers', function(){\n expect(binding('1234.56789 | number')).toBe('1,234.57');\n expect(binding('1234.56789 | number:0')).toBe('1,235');\n expect(binding('1234.56789 | number:2')).toBe('1,234.57');\n expect(binding('-1234.56789 | number:4')).toBe('-1,234.5679');\n });"},{"raw":{"file":"src/filters.js","line":144},"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><li><code>'yyyy'</code>: 4 digit representation of year e.g. 2010</li><li><code>'yy'</code>: 2 digit representation of year, padded (00-99)</li><li><code>'MM'</code>: Month in year, padded (01\u201212)</li><li><code>'M'</code>: Month in year (1\u201212)</li><li><code>'dd'</code>: Day in month, padded (01\u201231)</li><li><code>'d'</code>: Day in month (1-31)</li><li><code>'HH'</code>: Hour in day, padded (00\u201223)</li><li><code>'H'</code>: Hour in day (0-23)</li><li><code>'hh'</code>: Hour in am/pm, padded (01\u201212)</li><li><code>'h'</code>: Hour in am/pm, (1-12)</li><li><code>'mm'</code>: Minute in hour, padded (00\u201259)</li><li><code>'m'</code>: Minute in hour (0-59)</li><li><code>'ss'</code>: Second in minute, padded (00\u201259)</li><li><code>'s'</code>: Second in minute (0\u201259)</li><li><code>'a'</code>: am/pm marker</li><li><code>'Z'</code>: 4 digit (+sign) representation of the timezone offset (-1200\u20121200)</li></ul>","param":[{"type":"(Date|number|string)","name":"date","description":"Date to format either as Date object or milliseconds."},{"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 or milliseconds."},"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/>\n","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":218},"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\n the 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.\n","example":" <span ng:non-bindable>{{ {a:1, b:[]} | json }}</span>: <pre>{{ {a:1, b:[]} | json }}</pre>\n","scenario":" it('should jsonify filtered objects', function() {\n expect(binding('{{ {a:1, b:[]} | json')).toBe('{\\n \"a\":1,\\n \"b\":[]}');\n });\n"},{"raw":{"file":"src/filters.js","line":249},"ngdoc":"filter","name":"angular.filter.lowercase","shortName":"lowercase","function":"","see":"angular.lowercase"},{"raw":{"file":"src/filters.js","line":259},"ngdoc":"filter","name":"angular.filter.uppercase","shortName":"uppercase","function":"","see":"angular.uppercase"},{"raw":{"file":"src/filters.js","line":269},"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\n inserted 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\n then serialized back to properly escaped html string. This means that no unsafe input can make\n it into the returned string, however since our parser is more strict than a typical browser\n parser, it's possible that some obscure input, which would be recognized as valid HTML by a\n browser, 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\n the html sanitizer, but makes your application vulnerable to XSS and other attacks. Using this\n option is strongly discouraged and should be used only if you absolutely trust the input being\n filtered 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>\n","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 textarea('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":357},"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\n plane 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>\n","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 textarea('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 });"}]},"all":[{"raw":{"file":"src/Angular.js","line":99},"ngdoc":"overview","name":"angular.filter","shortName":"filter","namespace":"Namespace for all filters.","description":"<h1>Overview</h1>\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<h1>Standard Filters</h1>\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<h1>Syntax</h1>\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><li>No filter: {{1234.5678}} => 1234.5678</li><li>Number filter: {{1234.5678|number}} => 1,234.57. Notice the \u201c,\u201d and rounding to two\nsignificant digits.</li><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></ul>\n\n<h1>Writing your own Filters</h1>\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><li><code>this</code> \u2014 The current scope.</li><li><code>$element</code> \u2014 The DOM element containing the binding. This allows the filter to manipulate\nthe DOM in addition to transforming the input.</li></ul>","example":" //TODO this example current doesn't show up anywhere because the overview template doesn't\n // render it.\n\n The following example filter reverses a text string. In addition, it conditionally makes the\n text upper-case (to demonstrate optional arguments) and assigns color (to demonstrate DOM\n modification).\n\n <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 <span ng:non-bindable=\"true\">{{\"hello\"|reverse}}</span>: {{\"hello\"|reverse}}<br>\n <span ng:non-bindable=\"true\">{{\"hello\"|reverse:true}}</span>: {{\"hello\"|reverse:true}}<br>\n <span ng:non-bindable=\"true\">{{\"hello\"|reverse:true:\"blue\"}}</span>:\n {{\"hello\"|reverse:true:\"blue\"}}\n\n//TODO: I completely dropped a mention of using the other option (setter method), it's\nconfusing to have two ways to do the same thing. I just wonder if we should prefer using the\nsetter way over direct assignment because in the future we might want to be able to intercept\nfilter registrations for some reason."},{"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.\n","example":" <input type=\"text\" name=\"amount\" value=\"1234.56\"/> <br/>\n {{amount | currency}}\n","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 // TODO: implement\n // expect(binding('amount')).toHaveColor('red'); //what about toHaveCssClass instead?\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=2]","description":"Number of decimal places to round the number to. Default 2."}],"paramRest":[{"type":"(number|string)","name":"[fractionSize=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":" <span ng:non-bindable>{{1234.56789 | number}}</span>: {{1234.56789 | number}}<br/>\n <span ng:non-bindable>{{1234.56789 | number:0}}</span>: {{1234.56789 | number:0}}<br/>\n <span ng:non-bindable>{{1234.56789 | number:2}}</span>: {{1234.56789 | number:2}}<br/>\n <span ng:non-bindable>{{-1234.56789 | number:4}}</span>: {{-1234.56789 | number:4}}\n","scenario":" it('should format numbers', function(){\n expect(binding('1234.56789 | number')).toBe('1,234.57');\n expect(binding('1234.56789 | number:0')).toBe('1,235');\n expect(binding('1234.56789 | number:2')).toBe('1,234.57');\n expect(binding('-1234.56789 | number:4')).toBe('-1,234.5679');\n });"},{"raw":{"file":"src/filters.js","line":144},"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><li><code>'yyyy'</code>: 4 digit representation of year e.g. 2010</li><li><code>'yy'</code>: 2 digit representation of year, padded (00-99)</li><li><code>'MM'</code>: Month in year, padded (01\u201212)</li><li><code>'M'</code>: Month in year (1\u201212)</li><li><code>'dd'</code>: Day in month, padded (01\u201231)</li><li><code>'d'</code>: Day in month (1-31)</li><li><code>'HH'</code>: Hour in day, padded (00\u201223)</li><li><code>'H'</code>: Hour in day (0-23)</li><li><code>'hh'</code>: Hour in am/pm, padded (01\u201212)</li><li><code>'h'</code>: Hour in am/pm, (1-12)</li><li><code>'mm'</code>: Minute in hour, padded (00\u201259)</li><li><code>'m'</code>: Minute in hour (0-59)</li><li><code>'ss'</code>: Second in minute, padded (00\u201259)</li><li><code>'s'</code>: Second in minute (0\u201259)</li><li><code>'a'</code>: am/pm marker</li><li><code>'Z'</code>: 4 digit (+sign) representation of the timezone offset (-1200\u20121200)</li></ul>","param":[{"type":"(Date|number|string)","name":"date","description":"Date to format either as Date object or milliseconds."},{"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 or milliseconds."},"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/>\n","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":218},"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\n the 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.\n","example":" <span ng:non-bindable>{{ {a:1, b:[]} | json }}</span>: <pre>{{ {a:1, b:[]} | json }}</pre>\n","scenario":" it('should jsonify filtered objects', function() {\n expect(binding('{{ {a:1, b:[]} | json')).toBe('{\\n \"a\":1,\\n \"b\":[]}');\n });\n"},{"raw":{"file":"src/filters.js","line":249},"ngdoc":"filter","name":"angular.filter.lowercase","shortName":"lowercase","function":"","see":"angular.lowercase"},{"raw":{"file":"src/filters.js","line":259},"ngdoc":"filter","name":"angular.filter.uppercase","shortName":"uppercase","function":"","see":"angular.uppercase"},{"raw":{"file":"src/filters.js","line":269},"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\n inserted 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\n then serialized back to properly escaped html string. This means that no unsafe input can make\n it into the returned string, however since our parser is more strict than a typical browser\n parser, it's possible that some obscure input, which would be recognized as valid HTML by a\n browser, 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\n the html sanitizer, but makes your application vulnerable to XSS and other attacks. Using this\n option is strongly discouraged and should be used only if you absolutely trust the input being\n filtered 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>\n","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 textarea('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":357},"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\n plane 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>\n","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 textarea('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 });"}]};