Update to Angular 1.1.4

This commit is contained in:
Colin Frei 2013-04-07 11:37:21 +02:00
parent 72a485d6e8
commit f5fc1369ad
585 changed files with 48055 additions and 3041 deletions

10
lib/angular/docs/partials/api/AUTO.$injector.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">AUTO</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/auto/injector.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p><code>$injector</code> is used to retrieve object instances as defined by
<a href="api/AUTO.$provide"><code>provider</code></a>, instantiate types, invoke methods,
and load modules.</p>
@ -24,15 +24,15 @@ following ways are all valid way of annotating function with injection arguments
<pre class="prettyprint linenums">
// inferred (only works if code not minified/obfuscated)
$inject.invoke(function(serviceA){});
$injector.invoke(function(serviceA){});
// annotated
function explicit(serviceA) {};
explicit.$inject = ['serviceA'];
$inject.invoke(explicit);
$injector.invoke(explicit);
// inline
$inject.invoke(['serviceA', function(serviceA){}]);
$injector.invoke(['serviceA', function(serviceA){}]);
</pre>
<h4>Inference</h4>
@ -71,7 +71,7 @@ the function into a string using <code>toString()</code> method and extracting t
<p>This method does not work with code minfication / obfuscation. For this reason the following annotation strategies
are supported.</p>
<h4>The <code>$injector</code> property</h4>
<h4>The <code>$inject</code> property</h4>
<p>If a function has an <code>$inject</code> property and its value is an array of strings, then the strings represent names of
services to be injected into the function.

4
lib/angular/docs/partials/api/AUTO.$provide.html Normal file → Executable file
View file

@ -2,9 +2,9 @@
<span class="hint">(service in module <code ng:non-bindable="">AUTO</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/auto/injector.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Use <code>$provide</code> to register new providers with the <code>$injector</code>. The providers are the factories for the instance.
The providers share the same name as the instance they create with the <code>Provider</code> suffixed to them.</p>
The providers share the same name as the instance they create with <code>Provider</code> suffixed to them.</p>
<p>A provider is an object with a <code>$get()</code> method. The injector calls the <code>$get</code> method to create a new instance of
a service. The Provider can have additional methods which would allow for configuration of the provider.</p>

2
lib/angular/docs/partials/api/AUTO.html Normal file → Executable file
View file

@ -1,4 +1,4 @@
<h1><code ng:non-bindable=""></code>
<span class="hint"></span>
</h1>
<div><p>Implicit module which gets automatically added to each <a href="api/AUTO.$injector"><code>$injector</code></a>.</p></div>
<div><a href="http://github.com/angular/angular.js/edit/master/src/auto/injector.js" class="improve-docs btn btn-primary">Improve this doc</a><p>Implicit module which gets automatically added to each <a href="api/AUTO.$injector"><code>$injector</code></a>.</p></div>

28
lib/angular/docs/partials/api/angular.IModule.html Normal file → Executable file
View file

@ -2,10 +2,34 @@
<span class="hint">(Type in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/loader.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Interface for configuring angular <a href="api/angular.module"><code>modules</code></a>.</p></div>
<div class="member method"><h2 id="Methods">Methods</h2>
<ul class="methods"><li><h3 id="config">config(configFn)</h3>
<ul class="methods"><li><h3 id="animation">animation(name, animationFactory)</h3>
<div class="animation"><p>Defines an animation hook that can be later used with <a href="api/ng.directive:ngAnimate"><code>ngAnimate</code></a>
alongside <a href="api/ng.directive:ngAnimate#Description"><code>common ng directives</code></a> as well as custom directives.
<pre class="prettyprint linenums">
module.animation('animation-name', function($inject1, $inject2) {
return {
//this gets called in preparation to setup an animation
setup : function(element) { ... },
//this gets called once the animation is run
start : function(element, done, memo) { ... }
}
})
</pre>
<p>See <a href="api/ng.$animationProvider#register"><code>$animationProvider.register()</code></a> and
<a href="api/ng.directive:ngAnimate"><code>ngAnimate</code></a> for more information.</p><h4 id="Parameters">Parameters</h4>
<ul class="parameters"><li><code ng:non-bindable="">name {string} </code>
<p>animation name</p></li>
<li><code ng:non-bindable="">animationFactory {Function} </code>
<p>Factory function for creating new instance of an animation.</p></li>
</ul>
</div>
</li>
<li><h3 id="config">config(configFn)</h3>
<div class="config"><p>Use this method to register work which needs to be performed on module loading.</p><h4 id="Parameters">Parameters</h4>
<ul class="parameters"><li><code ng:non-bindable="">configFn {Function} </code>
<p>Execute this function on module load. Useful for service

2
lib/angular/docs/partials/api/angular.bind.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Returns a function which calls function <code>fn</code> bound to <code>self</code> (<code>self</code> becomes the <code>this</code> for
<code>fn</code>). You can supply optional <code>args</code> that are are prebound to the function. This feature is also
known as <a href="http://en.wikipedia.org/wiki/Currying">function currying</a>.</p></div>

2
lib/angular/docs/partials/api/angular.bootstrap.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Use this function to manually start up angular application.</p>
<p>See: <a href="guide/bootstrap">Bootstrap</a></p></div>

2
lib/angular/docs/partials/api/angular.copy.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Creates a deep copy of <code>source</code>, which should be an object or an array.</p>
<ul>

4
lib/angular/docs/partials/api/angular.element.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/jqLite.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Wraps a raw DOM element or HTML string as a <a href="http://jquery.com">jQuery</a> element.
<code>angular.element</code> can be either an alias for <a href="http://api.jquery.com/jQuery/">jQuery</a> function, if
jQuery is available, or a function that wraps the element or string in Angular's jQuery lite
@ -54,7 +54,7 @@ raw DOM references.</p>
<li><a href="http://api.jquery.com/wrap/">wrap()</a></li>
</ul>
<h4>In addtion to the above, Angular provides additional methods to both jQuery and jQuery lite:</h4>
<h4>In addition to the above, Angular provides additional methods to both jQuery and jQuery lite:</h4>
<ul>
<li><code>controller(name)</code> - retrieves the controller of the current element or its parent. By default

4
lib/angular/docs/partials/api/angular.equals.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Determines if two objects or two values are equivalent. Supports value types, arrays and
objects.</p>
@ -14,7 +14,7 @@ objects.</p>
<li>Both values are NaN. (In JavasScript, NaN == NaN => false. But we consider two NaN as equal)</li>
</ul>
<p>During a property comparision, properties of <code>function</code> type and properties with names
<p>During a property comparison, properties of <code>function</code> type and properties with names
that begin with <code>$</code> are ignored.</p>
<p>Scope and DOMWindow objects are being compared only be identify (<code>===</code>).</p></div>

2
lib/angular/docs/partials/api/angular.extend.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Extends the destination object <code>dst</code> by copying all of the properties from the <code>src</code> object(s)
to <code>dst</code>. You can specify multiple <code>src</code> objects.</p></div>
<h2 id="Usage">Usage</h2>

2
lib/angular/docs/partials/api/angular.forEach.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Invokes the <code>iterator</code> function once for each item in <code>obj</code> collection, which can be either an
object or an array. The <code>iterator</code> function is invoked with <code>iterator(value, key)</code>, where <code>value</code>
is the value of an object property or an array element and <code>key</code> is the object property key or

2
lib/angular/docs/partials/api/angular.fromJson.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Deserializes a JSON string.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">angular.fromJson(json);</pre>

2
lib/angular/docs/partials/api/angular.identity.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>A function that returns its first argument. This function is useful when writing code in the
functional style.</p>

2
lib/angular/docs/partials/api/angular.injector.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/auto/injector.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Creates an injector function that can be used for retrieving services as well as for
dependency injection (see <a href="guide/di">dependency injection</a>).</p></div>
<h2 id="Usage">Usage</h2>

2
lib/angular/docs/partials/api/angular.isArray.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Determines if a reference is an <code>Array</code>.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">angular.isArray(value);</pre>

2
lib/angular/docs/partials/api/angular.isDate.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Determines if a value is a date.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">angular.isDate(value);</pre>

2
lib/angular/docs/partials/api/angular.isDefined.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Determines if a reference is defined.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">angular.isDefined(value);</pre>

2
lib/angular/docs/partials/api/angular.isElement.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Determines if a reference is a DOM element (or wrapped jQuery element).</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">angular.isElement(value);</pre>

2
lib/angular/docs/partials/api/angular.isFunction.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Determines if a reference is a <code>Function</code>.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">angular.isFunction(value);</pre>

2
lib/angular/docs/partials/api/angular.isNumber.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Determines if a reference is a <code>Number</code>.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">angular.isNumber(value);</pre>

2
lib/angular/docs/partials/api/angular.isObject.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Determines if a reference is an <code>Object</code>. Unlike <code>typeof</code> in JavaScript, <code>null</code>s are not
considered to be objects.</p></div>
<h2 id="Usage">Usage</h2>

2
lib/angular/docs/partials/api/angular.isString.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Determines if a reference is a <code>String</code>.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">angular.isString(value);</pre>

2
lib/angular/docs/partials/api/angular.isUndefined.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Determines if a reference is undefined.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">angular.isUndefined(value);</pre>

2
lib/angular/docs/partials/api/angular.lowercase.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Converts the specified string to lowercase.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">angular.lowercase(string);</pre>

5
lib/angular/docs/partials/api/angular.mock.TzDate.html Normal file → Executable file
View file

@ -2,10 +2,10 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ngMock/angular-mocks.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p><em>NOTE</em>: this is not an injectable instance, just a globally available mock class of <code>Date</code>.</p>
<p>Mock of the Date type which has its timezone specified via constroctor arg.</p>
<p>Mock of the Date type which has its timezone specified via constructor arg.</p>
<p>The main purpose is to create Date-like instances with timezone fixed to the specified timezone
offset, so that we can test code that depends on local timezone settings without dependency on
@ -36,5 +36,6 @@ newYearInBratislava.getMonth() =&gt; 0;
newYearInBratislava.getDate() =&gt; 1;
newYearInBratislava.getHours() =&gt; 0;
newYearInBratislava.getMinutes() =&gt; 0;
newYearInBratislava.getSeconds() =&gt; 0;
</pre></div>
</div>

View file

@ -0,0 +1,25 @@
<h1><code ng:non-bindable="">angular.mock.createMockWindow</code>
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ngMock/angular-mocks.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>This function creates a mock window object useful for controlling access ot setTimeout, but mocking out
sufficient window's properties to allow Angular to execute.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">angular.mock.createMockWindow();</pre>
</div>
<h2 id="Example">Example</h2>
<div class="example"><pre class="prettyprint linenums">
beforeEach(module(function($provide) {
$provide.value('$window', window = angular.mock.createMockWindow());
}));
it('should do something', inject(function($window) {
var val = null;
$window.setTimeout(function() { val = 123; }, 10);
expect(val).toEqual(null);
window.setTimeout.expect(10).process();
expect(val).toEqual(123);
});
</pre></div>
</div>

2
lib/angular/docs/partials/api/angular.mock.dump.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ngMock/angular-mocks.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p><em>NOTE</em>: this is not an injectable instance, just a globally available function.</p>
<p>Method for serializing common angular objects (scope, elements, etc..) into strings, useful for debugging.</p>

2
lib/angular/docs/partials/api/angular.mock.html Normal file → Executable file
View file

@ -2,4 +2,4 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><p>Namespace from 'angular-mocks.js' which contains testing related code.</p></div>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ngMock/angular-mocks.js" class="improve-docs btn btn-primary">Improve this doc</a><p>Namespace from 'angular-mocks.js' which contains testing related code.</p></div>

5
lib/angular/docs/partials/api/angular.mock.inject.html Normal file → Executable file
View file

@ -2,9 +2,8 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div class="description"><p><em>NOTE</em>: This is function is also published on window for easy access.<br>
<em>NOTE</em>: Only available with <a href="http://pivotal.github.com/jasmine/">jasmine</a>.</p>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ngMock/angular-mocks.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p><em>NOTE</em>: This function is also published on window for easy access.<br></p>
<p>The inject function wraps a function into an injectable function. The inject() creates new
instance of <a href="api/AUTO.$injector"><code>$injector</code></a> per test, which is then used for

5
lib/angular/docs/partials/api/angular.mock.module.html Normal file → Executable file
View file

@ -2,9 +2,8 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div class="description"><p><em>NOTE</em>: This is function is also published on window for easy access.<br>
<em>NOTE</em>: Only available with <a href="http://pivotal.github.com/jasmine/">jasmine</a>.</p>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ngMock/angular-mocks.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p><em>NOTE</em>: This function is also published on window for easy access.<br></p>
<p>This function registers a module configuration code. It collects the configuration information
which will be used when the injector is created by <a href="api/angular.mock.inject"><code>inject</code></a>.</p>

2
lib/angular/docs/partials/api/angular.module.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/loader.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The <code>angular.module</code> is a global place for creating and registering Angular modules. All
modules (angular core or 3rd party) that should be available to an application must be
registered using this mechanism.</p>

View file

@ -0,0 +1,15 @@
<h1><code ng:non-bindable="">angular.noConflict</code>
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Restores the previous global value of angular and returns the current instance. Other libraries may already use the
angular namespace. Or a previous version of angular is already loaded on the page. In these cases you may want to
restore the previous namespace and keep a reference to angular.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">angular.noConflict();</pre>
<h3 id="Returns">Returns</h3>
<div class="returns"><code ng:non-bindable="">{Object}</code>
<p>The current angular namespace</p></div>
</div>
</div>

2
lib/angular/docs/partials/api/angular.noop.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>A function that performs no operations. This function can be useful when writing code in the
functional style.
<pre class="prettyprint linenums">

2
lib/angular/docs/partials/api/angular.toJson.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Serializes input into a JSON-formatted string.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">angular.toJson(obj[, pretty]);</pre>

2
lib/angular/docs/partials/api/angular.uppercase.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Converts the specified string to uppercase.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">angular.uppercase(string);</pre>

2
lib/angular/docs/partials/api/angular.version.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(API in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/AngularPublic.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>An object that contains information about the current AngularJS version. This object has the
following properties:</p>

2
lib/angular/docs/partials/api/index.html Normal file → Executable file
View file

@ -1,6 +1,6 @@
<h1><code ng:non-bindable=""></code>
<span class="hint"></span>
</h1>
<div><p>Use the API Reference documentation when you need more information about a specific feature. Check out
<div><a href="http://github.com/angular/angular.js/edit/master/docs/content/api/index.ngdoc" class="improve-docs btn btn-primary">Improve this doc</a><p>Use the API Reference documentation when you need more information about a specific feature. Check out
<a href="guide/index">Developer Guide</a> for AngularJS concepts. If you are new to AngularJS we recommend the
<a href="tutorial/index">Tutorial</a>.</p></div>

2
lib/angular/docs/partials/api/ng.$anchorScroll.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/anchorScroll.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>When called, it checks current value of <code>$location.hash()</code> and scroll to related element,
according to rules specified in
<a href="http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document">Html5 spec</a>.</p>

View file

@ -0,0 +1,20 @@
<h1><code ng:non-bindable="">$animation</code>
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/animation.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The $animation service is used to retrieve any defined animation functions. When executed, the $animation service
will return a object that contains the setup and start functions that were defined for the animation.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">$animation(name);</pre>
<h3 id="Parameters">Parameters</h3>
<ul class="parameters"><li><code ng:non-bindable="">name {String} </code>
<p>Name of the animation function to retrieve. Animation functions are registered and stored
inside of the AngularJS DI so a call to $animate('custom') is the same as injecting <code>customAnimation</code>
via dependency injection.</p></li>
</ul>
<h3 id="Returns">Returns</h3>
<div class="returns"><code ng:non-bindable="">{Object}</code>
<p>the animation object which contains the <code>setup</code> and <code>start</code> functions that perform the animation.</p></div>
</div>
</div>

View file

@ -0,0 +1,29 @@
<h1><code ng:non-bindable="">$animationProvider</code>
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/animation.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The $AnimationProvider provider allows developers to register and access custom JavaScript animations directly inside
of a module.</p></div>
<div class="member method"><h2 id="Methods">Methods</h2>
<ul class="methods"><li><h3 id="register">register(name, factory)</h3>
<div class="register"><p>Registers a new injectable animation factory function. The factory function produces the animation object which
has these two properties:</p>
<ul>
<li><code>setup</code>: <code>function(Element):*</code> A function which receives the starting state of the element. The purpose
of this function is to get the element ready for animation. Optionally the function returns an memento which
is passed to the <code>start</code> function.</li>
<li><code>start</code>: <code>function(Element, doneFunction, *)</code> The element to animate, the <code>doneFunction</code> to be called on
element animation completion, and an optional memento from the <code>setup</code> function.</li>
</ul><h4 id="Parameters">Parameters</h4>
<ul class="parameters"><li><code ng:non-bindable="">name {string} </code>
<p>The name of the animation.</p></li>
<li><code ng:non-bindable="">factory {function} </code>
<p>The factory function that will be executed to return the animation object.</p></li>
</ul>
</div>
</li>
</ul>
</div>
</div>

View file

@ -0,0 +1,69 @@
<h1><code ng:non-bindable="">$animator</code>
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/animator.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The $animator service provides the DOM manipulation API which is decorated with animations.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">$animator(scope, attr);</pre>
<h3 id="Parameters">Parameters</h3>
<ul class="parameters"><li><code ng:non-bindable="">scope {Scope} </code>
<p>the scope for the ng-animate.</p></li>
<li><code ng:non-bindable="">attr {Attributes} </code>
<p>the attributes object which contains the ngAnimate key / value pair. (The attributes are
passed into the linking function of the directive using the <code>$animator</code>.)</p></li>
</ul>
<h3 id="Returns">Returns</h3>
<div class="returns"><code ng:non-bindable="">{object}</code>
<p>the animator object which contains the enter, leave, move, show, hide and animate methods.</p></div>
</div>
<div class="member method"><h2 id="Methods">Methods</h2>
<ul class="methods"><li><h3 id="enter">enter(element, parent, after)</h3>
<div class="enter"><p>Injects the element object into the DOM (inside of the parent element) and then runs the enter animation.</p><h4 id="Parameters">Parameters</h4>
<ul class="parameters"><li><code ng:non-bindable="">element {jQuery/jqLite element} </code>
<p>the element that will be the focus of the enter animation</p></li>
<li><code ng:non-bindable="">parent {jQuery/jqLite element} </code>
<p>the parent element of the element that will be the focus of the enter animation</p></li>
<li><code ng:non-bindable="">after {jQuery/jqLite element} </code>
<p>the sibling element (which is the previous element) of the element that will be the focus of the enter animation</p></li>
</ul>
</div>
</li>
<li><h3 id="hide">hide(element)</h3>
<div class=""><p>Starts the hide animation first and sets the CSS <code>display</code> property to <code>none</code> upon completion.</p><h4 id="Parameters">Parameters</h4>
<ul class="parameters"><li><code ng:non-bindable="">element {jQuery/jqLite element} </code>
<p>the element that will be rendered visible or hidden</p></li>
</ul>
</div>
</li>
<li><h3 id="leave">leave(element, parent)</h3>
<div class="leave"><p>Runs the leave animation operation and, upon completion, removes the element from the DOM.</p><h4 id="Parameters">Parameters</h4>
<ul class="parameters"><li><code ng:non-bindable="">element {jQuery/jqLite element} </code>
<p>the element that will be the focus of the leave animation</p></li>
<li><code ng:non-bindable="">parent {jQuery/jqLite element} </code>
<p>the parent element of the element that will be the focus of the leave animation</p></li>
</ul>
</div>
</li>
<li><h3 id="move">move(element, parent, after)</h3>
<div class="move"><p>Fires the move DOM operation. Just before the animation starts, the animator will either append it into the parent container or
add the element directly after the after element if present. Then the move animation will be run.</p><h4 id="Parameters">Parameters</h4>
<ul class="parameters"><li><code ng:non-bindable="">element {jQuery/jqLite element} </code>
<p>the element that will be the focus of the move animation</p></li>
<li><code ng:non-bindable="">parent {jQuery/jqLite element} </code>
<p>the parent element of the element that will be the focus of the move animation</p></li>
<li><code ng:non-bindable="">after {jQuery/jqLite element} </code>
<p>the sibling element (which is the previous element) of the element that will be the focus of the move animation</p></li>
</ul>
</div>
</li>
<li><h3 id="show">show(element)</h3>
<div class="show"><p>Reveals the element by setting the CSS property <code>display</code> to <code>block</code> and then starts the show animation directly after.</p><h4 id="Parameters">Parameters</h4>
<ul class="parameters"><li><code ng:non-bindable="">element {jQuery/jqLite element} </code>
<p>the element that will be rendered visible or hidden</p></li>
</ul>
</div>
</li>
</ul>
</div>
</div>

2
lib/angular/docs/partials/api/ng.$cacheFactory.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/cacheFactory.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Factory that constructs cache objects.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">$cacheFactory(cacheId[, options]);</pre>

View file

@ -2,7 +2,7 @@
<span class="hint">(type in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/compile.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>A shared object between directive compile / linking functions which contains normalized DOM element
attributes. The the values reflect current binding state <code>{{ }}</code>. The normalization is needed
since all of these are treated as equivalent in Angular:</p>
@ -17,7 +17,7 @@ since all of these are treated as equivalent in Angular:</p>
revers translated using the <a href="api/ng.$compile.directive.Attributes#$attr"><code>$attr</code></a>
property to the original name.</p></li>
<li><code ng:non-bindable="">value {string} </code>
<p>Value to set the attribute to.</p></li>
<p>Value to set the attribute to. The value can be an interpolated string.</p></li>
</ul>
</div>
</li>

4
lib/angular/docs/partials/api/ng.$compile.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/compile.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Compiles a piece of HTML string or DOM into a template and produces a template function, which
can then be used to link <a href="api/ng.$rootScope.Scope"><code>scope</code></a> and the template together.</p>
@ -76,7 +76,7 @@ case each call results in a view that is a DOM clone of the original template.</
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="compile" ng-set-html="index.html-84" ng-eval-javascript="script.js-83"></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="compile" ng-set-html="index.html-84" ng-eval-javascript="script.js-83"></div></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">$compile(element, transclude, maxPriority);</pre>
<h3 id="Parameters">Parameters</h3>

23
lib/angular/docs/partials/api/ng.$compileProvider.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/compile.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"></div>
<div class="member method"><h2 id="Methods">Methods</h2>
<ul class="methods"><li><h3 id="directive">directive(name, directiveFactory)</h3>
@ -11,7 +11,7 @@
<p>Name of the directive in camel-case. (ie <code>ngBind</code> which will match as
<code>ng-bind</code>).</p></li>
<li><code ng:non-bindable="">directiveFactory {function} </code>
<p>An injectable directive factroy function. See <a href="guide/directive">guide/directive</a> for more
<p>An injectable directive factory function. See <a href="guide/directive">guide/directive</a> for more
info.</p></li>
</ul>
<h4 id="Returns">Returns</h4>
@ -19,6 +19,25 @@ info.</p></li>
<p>Self for chaining.</p></div>
</div>
</li>
<li><h3 id="urlSanitizationWhitelist">urlSanitizationWhitelist(regexp)</h3>
<div class="urlsanitizationwhitelist"><p>Retrieves or overrides the default regular expression that is used for whitelisting of safe
urls during a[href] sanitization.</p>
<p>The sanitization is a security measure aimed at prevent XSS attacks via html links.</p>
<p>Any url about to be assigned to a[href] via data-binding is first normalized and turned into an
absolute url. Afterwards the url is matched against the <code>urlSanitizationWhitelist</code> regular
expression. If a match is found the original url is written into the dom. Otherwise the
absolute url is prefixed with <code>'unsafe:'</code> string and only then it is written into the DOM.</p><h4 id="Parameters">Parameters</h4>
<ul class="parameters"><li><code ng:non-bindable="">regexp<i>(optional)</i> {RegExp=} </code>
<p>New regexp to whitelist urls with.</p></li>
</ul>
<h4 id="Returns">Returns</h4>
<div class="returns"><code ng:non-bindable="">{RegExp|ng.$compileProvider}</code>
<p>Current RegExp if called without value or self for
chaining otherwise.</p></div>
</div>
</li>
</ul>
</div>
</div>

4
lib/angular/docs/partials/api/ng.$controller.html Normal file → Executable file
View file

@ -2,10 +2,10 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/controller.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p><code>$controller</code> service is responsible for instantiating controllers.</p>
<p>It's just simple call to <a href="api/AUTO.$injector"><code>$injector</code></a>, but extracted into
<p>It's just a simple call to <a href="api/AUTO.$injector"><code>$injector</code></a>, but extracted into
a service, so that one can override this service with <a href="https://gist.github.com/1649788">BC version</a>.</p></div>
<h2 id="Dependencies">Dependencies</h2>
<ul class="dependencies"><li><code ng:non-bindable=""><a href="api/ng.$injector">$injector</a></code>

View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/controller.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The <a href="api/ng.$controller"><code>$controller service</code></a> is used by Angular to create new
controllers.</p>

2
lib/angular/docs/partials/api/ng.$document.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/document.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>A <a href="api/angular.element"><code>jQuery (lite)</code></a>-wrapped reference to the browser's <code>window.document</code>
element.</p></div>
<h2 id="Dependencies">Dependencies</h2>

View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/exceptionHandler.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Any uncaught exception in angular expressions is delegated to this service.
The default implementation simply delegates to <code>$log.error</code> which logs it into
the browser console.</p>

2
lib/angular/docs/partials/api/ng.$filter.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/filter.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Filters are used for formatting data displayed to the user.</p>
<p>The general syntax in templates is as follows:</p>

4
lib/angular/docs/partials/api/ng.$filterProvider.html Normal file → Executable file
View file

@ -2,10 +2,10 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/filter.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Filters are just functions which transform input to an output. However filters need to be Dependency Injected. To
achieve this a filter definition consists of a factory function which is annotated with dependencies and is
responsible for creating a the filter function.</p>
responsible for creating a filter function.</p>
<pre class="prettyprint linenums">
// Filter registration

120
lib/angular/docs/partials/api/ng.$http.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/http.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The <code>$http</code> service is a core Angular service that facilitates communication with the remote
HTTP servers via browser's <a href="https://developer.mozilla.org/en/xmlhttprequest">XMLHttpRequest</a> object or via <a href="http://en.wikipedia.org/wiki/JSONP">JSONP</a>.</p>
@ -86,7 +86,7 @@ with name equal to the lower-cased http method name, e.g.
<code>$httpProvider.defaults.headers.get['My-Header']='value'</code>.</p>
<p>Additionally, the defaults can be set at runtime via the <code>$http.defaults</code> object in a similar
fassion as described above.</p>
fashion as described above.</p>
<h3>Transforming Requests and Responses</h3>
@ -107,10 +107,14 @@ JSON format.</li>
<li>if json response is detected, deserialize it using a JSON parser</li>
</ul>
<p>To override these transformation locally, specify transform functions as <code>transformRequest</code>
and/or <code>transformResponse</code> properties of the config object. To globally override the default
transforms, override the <code>$httpProvider.defaults.transformRequest</code> and
<code>$httpProvider.defaults.transformResponse</code> properties of the <code>$httpProvider</code>.</p>
<p>To globally augment or override the default transforms, modify the <code>$httpProvider.defaults.transformRequest</code> and
<code>$httpProvider.defaults.transformResponse</code> properties of the <code>$httpProvider</code>. These properties are by default an
array of transform functions, which allows you to <code>push</code> or <code>unshift</code> a new transformation function into the
transformation chain. You can also decide to completely override any default transformations by assigning your
transformation functions to these properties directly without the array wrapper.</p>
<p>Similarly, to locally override the request/response transforms, augment the <code>transformRequest</code> and/or
<code>transformResponse</code> properties of the config object passed into <code>$http</code>.</p>
<h3>Caching</h3>
@ -125,7 +129,93 @@ the same way that real requests are.</p>
cache, but the cache is not populated yet, only one request to the server will be made and
the remaining requests will be fulfilled using the response for the first request.</p>
<h3>Response interceptors</h3>
<p>A custom default cache built with $cacheFactory can be provided in $http.defaults.cache.
To skip it, set configuration property <code>cache</code> to <code>false</code>.</p>
<h3>Interceptors</h3>
<p>Before you start creating interceptors, be sure to understand the
<a href="api/ng.$q"><code>$q and deferred/promise APIs</code></a>.</p>
<p>For purposes of global error handling, authentication or any kind of synchronous or
asynchronous pre-processing of request or postprocessing of responses, it is desirable to be
able to intercept requests before they are handed to the server and
responses before they are handed over to the application code that
initiated these requests. The interceptors leverage the <a href="api/ng.$q"><code>promise APIs</code></a> to fulfil this need for both synchronous and asynchronous pre-processing.</p>
<p>The interceptors are service factories that are registered with the $httpProvider by
adding them to the <code>$httpProvider.interceptors</code> array. The factory is called and
injected with dependencies (if specified) and returns the interceptor.</p>
<p>There are two kinds of interceptors (and two kinds of rejection interceptors):</p>
<ul>
<li><code>request</code>: interceptors get called with http <code>config</code> object. The function is free to modify
the <code>config</code> or create a new one. The function needs to return the <code>config</code> directly or as a
promise.</li>
<li><code>requestError</code>: interceptor gets called when a previous interceptor threw an error or resolved
with a rejection.</li>
<li><code>response</code>: interceptors get called with http <code>response</code> object. The function is free to modify
the <code>response</code> or create a new one. The function needs to return the <code>response</code> directly or as a
promise.</li>
<li><code>responseError</code>: interceptor gets called when a previous interceptor threw an error or resolved
with a rejection.</li>
</ul>
<pre class="prettyprint linenums">
// register the interceptor as a service
$provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {
return {
// optional method
'request': function(config) {
// do something on success
return config || $q.when(config);
},
// optional method
'requestError': function(rejection) {
// do something on error
if (canRecover(rejection)) {
return responseOrNewPromise
}
return $q.reject(rejection);
},
// optional method
'response': function(response) {
// do something on success
return response || $q.when(response);
},
// optional method
'responseError': function(rejection) {
// do something on error
if (canRecover(rejection)) {
return responseOrNewPromise
}
return $q.reject(rejection);
};
}
});
$httpProvider.interceptors.push('myHttpInterceptor');
// register the interceptor via an anonymous factory
$httpProvider.interceptors.push(function($q, dependency1, dependency2) {
return {
'request': function(config) {
// same as above
},
'response': function(response) {
// same as above
}
});
</pre>
<h3>Response interceptors (DEPRECATED)</h3>
<p>Before you start creating interceptors, be sure to understand the
<a href="api/ng.$q"><code>$q and deferred/promise APIs</code></a>.</p>
@ -205,9 +295,10 @@ Angular will automatically strip the prefix before processing it as JSON.</p>
<p><a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">XSRF</a> is a technique by which
an unauthorized site can gain your user's private data. Angular provides following mechanism
to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie
called <code>XSRF-TOKEN</code> and sets it as the HTTP header <code>X-XSRF-TOKEN</code>. Since only JavaScript that
runs on your domain could read the cookie, your server can be assured that the XHR came from
JavaScript running on your domain. The header will not be set for cross-domain requests.</p>
(by default, <code>XSRF-TOKEN</code>) and sets it as an HTTP header (<code>X-XSRF-TOKEN</code>). Since only
JavaScript that runs on your domain could read the cookie, your server can be assured that
the XHR came from JavaScript running on your domain. The header will not be set for
cross-domain requests.</p>
<p>To take advantage of this, your server needs to set a token in a JavaScript readable session
cookie called <code>XSRF-TOKEN</code> on first HTTP GET request. On subsequent non-GET requests the
@ -215,7 +306,10 @@ server can verify that the cookie matches <code>X-XSRF-TOKEN</code> HTTP header,
that only JavaScript running on your domain could have read the token. The token must be
unique for each user and must be verifiable by the server (to prevent the JavaScript making
up its own tokens). We recommend that the token is a digest of your site's authentication
cookie with <a href="http://en.wikipedia.org/wiki/Rainbow_table">salt for added security</a>.</p></div>
cookie with <a href="http://en.wikipedia.org/wiki/Rainbow_table">salt for added security</a>.</p>
<p>The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName
properties of either $httpProvider.defaults, or the per-request config object.</p></div>
<h2 id="Dependencies">Dependencies</h2>
<ul class="dependencies"><li><code ng:non-bindable=""><a href="api/ng.$httpBackend">$httpBackend</a></code>
</li>
@ -244,6 +338,8 @@ processed. The object has following properties:</p>
<code>?key1=value1&amp;key2=value2</code> after the url. If the value is not a string, it will be JSONified.</li>
<li><strong>data</strong> <code>{string|Object}</code> Data to be sent as the request message data.</li>
<li><strong>headers</strong> <code>{Object}</code> Map of strings representing HTTP headers to send to the server.</li>
<li><strong>xsrfHeaderName</strong> <code>{string}</code> Name of HTTP header to populate with the XSRF token.</li>
<li><strong>xsrfCookieName</strong> <code>{string}</code> Name of cookie containing the XSRF token.</li>
<li><strong>transformRequest</strong> <code>{function(data, headersGetter)|Array.&lt;function(data, headersGetter)&gt;}</code>
transform function or an array of such functions. The transform function takes the http
request body and headers and returns its transformed (typically serialized) version.</li>
@ -453,5 +549,5 @@ requests. This is primarily meant to be used for debugging purposes.</p></div>
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-210" ng-eval-javascript="script.js-211"></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-210" ng-eval-javascript="script.js-211"></div></div>
</div>

2
lib/angular/docs/partials/api/ng.$httpBackend.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/httpBackend.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>HTTP backend used by the <a href="api/ng.$http"><code>service</code></a> that delegates to
XMLHttpRequest object or JSONP and deals with browser incompatibilities.</p>

2
lib/angular/docs/partials/api/ng.$interpolate.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/interpolate.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Compiles a string with markup into an interpolation function. This service is used by the
HTML <a href="api/ng.$compile"><code>$compile</code></a> service for data binding. See
<a href="api/ng.$interpolateProvider"><code>$interpolateProvider</code></a> for configuring the

View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/interpolate.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Used for configuring the interpolation markup. Defaults to <code>{{</code> and <code>}}</code>.</p></div>
<div class="member method"><h2 id="Methods">Methods</h2>
<ul class="methods"><li><h3 id="endSymbol">endSymbol(value)</h3>

2
lib/angular/docs/partials/api/ng.$locale.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/locale.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>$locale service provides localization rules for various Angular components. As of right now the
only public api is:</p>

2
lib/angular/docs/partials/api/ng.$location.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/location.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The $location service parses the URL in the browser address bar (based on the
<a href="https://developer.mozilla.org/en/window.location">window.location</a>) and makes the URL
available to your application. Changes to the URL in the address bar are reflected into

View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/location.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Use the <code>$locationProvider</code> to configure how the application deep linking paths are stored.</p></div>
<div class="member method"><h2 id="Methods">Methods</h2>
<ul class="methods"><li><h3 id="hashPrefix">hashPrefix(prefix)</h3>

4
lib/angular/docs/partials/api/ng.$log.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/log.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Simple service for logging. Default implementation writes the message
into the browser's console (if present).</p>
@ -56,5 +56,5 @@ into the browser's console (if present).</p>
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-214" ng-eval-javascript="script.js-213"></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-214" ng-eval-javascript="script.js-213"></div></div>
</div>

2
lib/angular/docs/partials/api/ng.$logProvider.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/log.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Use the <code>$logProvider</code> to configure how the application logs messages</p></div>
<div class="member method"><h2 id="Methods">Methods</h2>
<ul class="methods"><li><h3 id="debugEnabled">debugEnabled(flag)</h3>

19
lib/angular/docs/partials/api/ng.$parse.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/parse.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Converts Angular <a href="guide/expression">expression</a> into a function.</p>
<pre class="prettyprint linenums">
@ -27,12 +27,19 @@
<p>a function which represents the compiled expression:</p>
<ul>
<li><code>context</code>: an object against which any expressions embedded in the strings are evaluated
against (Topically a scope object).</li>
<li><p><code>locals</code>: local variables context object, useful for overriding values in <code>context</code>.</p>
<li><code>context</code> <code>{object}</code> an object against which any expressions embedded in the strings
are evaluated against (typically a scope object).</li>
<li><p><code>locals</code> <code>{object=}</code> local variables context object, useful for overriding values in
<code>context</code>.</p>
<p>The return function also has an <code>assign</code> property, if the expression is assignable, which
allows one to set values to expressions.</p></li>
<p>The returned function also has the following properties:</p>
<ul><li><code>literal</code> <code>{boolean}</code> whether the expression's top-level node is a JavaScript
literal.</li>
<li><code>constant</code> <code>{boolean}</code> whether the expression is made entirely of JavaScript
constant literals.</li>
<li><code>assign</code> <code>{?function(context, value)}</code> if the expression is assignable, this will be
set to a function to change its value on the given context.</li></ul></li>
</ul></div>
</div>
</div>

26
lib/angular/docs/partials/api/ng.$q.html Normal file → Executable file
View file

@ -2,14 +2,14 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/q.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>A promise/deferred implementation inspired by <a href="https://github.com/kriskowal/q">Kris Kowal's Q</a>.</p>
<p><a href="http://wiki.commonjs.org/wiki/Promises">The CommonJS Promise proposal</a> describes a promise as an
interface for interacting with an object that represents the result of an action that is
performed asynchronously, and may or may not be finished at any given point in time.</p>
<p>From the perspective of dealing with error handling, deferred and promise apis are to
<p>From the perspective of dealing with error handling, deferred and promise APIs are to
asynchronous programming what <code>try</code>, <code>catch</code> and <code>throw</code> keywords are to synchronous programming.</p>
<pre class="prettyprint linenums">
@ -44,7 +44,7 @@ asynchronous programming what <code>try</code>, <code>catch</code> and <code>thr
<p>At first it might not be obvious why this extra complexity is worth the trouble. The payoff
comes in the way of
<a href="https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md">guarantees that promise and deferred apis make</a>.</p>
<a href="https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md">guarantees that promise and deferred APIs make</a>.</p>
<p>Additionally the promise api allows for composition that is very hard to do with the
traditional callback (<a href="http://en.wikipedia.org/wiki/Continuation-passing_style">CPS</a>) approach.
@ -55,7 +55,7 @@ section on serial or parallel joining of promises.</p>
<p>A new instance of deferred is constructed by calling <code>$q.defer()</code>.</p>
<p>The purpose of the deferred object is to expose the associated Promise instance as well as apis
<p>The purpose of the deferred object is to expose the associated Promise instance as well as APIs
that can be used for signaling the successful or unsuccessful completion of the task.</p>
<p><strong>Methods</strong></p>
@ -102,7 +102,7 @@ to create a chain of promises:</p>
return result + 1;
});
// promiseB will be resolved immediately after promiseA is resolved and it's value will be
// promiseB will be resolved immediately after promiseA is resolved and its value will be
// the result of promiseA incremented by 1
</pre>
@ -127,7 +127,7 @@ all the important functionality needed for common async tasks.</p>
<h3>Testing</h3>
<pre class="prettyprint linenums">
it('should simulate promise', inject(function($q, $rootSCope) {
it('should simulate promise', inject(function($q, $rootScope) {
var deferred = $q.defer();
var promise = deferred.promise;
var resolvedValue;
@ -136,7 +136,7 @@ all the important functionality needed for common async tasks.</p>
expect(resolvedValue).toBeUndefined();
// Simulate resolving of promise
defered.resolve(123);
deferred.resolve(123);
// Note that the 'then' function does not get called synchronously.
// This is because we want the promise API to always be async, whether or not
// it got called synchronously or asynchronously.
@ -156,13 +156,13 @@ all the important functionality needed for common async tasks.</p>
<ul class="methods"><li><h3 id="all">all(promises)</h3>
<div class="all"><p>Combines multiple promises into a single promise that is resolved when all of the input
promises are resolved.</p><h4 id="Parameters">Parameters</h4>
<ul class="parameters"><li><code ng:non-bindable="">promises {Array.&lt;Promise&gt;} </code>
<p>An array of promises.</p></li>
<ul class="parameters"><li><code ng:non-bindable="">promises {Array.&lt;Promise&gt;|Object.&lt;Promise&gt;} </code>
<p>An array or hash of promises.</p></li>
</ul>
<h4 id="Returns">Returns</h4>
<div class="returns"><code ng:non-bindable="">{Promise}</code>
<p>Returns a single promise that will be resolved with an array of values,
each value coresponding to the promise at the same index in the <code>promises</code> array. If any of
<p>Returns a single promise that will be resolved with an array/hash of values,
each value corresponding to the promise at the same index/key in the <code>promises</code> array/hash. If any of
the promises is resolved with a rejection, this resulting promise will be resolved with the
same rejection.</p></div>
</div>
@ -210,7 +210,7 @@ current promise, you have to "rethrow" the error by returning a rejection constr
</li>
<li><h3 id="when">when(value)</h3>
<div class="when"><p>Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.
This is useful when you are dealing with on object that might or might not be a promise, or if
This is useful when you are dealing with an object that might or might not be a promise, or if
the promise comes from a source that can't be trusted.</p><h4 id="Parameters">Parameters</h4>
<ul class="parameters"><li><code ng:non-bindable="">value {*} </code>
<p>Value or a promise</p></li>
@ -218,7 +218,7 @@ the promise comes from a source that can't be trusted.</p><h4 id="Parameters">Pa
<h4 id="Returns">Returns</h4>
<div class="returns"><code ng:non-bindable="">{Promise}</code>
<p>Returns a single promise that will be resolved with an array of values,
each value coresponding to the promise at the same index in the <code>promises</code> array. If any of
each value corresponding to the promise at the same index in the <code>promises</code> array. If any of
the promises is resolved with a rejection, this resulting promise will be resolved with the
same rejection.</p></div>
</div>

2
lib/angular/docs/partials/api/ng.$rootElement.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><p>The root element of Angular application. This is either the element where <a href="api/ng.directive:ngApp"><code>ngApp</code></a> was declared or the element passed into
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/rootElement.js" class="improve-docs btn btn-primary">Improve this doc</a><p>The root element of Angular application. This is either the element where <a href="api/ng.directive:ngApp"><code>ngApp</code></a> was declared or the element passed into
<a href="api/angular.bootstrap"><code>angular.bootstrap</code></a>. The element represent the root element of application. It is also the
location where the applications <a href="api/AUTO.$injector"><code>$injector</code></a> service gets
published, it can be retrieved using <code>$rootElement.injector()</code>.</p></div>

106
lib/angular/docs/partials/api/ng.$rootScope.Scope.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(type in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/rootScope.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>A root scope can be retrieved using the <a href="api/ng.$rootScope"><code>$rootScope</code></a> key from the
<a href="api/AUTO.$injector"><code>$injector</code></a>. Child scopes are created using the
<a href="api/ng.$rootScope.Scope#$new"><code>$new()</code></a> method. (Most scopes are created automatically when
@ -10,25 +10,25 @@ compiled HTML template is executed.)</p>
<p>Here is a simple scope snippet to show how you can interact with the scope.
<pre class="prettyprint linenums">
angular.injector(['ng']).invoke(function($rootScope) {
var scope = $rootScope.$new();
scope.salutation = 'Hello';
scope.name = 'World';
expect(scope.greeting).toEqual(undefined);
var scope = $rootScope.$new();
scope.salutation = 'Hello';
scope.name = 'World';
scope.$watch('name', function() {
scope.greeting = scope.salutation + ' ' + scope.name + '!';
}); // initialize the watch
expect(scope.greeting).toEqual(undefined);
expect(scope.greeting).toEqual(undefined);
scope.name = 'Misko';
// still old value, since watches have not been called yet
expect(scope.greeting).toEqual(undefined);
scope.$watch('name', function() {
scope.greeting = scope.salutation + ' ' + scope.name + '!';
}); // initialize the watch
expect(scope.greeting).toEqual(undefined);
scope.name = 'Misko';
// still old value, since watches have not been called yet
expect(scope.greeting).toEqual(undefined);
scope.$digest(); // fire all the watches
expect(scope.greeting).toEqual('Hello Misko!');
scope.$digest(); // fire all the watches
expect(scope.greeting).toEqual('Hello Misko!');
});
</pre>
<h3>Inheritance</h3>
@ -117,7 +117,7 @@ registered <a href="api/ng.$rootScope.Scope#$on"><code>ng.$rootScope.Scope#$on</
Afterwards, the event propagates to all direct and indirect scopes of the current scope and
calls all registered listeners along the way. The event cannot be canceled.</p>
<p>Any exception emmited from the <a href="api/ng.$rootScope.Scope#$on"><code>listeners</code></a> will be passed
<p>Any exception emitted from the <a href="api/ng.$rootScope.Scope#$on"><code>listeners</code></a> will be passed
onto the <a href="api/ng.$exceptionHandler"><code>$exceptionHandler</code></a> service.</p><h4 id="Parameters">Parameters</h4>
<ul class="parameters"><li><code ng:non-bindable="">name {string} </code>
<p>Event name to emit.</p></li>
@ -279,15 +279,7 @@ state.</p></li>
</li>
<li><h3 id="$on">$on(name, listener)</h3>
<div class="$on"><p>Listens on events of a given type. See <a href="api/ng.$rootScope.Scope#$emit"><code>$emit</code></a> for discussion of
event life cycle.</p><h4 id="Parameters">Parameters</h4>
<ul class="parameters"><li><code ng:non-bindable="">name {string} </code>
<p>Event name to listen on.</p></li>
<li><code ng:non-bindable="">listener {function(event)} </code>
<p>Function to call when the event is emitted.</p></li>
</ul>
<h4 id="Returns">Returns</h4>
<div class="returns"><code ng:non-bindable="">{function()}</code>
<p>Returns a deregistration function for this listener.</p>
event life cycle.</p>
<p>The event listener function format is: <code>function(event, args...)</code>. The <code>event</code> object
passed into the listener has the following attributes:</p>
@ -300,7 +292,15 @@ passed into the listener has the following attributes:</p>
propagation (available only for events that were <code>$emit</code>-ed).</li>
<li><code>preventDefault</code> - <code>{function}</code>: calling <code>preventDefault</code> sets <code>defaultPrevented</code> flag to true.</li>
<li><code>defaultPrevented</code> - <code>{boolean}</code>: true if <code>preventDefault</code> was called.</li>
</ul></div>
</ul><h4 id="Parameters">Parameters</h4>
<ul class="parameters"><li><code ng:non-bindable="">name {string} </code>
<p>Event name to listen on.</p></li>
<li><code ng:non-bindable="">listener {function(event, args...)} </code>
<p>Function to call when the event is emitted.</p></li>
</ul>
<h4 id="Returns">Returns</h4>
<div class="returns"><code ng:non-bindable="">{function()}</code>
<p>Returns a deregistration function for this listener.</p></div>
</div>
</li>
<li><h3 id="$watch">$watch(watchExpression, listener, objectEquality)</h3>
@ -379,6 +379,58 @@ the <code>watchExpression</code> changes.</p>
<p>Returns a deregistration function for this listener.</p></div>
</div>
</li>
<li><h3 id="$watchCollection">$watchCollection(obj, listener)</h3>
<div class="$watchcollection"><p>Shallow watches the properties of an object and fires whenever any of the properties change
(for arrays this implies watching the array items, for object maps this implies watching the properties).
If a change is detected the <code>listener</code> callback is fired.</p>
<ul>
<li>The <code>obj</code> collection is observed via standard $watch operation and is examined on every call to $digest() to
see if any items have been added, removed, or moved.</li>
<li>The <code>listener</code> is called whenever anything within the <code>obj</code> has changed. Examples include adding new items
into the object or array, removing and moving items around.</li>
</ul>
<h4>Example</h4>
<pre class="prettyprint linenums">
$scope.names = ['igor', 'matias', 'misko', 'james'];
$scope.dataCount = 4;
$scope.$watchCollection('names', function(newNames, oldNames) {
$scope.dataCount = newNames.length;
});
expect($scope.dataCount).toEqual(4);
$scope.$digest();
//still at 4 ... no changes
expect($scope.dataCount).toEqual(4);
$scope.names.pop();
$scope.$digest();
//now there's been a change
expect($scope.dataCount).toEqual(3);
</pre><h4 id="Parameters">Parameters</h4>
<ul class="parameters"><li><code ng:non-bindable="">obj {string|Function(scope)} </code>
<p>Evaluated as <a href="guide/expression">expression</a>. The expression value
should evaluate to an object or an array which is observed on each
<a href="api/ng.$rootScope.Scope#$digest"><code>$digest</code></a> cycle. Any shallow change within the collection will trigger
a call to the <code>listener</code>.</p></li>
<li><code ng:non-bindable="">listener {function(newCollection, oldCollection, scope)} </code>
<p>a callback function that is fired with both
the <code>newCollection</code> and <code>oldCollection</code> as parameters.
The <code>newCollection</code> object is the newly modified data obtained from the <code>obj</code> expression and the
<code>oldCollection</code> object is a copy of the former collection data.
The <code>scope</code> refers to the current scope.</p></li>
</ul>
<h4 id="Returns">Returns</h4>
<div class="returns"><code ng:non-bindable="">{function()}</code>
<p>Returns a de-registration function for this listener. When the de-registration function is executed
then the internal watch operation is terminated.</p></div>
</div>
</li>
</ul>
</div>
<div class="member property"><h2 id="Properties">Properties</h2>

2
lib/angular/docs/partials/api/ng.$rootScope.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/rootScope.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Every application has a single root <a href="api/ng.$rootScope.Scope"><code>scope</code></a>.
All other scopes are child scopes of the root scope. Scopes provide mechanism for watching the model and provide
event processing life-cycle. See <a href="guide/scope">developer guide on scopes</a>.</p></div>

View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/rootScope.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Provider for the $rootScope service.</p></div>
<div class="member method"><h2 id="Methods">Methods</h2>
<ul class="methods"><li><h3 id="digestTtl">digestTtl(limit)</h3>

12
lib/angular/docs/partials/api/ng.$route.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/route.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Is used for deep-linking URLs to controllers and views (HTML partials).
It watches <code>$location.url()</code> and tries to map the path to an existing route definition.</p>
@ -93,10 +93,12 @@ to instantiate the controller and render the view.</p><div class="inline"><h4 id
<div class="target-">root scope</div>
</div>
<h4 id="Parameters">Parameters</h4>
<ul class="parameters"><li><code ng:non-bindable="">current {Route} </code>
<ul class="parameters"><li><code ng:non-bindable="">angularEvent {Object} </code>
<p>Synthetic event object.</p></li>
<li><code ng:non-bindable="">current {Route} </code>
<p>Current route information.</p></li>
<li><code ng:non-bindable="">previous {Route} </code>
<p>Previous route information.</p></li>
<li><code ng:non-bindable="">previous {Route|Undefined} </code>
<p>Previous route information, or undefined if current is first route entered.</p></li>
</ul>
</div>
</li>
@ -219,5 +221,5 @@ to get it working on jsfiddle as well.</p>
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="ngView" ng-set-html="index.html-215" ng-eval-javascript="script.js-216"></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="ngView" ng-set-html="index.html-215" ng-eval-javascript="script.js-216"></div></div>
</div>

2
lib/angular/docs/partials/api/ng.$routeParams.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/routeParams.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Current set of route parameters. The route parameters are a combination of the
<a href="api/ng.$location"><code>$location</code></a> <code>search()</code>, and <code>path()</code>. The <code>path</code> parameters
are extracted when the <a href="api/ng.$route"><code>$route</code></a> path is matched.</p>

24
lib/angular/docs/partials/api/ng.$routeProvider.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/route.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Used for configuring routes. See <a href="api/ng.$route"><code>$route</code></a> for an example.</p></div>
<div class="member method"><h2 id="Methods">Methods</h2>
<ul class="methods"><li><h3 id="otherwise">otherwise(params)</h3>
@ -24,9 +24,21 @@ contains redundant trailing slash or is missing one, the route will still match
<code>$location.path</code> will be updated to add or drop the trailing slash to exactly match the
route definition.</p>
<p><code>path</code> can contain named groups starting with a colon (<code>:name</code>). All characters up to the
next slash are matched and stored in <code>$routeParams</code> under the given <code>name</code> when the route
matches.</p></li>
<ul>
<li><code>path</code> can contain named groups starting with a colon (<code>:name</code>). All characters up
to the next slash are matched and stored in <code>$routeParams</code> under the given <code>name</code>
when the route matches.</li>
<li><code>path</code> can contain named groups starting with a star (<code>*name</code>). All characters are
eagerly stored in <code>$routeParams</code> under the given <code>name</code> when the route matches.</li>
</ul>
<p>For example, routes like <code>/color/:color/largecode/*largecode/edit</code> will match
<code>/color/brown/largecode/code/with/slashs/edit</code> and extract:</p>
<ul>
<li><code>color: brown</code></li>
<li><code>largecode: code/with/slashs</code>.</li>
</ul></li>
<li><code ng:non-bindable="">route {Object} </code>
<p>Mapping information to be assigned to <code>$route.current</code> on route
match.</p>
@ -80,6 +92,10 @@ changes.</p>
<p>If the option is set to <code>false</code> and url in the browser changes, then
<code>$routeUpdate</code> event is broadcasted on the root scope.</p></li>
<li><p><code>[caseInsensitiveMatch=false]</code> - {boolean=} - match routes without being case sensitive</p>
<p>If the option is set to <code>true</code>, then the particular route can be matched without being
case sensitive</p></li>
</ul></li>
</ul>
<h4 id="Returns">Returns</h4>

2
lib/angular/docs/partials/api/ng.$templateCache.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/cacheFactory.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Cache used for storing html templates.</p>
<p>See <a href="api/ng.$cacheFactory"><code>$cacheFactory</code></a>.</p></div>

2
lib/angular/docs/partials/api/ng.$timeout.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/timeout.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Angular's wrapper for <code>window.setTimeout</code>. The <code>fn</code> function is wrapped into a try/catch
block and delegates any exceptions to
<a href="api/ng.$exceptionHandler"><code>$exceptionHandler</code></a> service.</p>

6
lib/angular/docs/partials/api/ng.$window.html Normal file → Executable file
View file

@ -2,11 +2,11 @@
<span class="hint">(service in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/window.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>A reference to the browser's <code>window</code> object. While <code>window</code>
is globally available in JavaScript, it causes testability problems, because
it is a global variable. In angular we always refer to it through the
<code>$window</code> service, so it may be overriden, removed or mocked for testing.</p>
<code>$window</code> service, so it may be overridden, removed or mocked for testing.</p>
<p>All expressions are evaluated with respect to current scope so they don't
suffer from window globality.</p></div>
@ -26,5 +26,5 @@ suffer from window globality.</p></div>
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-218" ng-eval-javascript=""></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-218" ng-eval-javascript=""></div></div>
</div>

6
lib/angular/docs/partials/api/ng.directive:a.html Normal file → Executable file
View file

@ -2,15 +2,15 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/a.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Modifies the default behavior of html A tag, so that the default action is prevented when href
attribute is empty.</p>
<p>The reasoning for this change is to allow easy creation of action links with <code>ngClick</code> directive
without changing the location or causing page reloads, e.g.:
<a href="" ng-click="model.$save()">Save</a></p></div>
<code>&lt;a href="" ng-click="model.$save()"&gt;Save&lt;/a&gt;</code></p></div>
<h2 id="Usage">Usage</h2>
<div class="usage">as element (see <a href="guide/ie">IE restrictions</a>)<pre class="prettyprint linenums">&lt;a&gt;
<div class="usage"><p>This directive can be used as custom element, but we aware of <a href="guide/ie">IE restrictions</a>.</p>as element:<pre class="prettyprint linenums">&lt;a&gt;
&lt;/a&gt;</pre>
</div>
</div>

View file

@ -2,7 +2,7 @@
<span class="hint">(type in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/form.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p><code>FormController</code> keeps track of all its controls and nested forms as well as state of them,
such as being valid/invalid or dirty/pristine.</p>

6
lib/angular/docs/partials/api/ng.directive:form.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/form.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Directive that instantiates
<a href="api/ng.directive:form.FormController"><code>FormController</code></a>.</p>
@ -57,7 +57,7 @@ hitting enter in any of the input fields will trigger the click handler on the <
input[type=submit] (<code>ngClick</code>) <em>and</em> a submit handler on the enclosing form (<code>ngSubmit</code>)</li>
</ul></div>
<h2 id="Usage">Usage</h2>
<div class="usage">as element (see <a href="guide/ie">IE restrictions</a>)<pre class="prettyprint linenums">&lt;form
<div class="usage"><p>This directive can be used as custom element, but we aware of <a href="guide/ie">IE restrictions</a>.</p>as element:<pre class="prettyprint linenums">&lt;form
[name="{string}"]&gt;
&lt;/form&gt;</pre>
<h3 id="Parameters">Parameters</h3>
@ -108,5 +108,5 @@ related scope, under this name.</p></li>
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-101" ng-eval-javascript="script.js-100"></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-101" ng-eval-javascript="script.js-100"></div></div>
</div>

View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/input.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>HTML checkbox.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">&lt;input type="checkbox"
@ -27,10 +27,10 @@ interaction with the input element.</p></li>
</div>
<h2 id="Example">Example</h2>
<div class="example"><h4>Source</h4>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-125" source-edit-css="" source-edit-js="script.js-124" source-edit-unit="" source-edit-scenario="scenario.js-126"></div>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-134" source-edit-css="" source-edit-js="script.js-133" source-edit-unit="" source-edit-scenario="scenario.js-135"></div>
<div class="tabbable"><div class="tab-pane" title="index.html">
<pre class="prettyprint linenums" ng-set-text="index.html-125" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-125">
<pre class="prettyprint linenums" ng-set-text="index.html-134" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-134">
<form name="myForm" ng-controller="Ctrl">
Value1: <input type="checkbox" ng-model="value1"> <br/>
@ -42,8 +42,8 @@ interaction with the input element.</p></li>
</script>
</div>
<div class="tab-pane" title="script.js">
<pre class="prettyprint linenums" ng-set-text="script.js-124"></pre>
<script type="text/ng-template" id="script.js-124">
<pre class="prettyprint linenums" ng-set-text="script.js-133"></pre>
<script type="text/ng-template" id="script.js-133">
function Ctrl($scope) {
$scope.value1 = true;
$scope.value2 = 'YES'
@ -51,8 +51,8 @@ interaction with the input element.</p></li>
</script>
</div>
<div class="tab-pane" title="End to end test">
<pre class="prettyprint linenums" ng-set-text="scenario.js-126"></pre>
<script type="text/ng-template" id="scenario.js-126">
<pre class="prettyprint linenums" ng-set-text="scenario.js-135"></pre>
<script type="text/ng-template" id="scenario.js-135">
it('should change state', function() {
expect(binding('value1')).toEqual('true');
expect(binding('value2')).toEqual('YES');
@ -65,5 +65,5 @@ interaction with the input element.</p></li>
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-125" ng-eval-javascript="script.js-124"></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-134" ng-eval-javascript="script.js-133"></div></div>
</div>

View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/input.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Text input with email validation. Sets the <code>email</code> validation error key if not a valid email
address.</p></div>
<h2 id="Usage">Usage</h2>
@ -39,10 +39,10 @@ patterns defined as scope expressions.</p></li>
</div>
<h2 id="Example">Example</h2>
<div class="example"><h4>Source</h4>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-119" source-edit-css="" source-edit-js="script.js-118" source-edit-unit="" source-edit-scenario="scenario.js-120"></div>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-128" source-edit-css="" source-edit-js="script.js-127" source-edit-unit="" source-edit-scenario="scenario.js-129"></div>
<div class="tabbable"><div class="tab-pane" title="index.html">
<pre class="prettyprint linenums" ng-set-text="index.html-119" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-119">
<pre class="prettyprint linenums" ng-set-text="index.html-128" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-128">
<form name="myForm" ng-controller="Ctrl">
Email: <input type="email" name="input" ng-model="text" required>
@ -60,16 +60,16 @@ patterns defined as scope expressions.</p></li>
</script>
</div>
<div class="tab-pane" title="script.js">
<pre class="prettyprint linenums" ng-set-text="script.js-118"></pre>
<script type="text/ng-template" id="script.js-118">
<pre class="prettyprint linenums" ng-set-text="script.js-127"></pre>
<script type="text/ng-template" id="script.js-127">
function Ctrl($scope) {
$scope.text = 'me@example.com';
}
</script>
</div>
<div class="tab-pane" title="End to end test">
<pre class="prettyprint linenums" ng-set-text="scenario.js-120"></pre>
<script type="text/ng-template" id="scenario.js-120">
<pre class="prettyprint linenums" ng-set-text="scenario.js-129"></pre>
<script type="text/ng-template" id="scenario.js-129">
it('should initialize to model', function() {
expect(binding('text')).toEqual('me@example.com');
expect(binding('myForm.input.$valid')).toEqual('true');
@ -88,5 +88,5 @@ patterns defined as scope expressions.</p></li>
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-119" ng-eval-javascript="script.js-118"></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-128" ng-eval-javascript="script.js-127"></div></div>
</div>

20
lib/angular/docs/partials/api/ng.directive:input.html Normal file → Executable file
View file

@ -2,11 +2,11 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/input.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>HTML input element control with angular data-binding. Input control follows HTML5 input types
and polyfills the HTML5 validation behavior for older browsers.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage">as element (see <a href="guide/ie">IE restrictions</a>)<pre class="prettyprint linenums">&lt;input
<div class="usage"><p>This directive can be used as custom element, but we aware of <a href="guide/ie">IE restrictions</a>.</p>as element:<pre class="prettyprint linenums">&lt;input
ngModel="{string}"
[name="{string}"]
[required]
@ -42,10 +42,10 @@ interaction with the input element.</p></li>
</div>
<h2 id="Example">Example</h2>
<div class="example"><h4>Source</h4>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-128" source-edit-css="" source-edit-js="script.js-127" source-edit-unit="" source-edit-scenario="scenario.js-129"></div>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-137" source-edit-css="" source-edit-js="script.js-136" source-edit-unit="" source-edit-scenario="scenario.js-138"></div>
<div class="tabbable"><div class="tab-pane" title="index.html">
<pre class="prettyprint linenums" ng-set-text="index.html-128" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-128">
<pre class="prettyprint linenums" ng-set-text="index.html-137" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-137">
<div ng-controller="Ctrl">
<form name="myForm">
@ -73,16 +73,16 @@ interaction with the input element.</p></li>
</script>
</div>
<div class="tab-pane" title="script.js">
<pre class="prettyprint linenums" ng-set-text="script.js-127"></pre>
<script type="text/ng-template" id="script.js-127">
<pre class="prettyprint linenums" ng-set-text="script.js-136"></pre>
<script type="text/ng-template" id="script.js-136">
function Ctrl($scope) {
$scope.user = {name: 'guest', last: 'visitor'};
}
</script>
</div>
<div class="tab-pane" title="End to end test">
<pre class="prettyprint linenums" ng-set-text="scenario.js-129"></pre>
<script type="text/ng-template" id="scenario.js-129">
<pre class="prettyprint linenums" ng-set-text="scenario.js-138"></pre>
<script type="text/ng-template" id="scenario.js-138">
it('should initialize to model', function() {
expect(binding('user')).toEqual('{"name":"guest","last":"visitor"}');
expect(binding('myForm.userName.$valid')).toEqual('true');
@ -122,5 +122,5 @@ interaction with the input element.</p></li>
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-128" ng-eval-javascript="script.js-127"></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-137" ng-eval-javascript="script.js-136"></div></div>
</div>

View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/input.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Text input with number validation and transformation. Sets the <code>number</code> validation
error if not a valid number.</p></div>
<h2 id="Usage">Usage</h2>
@ -49,10 +49,10 @@ interaction with the input element.</p></li>
</div>
<h2 id="Example">Example</h2>
<div class="example"><h4>Source</h4>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-113" source-edit-css="" source-edit-js="script.js-112" source-edit-unit="" source-edit-scenario="scenario.js-114"></div>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-122" source-edit-css="" source-edit-js="script.js-121" source-edit-unit="" source-edit-scenario="scenario.js-123"></div>
<div class="tabbable"><div class="tab-pane" title="index.html">
<pre class="prettyprint linenums" ng-set-text="index.html-113" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-113">
<pre class="prettyprint linenums" ng-set-text="index.html-122" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-122">
<form name="myForm" ng-controller="Ctrl">
Number: <input type="number" name="input" ng-model="value"
@ -70,16 +70,16 @@ interaction with the input element.</p></li>
</script>
</div>
<div class="tab-pane" title="script.js">
<pre class="prettyprint linenums" ng-set-text="script.js-112"></pre>
<script type="text/ng-template" id="script.js-112">
<pre class="prettyprint linenums" ng-set-text="script.js-121"></pre>
<script type="text/ng-template" id="script.js-121">
function Ctrl($scope) {
$scope.value = 12;
}
</script>
</div>
<div class="tab-pane" title="End to end test">
<pre class="prettyprint linenums" ng-set-text="scenario.js-114"></pre>
<script type="text/ng-template" id="scenario.js-114">
<pre class="prettyprint linenums" ng-set-text="scenario.js-123"></pre>
<script type="text/ng-template" id="scenario.js-123">
it('should initialize to model', function() {
expect(binding('value')).toEqual('12');
expect(binding('myForm.input.$valid')).toEqual('true');
@ -99,5 +99,5 @@ interaction with the input element.</p></li>
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-113" ng-eval-javascript="script.js-112"></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-122" ng-eval-javascript="script.js-121"></div></div>
</div>

View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/input.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>HTML radio button.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">&lt;input type="radio"
@ -24,10 +24,10 @@ interaction with the input element.</p></li>
</div>
<h2 id="Example">Example</h2>
<div class="example"><h4>Source</h4>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-122" source-edit-css="" source-edit-js="script.js-121" source-edit-unit="" source-edit-scenario="scenario.js-123"></div>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-131" source-edit-css="" source-edit-js="script.js-130" source-edit-unit="" source-edit-scenario="scenario.js-132"></div>
<div class="tabbable"><div class="tab-pane" title="index.html">
<pre class="prettyprint linenums" ng-set-text="index.html-122" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-122">
<pre class="prettyprint linenums" ng-set-text="index.html-131" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-131">
<form name="myForm" ng-controller="Ctrl">
<input type="radio" ng-model="color" value="red"> Red <br/>
@ -38,16 +38,16 @@ interaction with the input element.</p></li>
</script>
</div>
<div class="tab-pane" title="script.js">
<pre class="prettyprint linenums" ng-set-text="script.js-121"></pre>
<script type="text/ng-template" id="script.js-121">
<pre class="prettyprint linenums" ng-set-text="script.js-130"></pre>
<script type="text/ng-template" id="script.js-130">
function Ctrl($scope) {
$scope.color = 'blue';
}
</script>
</div>
<div class="tab-pane" title="End to end test">
<pre class="prettyprint linenums" ng-set-text="scenario.js-123"></pre>
<script type="text/ng-template" id="scenario.js-123">
<pre class="prettyprint linenums" ng-set-text="scenario.js-132"></pre>
<script type="text/ng-template" id="scenario.js-132">
it('should change state', function() {
expect(binding('color')).toEqual('blue');
@ -57,5 +57,5 @@ interaction with the input element.</p></li>
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-122" ng-eval-javascript="script.js-121"></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-131" ng-eval-javascript="script.js-130"></div></div>
</div>

View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/input.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Standard HTML text input with angular data binding.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">&lt;input type="text"
@ -46,10 +46,10 @@ input.</p></li>
</div>
<h2 id="Example">Example</h2>
<div class="example"><h4>Source</h4>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-110" source-edit-css="" source-edit-js="script.js-109" source-edit-unit="" source-edit-scenario="scenario.js-111"></div>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-119" source-edit-css="" source-edit-js="script.js-118" source-edit-unit="" source-edit-scenario="scenario.js-120"></div>
<div class="tabbable"><div class="tab-pane" title="index.html">
<pre class="prettyprint linenums" ng-set-text="index.html-110" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-110">
<pre class="prettyprint linenums" ng-set-text="index.html-119" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-119">
<form name="myForm" ng-controller="Ctrl">
Single word: <input type="text" name="input" ng-model="text"
@ -68,8 +68,8 @@ input.</p></li>
</script>
</div>
<div class="tab-pane" title="script.js">
<pre class="prettyprint linenums" ng-set-text="script.js-109"></pre>
<script type="text/ng-template" id="script.js-109">
<pre class="prettyprint linenums" ng-set-text="script.js-118"></pre>
<script type="text/ng-template" id="script.js-118">
function Ctrl($scope) {
$scope.text = 'guest';
$scope.word = /^\s*\w*\s*$/;
@ -77,8 +77,8 @@ input.</p></li>
</script>
</div>
<div class="tab-pane" title="End to end test">
<pre class="prettyprint linenums" ng-set-text="scenario.js-111"></pre>
<script type="text/ng-template" id="scenario.js-111">
<pre class="prettyprint linenums" ng-set-text="scenario.js-120"></pre>
<script type="text/ng-template" id="scenario.js-120">
it('should initialize to model', function() {
expect(binding('text')).toEqual('guest');
expect(binding('myForm.input.$valid')).toEqual('true');
@ -103,5 +103,5 @@ input.</p></li>
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-110" ng-eval-javascript="script.js-109"></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-119" ng-eval-javascript="script.js-118"></div></div>
</div>

View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/input.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Text input with URL validation. Sets the <code>url</code> validation error key if the content is not a
valid URL.</p></div>
<h2 id="Usage">Usage</h2>
@ -43,10 +43,10 @@ interaction with the input element.</p></li>
</div>
<h2 id="Example">Example</h2>
<div class="example"><h4>Source</h4>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-116" source-edit-css="" source-edit-js="script.js-115" source-edit-unit="" source-edit-scenario="scenario.js-117"></div>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-125" source-edit-css="" source-edit-js="script.js-124" source-edit-unit="" source-edit-scenario="scenario.js-126"></div>
<div class="tabbable"><div class="tab-pane" title="index.html">
<pre class="prettyprint linenums" ng-set-text="index.html-116" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-116">
<pre class="prettyprint linenums" ng-set-text="index.html-125" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-125">
<form name="myForm" ng-controller="Ctrl">
URL: <input type="url" name="input" ng-model="text" required>
@ -64,16 +64,16 @@ interaction with the input element.</p></li>
</script>
</div>
<div class="tab-pane" title="script.js">
<pre class="prettyprint linenums" ng-set-text="script.js-115"></pre>
<script type="text/ng-template" id="script.js-115">
<pre class="prettyprint linenums" ng-set-text="script.js-124"></pre>
<script type="text/ng-template" id="script.js-124">
function Ctrl($scope) {
$scope.text = 'http://google.com';
}
</script>
</div>
<div class="tab-pane" title="End to end test">
<pre class="prettyprint linenums" ng-set-text="scenario.js-117"></pre>
<script type="text/ng-template" id="scenario.js-117">
<pre class="prettyprint linenums" ng-set-text="scenario.js-126"></pre>
<script type="text/ng-template" id="scenario.js-126">
it('should initialize to model', function() {
expect(binding('text')).toEqual('http://google.com');
expect(binding('myForm.input.$valid')).toEqual('true');
@ -92,5 +92,5 @@ interaction with the input element.</p></li>
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-116" ng-eval-javascript="script.js-115"></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-125" ng-eval-javascript="script.js-124"></div></div>
</div>

View file

@ -0,0 +1,131 @@
<h1><code ng:non-bindable="">ngAnimate</code>
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/animator.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The <code>ngAnimate</code> directive works as an attribute that is attached alongside pre-existing directives.
It effects how the directive will perform DOM manipulation. This allows for complex animations to take place while
without burduning the directive which uses the animation with animation details. The built dn directives
<code>ngRepeat</code>, <code>ngInclude</code>, <code>ngSwitch</code>, <code>ngShow</code>, <code>ngHide</code> and <code>ngView</code> already accept <code>ngAnimate</code> directive.
Custom directives can take advantage of animation through <a href="api/ng.$animator"><code>$animator service</code></a>.</p>
<p>Below is a more detailed breakdown of the supported callback events provided by pre-exisitng ng directives:</p>
<ul>
<li><a href="api/ng.directive:ngRepeat#animations"><code>ngRepeat</code></a> — enter, leave and move</li>
<li><a href="api/ng.directive:ngView#animations"><code>ngView</code></a> — enter and leave</li>
<li><a href="api/ng.directive:ngInclude#animations"><code>ngInclude</code></a> — enter and leave</li>
<li><a href="api/ng.directive:ngSwitch#animations"><code>ngSwitch</code></a> — enter and leave</li>
<li><a href="api/ng.directive:ngShow#animations"><code>ngShow &amp; ngHide</code></a> - show and hide respectively</li>
</ul>
<p>You can find out more information about animations upon visiting each directive page.</p>
<p>Below is an example of a directive that makes use of the ngAnimate attribute:</p>
<pre class="prettyprint linenums">
&lt;!-- you can also use data-ng-animate, ng:animate or x-ng-animate as well --&gt;
&lt;ANY ng-directive ng-animate="{event1: 'animation-name', event2: 'animation-name-2'}"&gt;&lt;/ANY&gt;
&lt;!-- you can also use a short hand --&gt;
&lt;ANY ng-directive ng-animate=" 'animation' "&gt;&lt;/ANY&gt;
&lt;!-- which expands to --&gt;
&lt;ANY ng-directive ng-animate="{ enter: 'animation-enter', leave: 'animation-leave', ...}"&gt;&lt;/ANY&gt;
&lt;!-- keep in mind that ng-animate can take expressions --&gt;
&lt;ANY ng-directive ng-animate=" computeCurrentAnimation() "&gt;&lt;/ANY&gt;
</pre>
<p>The <code>event1</code> and <code>event2</code> attributes refer to the animation events specific to the directive that has been assigned.</p>
<h4>CSS-defined Animations</h4>
<p>By default, ngAnimate attaches two CSS3 classes per animation event to the DOM element to achieve the animation.
This is up to you, the developer, to ensure that the animations take place using cross-browser CSS3 transitions.
All that is required is the following CSS code:</p>
<pre class="prettyprint linenums">
&lt;style type="text/css"&gt;
/&#42;
The animate-enter prefix is the event name that you
have provided within the ngAnimate attribute.
&#42;/
.animate-enter-setup {
-webkit-transition: 1s linear all; /&#42; Safari/Chrome &#42;/
-moz-transition: 1s linear all; /&#42; Firefox &#42;/
-ms-transition: 1s linear all; /&#42; IE10 &#42;/
-o-transition: 1s linear all; /&#42; Opera &#42;/
transition: 1s linear all; /&#42; Future Browsers &#42;/
/&#42; The animation preparation code &#42;/
opacity: 0;
}
/&#42;
Keep in mind that you want to combine both CSS
classes together to avoid any CSS-specificity
conflicts
&#42;/
.animate-enter-setup.animate-enter-start {
/&#42; The animation code itself &#42;/
opacity: 1;
}
&lt;/style&gt;
&lt;div ng-directive ng-animate="{enter: 'animate-enter'}"&gt;&lt;/div&gt;
</pre>
<p>Upon DOM mutation, the setup class is added first, then the browser is allowed to reflow the content and then,
the start class is added to trigger the animation. The ngAnimate directive will automatically extract the duration
of the animation to determine when the animation ends. Once the animation is over then both CSS classes will be
removed from the DOM. If a browser does not support CSS transitions then the animation will start and end
immediately resulting in a DOM element that is at it's final state. This final state is when the DOM element
has no CSS animation classes surrounding it.</p>
<h4>JavaScript-defined Animations</h4>
<p>In the event that you do not want to use CSS3 animations or if you wish to offer animations to browsers that do not
yet support them, then you can make use of JavaScript animations defined inside ngModule.</p>
<pre class="prettyprint linenums">
var ngModule = angular.module('YourApp', []);
ngModule.animation('animate-enter', function() {
return {
setup : function(element) {
//prepare the element for animation
element.css({ 'opacity': 0 });
var memo = "..."; //this value is passed to the start function
return memo;
},
start : function(element, done, memo) {
//start the animation
element.animate({
'opacity' : 1
}, function() {
//call when the animation is complete
done()
});
}
}
});
</pre>
<p>As you can see, the JavaScript code follows a similar template to the CSS3 animations. Once defined, the animation
can be used in the same way with the ngAnimate attribute. Keep in mind that, when using JavaScript-enabled
animations, ngAnimate will also add in the same CSS classes that CSS-enabled animations do (even if you're using
JavaScript animations) to animated the element, but it will not attempt to find any CSS3 transition duration value.
It will instead close off the animation once the provided done function is executed. So it's important that you
make sure your animations remember to fire off the done function once the animations are complete.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage">as attribute<pre class="prettyprint linenums">&lt;ANY ng-animate="{expression}"&gt;
...
&lt;/ANY&gt;</pre>
as class<pre class="prettyprint linenums">&lt;ANY class="ng-animate: {expression};"&gt;
...
&lt;/ANY&gt;</pre>
<h3 id="Parameters">Parameters</h3>
<ul class="parameters"><li><code ng:non-bindable="">ngAnimate {expression} </code>
<p>Used to configure the DOM manipulation animations.</p></li>
</ul>
</div>
</div>

6
lib/angular/docs/partials/api/ng.directive:ngApp.html Normal file → Executable file
View file

@ -2,11 +2,11 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Use this directive to auto-bootstrap on application. Only
one directive can be used per HTML document. The directive
designates the root of the application and is typically placed
ot the root of the page.</p>
at the root of the page.</p>
<p>In the example below if the <code>ngApp</code> directive would not be placed
on the <code>html</code> element then the document would not be compiled
@ -23,7 +23,7 @@ and the <code>{{ 1+2 }}</code> would not be resolved to <code>3</code>.</p>
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-82" ng-eval-javascript=""></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-82" ng-eval-javascript=""></div></div>
<h2 id="Usage">Usage</h2>
<div class="usage">as attribute<pre class="prettyprint linenums">&lt;ANY ng-app="{angular.Module}"&gt;
...

6
lib/angular/docs/partials/api/ng.directive:ngBind.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/ngBind.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The <code>ngBind</code> attribute tells Angular to replace the text content of the specified HTML element
with the value of a given expression, and to update the text content when the value of that
expression changes.</p>
@ -10,7 +10,7 @@ expression changes.</p>
<p>Typically, you don't use <code>ngBind</code> directly, but instead you use the double curly markup like
<code>{{ expression }}</code> which is similar but less verbose.</p>
<p>Once scenario in which the use of <code>ngBind</code> is prefered over <code>{{ expression }}</code> binding is when
<p>Once scenario in which the use of <code>ngBind</code> is preferred over <code>{{ expression }}</code> binding is when
it's desirable to put bindings into template that is momentarily displayed by the browser in its
raw state before Angular compiles it. Since <code>ngBind</code> is an element attribute, it makes the
bindings invisible to the user while the page is loading.</p>
@ -62,5 +62,5 @@ as class<pre class="prettyprint linenums">&lt;ANY class="ng-bind: {expression};"
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-104" ng-eval-javascript="script.js-103"></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-104" ng-eval-javascript="script.js-103"></div></div>
</div>

View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/ngBind.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Creates a binding that will innerHTML the result of evaluating the <code>expression</code> into the current
element. <em>The innerHTML-ed content will not be sanitized!</em> You should use this directive only if
<a href="api/ngSanitize.directive:ngBindHtml">ngBindHtml</a> directive is too

View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/ngBind.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The <code>ngBindTemplate</code> directive specifies that the element
text should be replaced with the template in ngBindTemplate.
Unlike ngBind the ngBindTemplate can contain multiple <code>{{</code> <code>}}</code>
@ -63,5 +63,5 @@ as class<pre class="prettyprint linenums">&lt;ANY class="ng-bind-template: {stri
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-107" ng-eval-javascript="script.js-106"></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-107" ng-eval-javascript="script.js-106"></div></div>
</div>

View file

@ -2,21 +2,21 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/input.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Evaluate given expression when user changes the input.
The expression is not evaluated when the value change is coming from the model.</p>
<p>Note, this directive requires <code>ngModel</code> to be present.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage">as element (see <a href="guide/ie">IE restrictions</a>)<pre class="prettyprint linenums">&lt;ng-change&gt;
<div class="usage"><p>This directive can be used as custom element, but we aware of <a href="guide/ie">IE restrictions</a>.</p>as element:<pre class="prettyprint linenums">&lt;ng-change&gt;
&lt;/ng-change&gt;</pre>
</div>
<h2 id="Example">Example</h2>
<div class="example"><h4>Source</h4>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-135" source-edit-css="" source-edit-js="script.js-134" source-edit-unit="" source-edit-scenario="scenario.js-136"></div>
<div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-144" source-edit-css="" source-edit-js="script.js-143" source-edit-unit="" source-edit-scenario="scenario.js-145"></div>
<div class="tabbable"><div class="tab-pane" title="index.html">
<pre class="prettyprint linenums" ng-set-text="index.html-135" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-135">
<pre class="prettyprint linenums" ng-set-text="index.html-144" ng-html-wrap=" angular.js script.js"></pre>
<script type="text/ng-template" id="index.html-144">
<div ng-controller="Controller">
<input type="checkbox" ng-model="confirmed" ng-change="change()" id="ng-change-example1" />
@ -28,8 +28,8 @@ The expression is not evaluated when the value change is coming from the model.<
</script>
</div>
<div class="tab-pane" title="script.js">
<pre class="prettyprint linenums" ng-set-text="script.js-134"></pre>
<script type="text/ng-template" id="script.js-134">
<pre class="prettyprint linenums" ng-set-text="script.js-143"></pre>
<script type="text/ng-template" id="script.js-143">
function Controller($scope) {
$scope.counter = 0;
$scope.change = function() {
@ -39,8 +39,8 @@ The expression is not evaluated when the value change is coming from the model.<
</script>
</div>
<div class="tab-pane" title="End to end test">
<pre class="prettyprint linenums" ng-set-text="scenario.js-136"></pre>
<script type="text/ng-template" id="scenario.js-136">
<pre class="prettyprint linenums" ng-set-text="scenario.js-145"></pre>
<script type="text/ng-template" id="scenario.js-145">
it('should evaluate the expression if changing from view', function() {
expect(binding('counter')).toEqual('0');
element('#ng-change-example1').click();
@ -56,5 +56,5 @@ The expression is not evaluated when the value change is coming from the model.<
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-135" ng-eval-javascript="script.js-134"></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-144" ng-eval-javascript="script.js-143"></div></div>
</div>

View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/booleanAttrs.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The HTML specs do not require browsers to preserve the special attributes such as checked.
(The presence of them means true and absence means false)
This prevents the angular compiler from correctly retrieving the binding expression.
@ -37,5 +37,5 @@ To solve this problem, we introduce the <code>ngChecked</code> directive.</p></d
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-90" ng-eval-javascript=""></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-90" ng-eval-javascript=""></div></div>
</div>

20
lib/angular/docs/partials/api/ng.directive:ngClass.html Normal file → Executable file
View file

@ -2,13 +2,13 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/ngClass.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The <code>ngClass</code> allows you to set CSS class on HTML element dynamically by databinding an
expression that represents all classes to be added.</p>
<p>The directive won't add duplicate classes if a particular class was already set.</p>
<p>When the expression changes, the previously added classes are removed and only then the classes
<p>When the expression changes, the previously added classes are removed and only then the
new classes are added.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage">as attribute<pre class="prettyprint linenums">&lt;ANY ng-class="{expression}"&gt;
@ -26,10 +26,10 @@ names, an array, or a map of class names to boolean values.</p></li>
</div>
<h2 id="Example">Example</h2>
<div class="example"><h4>Source</h4>
<div source-edit="" source-edit-deps="angular.js" source-edit-html="index.html-140" source-edit-css="style.css-141" source-edit-js="" source-edit-unit="" source-edit-scenario="scenario.js-142"></div>
<div source-edit="" source-edit-deps="angular.js" source-edit-html="index.html-109" source-edit-css="style.css-110" source-edit-js="" source-edit-unit="" source-edit-scenario="scenario.js-111"></div>
<div class="tabbable"><div class="tab-pane" title="index.html">
<pre class="prettyprint linenums" ng-set-text="index.html-140" ng-html-wrap=" angular.js"></pre>
<script type="text/ng-template" id="index.html-140">
<pre class="prettyprint linenums" ng-set-text="index.html-109" ng-html-wrap=" angular.js"></pre>
<script type="text/ng-template" id="index.html-109">
<input type="button" value="set" ng-click="myVar='my-class'">
<input type="button" value="clear" ng-click="myVar=''">
<br>
@ -37,16 +37,16 @@ names, an array, or a map of class names to boolean values.</p></li>
</script>
</div>
<div class="tab-pane" title="style.css">
<pre class="prettyprint linenums" ng-set-text="style.css-141"></pre>
<style type="text/css" id="style.css-141">
<pre class="prettyprint linenums" ng-set-text="style.css-110"></pre>
<style type="text/css" id="style.css-110">
.my-class {
color: red;
}
</style>
</div>
<div class="tab-pane" title="End to end test">
<pre class="prettyprint linenums" ng-set-text="scenario.js-142"></pre>
<script type="text/ng-template" id="scenario.js-142">
<pre class="prettyprint linenums" ng-set-text="scenario.js-111"></pre>
<script type="text/ng-template" id="scenario.js-111">
it('should check ng-class', function() {
expect(element('.doc-example-live span').prop('className')).not().
toMatch(/my-class/);
@ -64,5 +64,5 @@ names, an array, or a map of class names to boolean values.</p></li>
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-140" ng-eval-javascript=""></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-109" ng-eval-javascript=""></div></div>
</div>

View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/ngClass.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The <code>ngClassOdd</code> and <code>ngClassEven</code> works exactly as
<a href="api/ng.directive:ngClass"><code>ngClass</code></a>, except it works in
conjunction with <code>ngRepeat</code> and takes affect only on odd (even) rows.</p>
@ -24,10 +24,10 @@ result of the evaluation can be a string representing space delimited class name
</div>
<h2 id="Example">Example</h2>
<div class="example"><h4>Source</h4>
<div source-edit="" source-edit-deps="angular.js" source-edit-html="index.html-146" source-edit-css="style.css-147" source-edit-js="" source-edit-unit="" source-edit-scenario="scenario.js-148"></div>
<div source-edit="" source-edit-deps="angular.js" source-edit-html="index.html-115" source-edit-css="style.css-116" source-edit-js="" source-edit-unit="" source-edit-scenario="scenario.js-117"></div>
<div class="tabbable"><div class="tab-pane" title="index.html">
<pre class="prettyprint linenums" ng-set-text="index.html-146" ng-html-wrap=" angular.js"></pre>
<script type="text/ng-template" id="index.html-146">
<pre class="prettyprint linenums" ng-set-text="index.html-115" ng-html-wrap=" angular.js"></pre>
<script type="text/ng-template" id="index.html-115">
<ol ng-init="names=['John', 'Mary', 'Cate', 'Suz']">
<li ng-repeat="name in names">
<span ng-class-odd="'odd'" ng-class-even="'even'">
@ -38,8 +38,8 @@ result of the evaluation can be a string representing space delimited class name
</script>
</div>
<div class="tab-pane" title="style.css">
<pre class="prettyprint linenums" ng-set-text="style.css-147"></pre>
<style type="text/css" id="style.css-147">
<pre class="prettyprint linenums" ng-set-text="style.css-116"></pre>
<style type="text/css" id="style.css-116">
.odd {
color: red;
}
@ -49,8 +49,8 @@ result of the evaluation can be a string representing space delimited class name
</style>
</div>
<div class="tab-pane" title="End to end test">
<pre class="prettyprint linenums" ng-set-text="scenario.js-148"></pre>
<script type="text/ng-template" id="scenario.js-148">
<pre class="prettyprint linenums" ng-set-text="scenario.js-117"></pre>
<script type="text/ng-template" id="scenario.js-117">
it('should check ng-class-odd and ng-class-even', function() {
expect(element('.doc-example-live li:first span').prop('className')).
toMatch(/odd/);
@ -60,5 +60,5 @@ result of the evaluation can be a string representing space delimited class name
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-146" ng-eval-javascript=""></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-115" ng-eval-javascript=""></div></div>
</div>

View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/ngClass.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The <code>ngClassOdd</code> and <code>ngClassEven</code> directives work exactly as
<a href="api/ng.directive:ngClass"><code>ngClass</code></a>, except it works in
conjunction with <code>ngRepeat</code> and takes affect only on odd (even) rows.</p>
@ -24,10 +24,10 @@ of the evaluation can be a string representing space delimited class names or an
</div>
<h2 id="Example">Example</h2>
<div class="example"><h4>Source</h4>
<div source-edit="" source-edit-deps="angular.js" source-edit-html="index.html-143" source-edit-css="style.css-144" source-edit-js="" source-edit-unit="" source-edit-scenario="scenario.js-145"></div>
<div source-edit="" source-edit-deps="angular.js" source-edit-html="index.html-112" source-edit-css="style.css-113" source-edit-js="" source-edit-unit="" source-edit-scenario="scenario.js-114"></div>
<div class="tabbable"><div class="tab-pane" title="index.html">
<pre class="prettyprint linenums" ng-set-text="index.html-143" ng-html-wrap=" angular.js"></pre>
<script type="text/ng-template" id="index.html-143">
<pre class="prettyprint linenums" ng-set-text="index.html-112" ng-html-wrap=" angular.js"></pre>
<script type="text/ng-template" id="index.html-112">
<ol ng-init="names=['John', 'Mary', 'Cate', 'Suz']">
<li ng-repeat="name in names">
<span ng-class-odd="'odd'" ng-class-even="'even'">
@ -38,8 +38,8 @@ of the evaluation can be a string representing space delimited class names or an
</script>
</div>
<div class="tab-pane" title="style.css">
<pre class="prettyprint linenums" ng-set-text="style.css-144"></pre>
<style type="text/css" id="style.css-144">
<pre class="prettyprint linenums" ng-set-text="style.css-113"></pre>
<style type="text/css" id="style.css-113">
.odd {
color: red;
}
@ -49,8 +49,8 @@ of the evaluation can be a string representing space delimited class names or an
</style>
</div>
<div class="tab-pane" title="End to end test">
<pre class="prettyprint linenums" ng-set-text="scenario.js-145"></pre>
<script type="text/ng-template" id="scenario.js-145">
<pre class="prettyprint linenums" ng-set-text="scenario.js-114"></pre>
<script type="text/ng-template" id="scenario.js-114">
it('should check ng-class-odd and ng-class-even', function() {
expect(element('.doc-example-live li:first span').prop('className')).
toMatch(/odd/);
@ -60,5 +60,5 @@ of the evaluation can be a string representing space delimited class names or an
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-143" ng-eval-javascript=""></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-112" ng-eval-javascript=""></div></div>
</div>

View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/ngEventDirs.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The ngClick allows you to specify custom behavior when
element is clicked.</p></div>
<h2 id="Usage">Usage</h2>
@ -41,5 +41,5 @@ click. (Event object is available as <code>$event</code>)</p></li>
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-154" ng-eval-javascript=""></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-154" ng-eval-javascript=""></div></div>
</div>

View file

@ -2,19 +2,19 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/ngCloak.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The <code>ngCloak</code> directive is used to prevent the Angular html template from being briefly
displayed by the browser in its raw (uncompiled) form while your application is loading. Use this
directive to avoid the undesirable flicker effect caused by the html template display.</p>
<p>The directive can be applied to the <code>&lt;body&gt;</code> element, but typically a fine-grained application is
prefered in order to benefit from progressive rendering of the browser view.</p>
preferred in order to benefit from progressive rendering of the browser view.</p>
<p><code>ngCloak</code> works in cooperation with a css rule that is embedded within <code>angular.js</code> and
<code>angular.min.js</code> files. Following is the css rule:</p>
<pre class="prettyprint linenums">
[ng\:cloak], [ng-cloak], .ng-cloak {
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none;
}
</pre>
@ -61,5 +61,5 @@ as class<pre class="prettyprint linenums">&lt;ANY class="ng-cloak"&gt;
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-149" ng-eval-javascript=""></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-149" ng-eval-javascript=""></div></div>
</div>

View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/ngController.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The <code>ngController</code> directive assigns behavior to a scope. This is a key aspect of how angular
supports the principles behind the Model-View-Controller design pattern.</p>
@ -116,5 +116,5 @@ for a manual update.
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-152" ng-eval-javascript="script.js-151"></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-152" ng-eval-javascript="script.js-151"></div></div>
</div>

2
lib/angular/docs/partials/api/ng.directive:ngCsp.html Normal file → Executable file
View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/ngCsp.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Enables <a href="https://developer.mozilla.org/en/Security/CSP">CSP (Content Security Policy)</a> support.
This directive should be used on the root element of the application (typically the <code>&lt;html&gt;</code>
element or other element with the <a href="api/ng.directive:ngApp"><code>ngApp</code></a>

View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/ngEventDirs.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The <code>ngDblclick</code> directive allows you to specify custom behavior on dblclick event.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage">as attribute<pre class="prettyprint linenums">&lt;ANY ng-dblclick="{expression}"&gt;

View file

@ -2,7 +2,7 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/booleanAttrs.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The following markup will make the button enabled on Chrome/Firefox but not on IE8 and older IEs:
<pre class="prettyprint linenums">
&lt;div ng-init="scope = { isDisabled: false }"&gt;
@ -44,5 +44,5 @@ To solve this problem, we introduce the <code>ngDisabled</code> directive.</p></
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-88" ng-eval-javascript=""></div></div>
<div class="well doc-example-live animator-container" ng-embed-app="" ng-set-html="index.html-88" ng-eval-javascript=""></div></div>
</div>

4
lib/angular/docs/partials/api/ng.directive:ngForm.html Normal file → Executable file
View file

@ -2,12 +2,12 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/form.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>Nestable alias of <a href="api/ng.directive:form"><code><code>form</code></code></a> directive. HTML
does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a
sub-group of controls needs to be determined.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage">as element (see <a href="guide/ie">IE restrictions</a>)<pre class="prettyprint linenums">&lt;ng-form
<div class="usage"><p>This directive can be used as custom element, but we aware of <a href="guide/ie">IE restrictions</a>.</p>as element:<pre class="prettyprint linenums">&lt;ng-form
[ngForm="{string}"]&gt;
&lt;/ng-form&gt;</pre>
as attribute<pre class="prettyprint linenums">&lt;ANY ng-form

105
lib/angular/docs/partials/api/ng.directive:ngHide.html Normal file → Executable file
View file

@ -2,9 +2,16 @@
<span class="hint">(directive in module <code ng:non-bindable="">ng</code>
)</span>
</h1>
<div><h2 id="Description">Description</h2>
<div class="description"><p>The <code>ngHide</code> and <code>ngShow</code> directives hide or show a portion of the DOM tree (HTML)
conditionally.</p></div>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ng/directive/ngShowHide.js" class="improve-docs btn btn-primary">Improve this doc</a><h2 id="Description">Description</h2>
<div class="description"><p>The <code>ngShow</code> and <code>ngHide</code> directives show or hide a portion of the DOM tree (HTML)
conditionally based on <strong>"truthy"</strong> values evaluated within an {expression}. In other
words, if the expression assigned to <strong>ngShow evaluates to a true value</strong> then <strong>the element is set to visible</strong>
(via <code>display:block</code> in css) and <strong>if false</strong> then <strong>the element is set to hidden</strong> (so display:none).
With ngHide this is the reverse whereas true values cause the element itself to become
hidden.</p>
<p>Additionally, you can also provide animations via the ngAnimate attribute to animate the <strong>show</strong>
and <strong>hide</strong> effects.</p></div>
<h2 id="Usage">Usage</h2>
<div class="usage">as attribute<pre class="prettyprint linenums">&lt;ANY ng-hide="{expression}"&gt;
...
@ -12,37 +19,101 @@ conditionally.</p></div>
as class<pre class="prettyprint linenums">&lt;ANY class="ng-hide: {expression};"&gt;
...
&lt;/ANY&gt;</pre>
<h3 id="Parameters">Parameters</h3>
with <span id="animations">animations</span><pre class="prettyprint linenums">//The show and hide animations are supported
&lt;ANY ng-hide="{expression}" ng-animate="{show: 'show-animation', hide: 'hide-animation'}"&gt;
...
&lt;/ANY&gt;</pre>
<a href="api/ng.$animator#Methods">Click here</a> to learn more about the steps involved in the animation.<h3 id="Parameters">Parameters</h3>
<ul class="parameters"><li><code ng:non-bindable="">ngHide {expression} </code>
<p>If the <a href="guide/expression">expression</a> is truthy then
the element is shown or hidden respectively.</p></li>
</ul>
<h3 id="Animations">Animations</h3>
<div class="animations"><ul><li>show - happens after the ngHide expression evaluates to a non truthy value and the contents are set to visible</li><li>hide - happens after the ngHide expression evaluates to a truthy value and just before the contents are set to hidden</li></ul></div>
</div>
<h2 id="Example">Example</h2>
<div class="example"><h4>Source</h4>
<div source-edit="" source-edit-deps="angular.js" source-edit-html="index.html-173" source-edit-css="" source-edit-js="" source-edit-unit="" source-edit-scenario="scenario.js-174"></div>
<div source-edit="" source-edit-deps="angular.js" source-edit-html="index.html-173" source-edit-css="animations.css" source-edit-js="" source-edit-unit="" source-edit-scenario="scenario.js-174"></div>
<div class="tabbable"><div class="tab-pane" title="index.html">
<pre class="prettyprint linenums" ng-set-text="index.html-173" ng-html-wrap=" angular.js"></pre>
<script type="text/ng-template" id="index.html-173">
Click me: <input type="checkbox" ng-model="checked"><br/>
Show: <span ng-show="checked">I show up when you checkbox is checked?</span> <br/>
Hide: <span ng-hide="checked">I hide when you checkbox is checked?</span>
Click me: <input type="checkbox" ng-model="checked"><br/>
<div>
Show:
<span class="check-element"
ng-show="checked"
ng-animate="{show: 'example-show', hide: 'example-hide'}">
<span class="icon-thumbs-up"></span> I show up when your checkbox is checked.
</span>
</div>
<div>
Hide:
<span class="check-element"
ng-hide="checked"
ng-animate="{show: 'example-show', hide: 'example-hide'}">
<span class="icon-thumbs-down"></span> I hide when your checkbox is checked.
</span>
</div>
</script>
</div>
<div class="tab-pane" title="animations.css">
<pre class="prettyprint linenums" ng-set-text="animations.css"></pre>
<style type="text/css" id="animations.css">
.example-show-setup, .example-hide-setup {
-webkit-transition:all linear 0.5s;
-moz-transition:all linear 0.5s;
-ms-transition:all linear 0.5s;
-o-transition:all linear 0.5s;
transition:all linear 0.5s;
}
.example-show-setup {
line-height:0;
opacity:0;
padding:0 10px;
}
.example-show-start.example-show-start {
line-height:20px;
opacity:1;
padding:10px;
border:1px solid black;
background:white;
}
.example-hide-setup {
line-height:20px;
opacity:1;
padding:10px;
border:1px solid black;
background:white;
}
.example-hide-start.example-hide-start {
line-height:0;
opacity:0;
padding:0 10px;
}
.check-element {
padding:10px;
border:1px solid black;
background:white;
}
</style>
</div>
<div class="tab-pane" title="End to end test">
<pre class="prettyprint linenums" ng-set-text="scenario.js-174"></pre>
<script type="text/ng-template" id="scenario.js-174">
it('should check ng-show / ng-hide', function() {
expect(element('.doc-example-live span:first:hidden').count()).toEqual(1);
expect(element('.doc-example-live span:last:visible').count()).toEqual(1);
it('should check ng-show / ng-hide', function() {
expect(element('.doc-example-live .check-element:first:hidden').count()).toEqual(1);
expect(element('.doc-example-live .check-element:last:visible').count()).toEqual(1);
input('checked').check();
input('checked').check();
expect(element('.doc-example-live span:first:visible').count()).toEqual(1);
expect(element('.doc-example-live span:last:hidden').count()).toEqual(1);
});
expect(element('.doc-example-live .check-element:first:visible').count()).toEqual(1);
expect(element('.doc-example-live .check-element:last:hidden').count()).toEqual(1);
});
</script>
</div>
</div><h4>Demo</h4>
<div class="well doc-example-live" ng-embed-app="" ng-set-html="index.html-173" ng-eval-javascript=""></div></div>
</div><div class="pull-right"> <button class="btn btn-primary" ng-click="animationsOff=true" ng-hide="animationsOff">Animations on</button> <button class="btn btn-primary disabled" ng-click="animationsOff=false" ng-show="animationsOff">Animations off</button></div><h4>Demo</h4>
<div class="well doc-example-live animator-container" ng-class="{'animations-off':animationsOff == true}" ng-embed-app="" ng-set-html="index.html-173" ng-eval-javascript=""></div></div>
</div>

Some files were not shown because too many files have changed in this diff Show more