mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
fix(doc) cleanup all api doc link warnings
This commit is contained in:
parent
f6d98f1472
commit
b09595a3c1
61 changed files with 270 additions and 253 deletions
|
|
@ -25,7 +25,7 @@ function MyModule($provide, $locationProvider){
|
|||
};
|
||||
</pre>
|
||||
|
||||
See: {@link angular.module.NG.$provide $provide}, {@link angular.module.NG.$locationProvider $locationProvider}.
|
||||
See: {@link angular.module.AUTO.$provide $provide}, {@link angular.module.NG.$locationProvider $locationProvider}.
|
||||
|
||||
# Registering Module Function
|
||||
|
||||
|
|
|
|||
|
|
@ -7,23 +7,23 @@
|
|||
* {@link angular.widget Widgets} - Angular custom DOM element
|
||||
* {@link angular.directive Directives} - Angular DOM element attributes
|
||||
* {@link angular.markup Markup} and {@link angular.attrMarkup Attribute Markup}
|
||||
* {@link angular.filter Filters} - Angular output filters
|
||||
* {@link angular.compile angular.compile()} - Template compiler
|
||||
* {@link angular.module.NG.$filter Filters} - Angular output filters
|
||||
* {@link angular.module.NG.$compile $compile} - Template compiler
|
||||
|
||||
## Angular Scope API
|
||||
|
||||
* {@link angular.scope Scope Object} - Angular scope object
|
||||
* {@link angular.module.NG.$rootScope.Scope Scope Object} - Angular scope object
|
||||
|
||||
|
||||
## Angular Services & Dependency Injection API
|
||||
|
||||
* {@link angular.service Angular Services}
|
||||
* {@link angular.module.NG Angular Services}
|
||||
* {@link angular.injector angular.injector() }
|
||||
|
||||
|
||||
## Angular Testing API
|
||||
|
||||
* {@link angular.mock Testing Mocks API} - Mock objects for testing
|
||||
* {@link angular.module.NG_MOCK Testing Mocks API} - Mock objects for testing
|
||||
* {@link guide/dev_guide.e2e-testing Angular Scenario Runner} - Automated scenario testing
|
||||
documentation
|
||||
|
||||
|
|
@ -63,9 +63,3 @@ documentation
|
|||
|
||||
* {@link angular.fromJson angular.fromJson() }
|
||||
* {@link angular.toJson angular.toJson() }
|
||||
|
||||
|
||||
|
||||
## Utility methods for JavaScript types
|
||||
* {@link angular.Object Object API} - Utility functions for JavaScript objects
|
||||
* {@link angular.Array Array API} - Utility functions for JavaScript arrays
|
||||
|
|
|
|||
|
|
@ -105,9 +105,9 @@ The two partials are defined in the following URLs:
|
|||
# Things to notice
|
||||
|
||||
* Routes are defined in the `AppCntl` class. The initialization of the controller causes the
|
||||
initialization of the {@link api/angular.service.$route $route} service with the proper URL
|
||||
initialization of the {@link api/angular.module.NG.$route $route} service with the proper URL
|
||||
routes.
|
||||
* The {@link api/angular.service.$route $route} service then watches the URL and instantiates the
|
||||
* The {@link api/angular.module.NG.$route $route} service then watches the URL and instantiates the
|
||||
appropriate controller when the URL changes.
|
||||
* The {@link api/angular.widget.ng:view ng:view} widget loads the view when the URL changes. It
|
||||
also
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ allow a user to enter data.
|
|||
|
||||
* The user data model is initialized {@link api/angular.directive.ng:controller controller} and is
|
||||
available in
|
||||
the {@link api/angular.scope scope} with the initial data.
|
||||
the {@link api/angular.module.NG.$rootScope.Scope scope} with the initial data.
|
||||
* For debugging purposes we have included a debug view of the model to better understand what
|
||||
is going on.
|
||||
* The {@link api/angular.widget.input input widgets} simply refer to the model and are data-bound.
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ Take a look through the source and note:
|
|||
* The script tag that {@link guide/dev_guide.bootstrap bootstraps} the angular environment.
|
||||
* The text {@link api/angular.widget.input input widget} which is bound to the greeting name text.
|
||||
* No need for listener registration and event firing on change events.
|
||||
* The implicit presence of the `name` variable which is in the root {@link api/angular.scope scope}.
|
||||
* The implicit presence of the `name` variable which is in the root {@link api/angular.module.NG.$rootScope.Scope scope}.
|
||||
* The double curly brace `{{markup}}`, which binds the name variable to the greeting text.
|
||||
* The concept of {@link guide/dev_guide.templates.databinding data binding}, which reflects any
|
||||
changes to the
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ allowing you to send links to specific screens in your app.
|
|||
|
||||
# Services
|
||||
|
||||
{@link api/angular.service Services}: Services are long lived objects in your applications that are
|
||||
{@link api/angular.module.NG Services}: Services are long lived objects in your applications that are
|
||||
available across controllers. A collection of useful services are pre-bundled with angular but you
|
||||
will likely add your own. Services are initialized using dependency injection, which resolves the
|
||||
order of initialization. This safeguards you from the perils of global state (a common way to
|
||||
|
|
|
|||
|
|
@ -121,4 +121,4 @@ board variable.
|
|||
* The view can call any controller function.
|
||||
* In this example, the `setUrl()` and `readUrl()` functions copy the game state to/from the URL's
|
||||
hash so the browser's back button will undo game steps. See deep-linking. This example calls {@link
|
||||
api/angular.scope.$watch $watch()} to set up a listener that invokes `readUrl()` when needed.
|
||||
api/angular.module.NG.$rootScope.Scope#$watch $watch()} to set up a listener that invokes `readUrl()` when needed.
|
||||
|
|
|
|||
|
|
@ -98,4 +98,4 @@ APIs are bound to fields of this global object.
|
|||
|
||||
## Related API
|
||||
|
||||
{@link api/angular.compile Compiler API}
|
||||
{@link api/angular.module.NG.$compile Compiler API}
|
||||
|
|
|
|||
|
|
@ -28,5 +28,5 @@ book.
|
|||
|
||||
## Related API
|
||||
|
||||
* {@link api/angular.service Service API}
|
||||
* {@link api/angular.module.NG Service API}
|
||||
* {@link api/angular.injector Angular Injector API}
|
||||
|
|
|
|||
|
|
@ -7,15 +7,15 @@ While DI is widely used in statically typed languages such as Java or C++, it ha
|
|||
used in JavaScript. Angular brings the benefits of DI into JavaScript apps.
|
||||
|
||||
In angular, DI is implemented as a subsystem that manages dependencies between services,
|
||||
controllers, widgets, and filters. The most important of these are {@link api/angular.service
|
||||
controllers, widgets, and filters. The most important of these are {@link api/angular.module.NG
|
||||
services}.
|
||||
|
||||
Services are objects that handle common tasks in web applications. Angular provides several{@link
|
||||
api/angular.service built-in services}, and you can create your own custom services.
|
||||
api/angular.module.NG built-in services}, and you can create your own custom services.
|
||||
|
||||
The main job of angular's DI subsystem is to provide services to angular components that depend on
|
||||
them. The way the DI subsystem provides services is as follows: all services are registered with
|
||||
angular's {@link api/angular.service service API}, and all components that depend on services
|
||||
angular's {@link api/angular.module.NG service API}, and all components that depend on services
|
||||
define those dependencies as a property (`$inject`). With this information, the DI subsystem
|
||||
manages the creation of service objects and the provision of those objects to the components that
|
||||
need them, at the time they need them. The following illustration steps through the sequence of
|
||||
|
|
@ -49,7 +49,7 @@ achieve the necessary isolation by having each test create its own separate root
|
|||
|
||||
<pre>
|
||||
// create a root scope
|
||||
var rootScope = angular.scope();
|
||||
var rootScope = angular.module.NG.$rootScope.Scope();
|
||||
// access the service locator
|
||||
var myService = rootScope.$service('myService');
|
||||
</pre>
|
||||
|
|
@ -74,7 +74,7 @@ equivalent:
|
|||
|
||||
<pre>
|
||||
// given a user defined service
|
||||
angular.service('serviceA', ...);
|
||||
angular.module.NG('serviceA', ...);
|
||||
|
||||
// inject '$window', 'serviceA', curry 'name';
|
||||
function fnA($window, serviceA, name){};
|
||||
|
|
@ -102,4 +102,4 @@ code and insert the `$inject` into the source code so that it can be minified/ob
|
|||
|
||||
## Related API
|
||||
|
||||
* {@link api/angular.service Services API}
|
||||
* {@link api/angular.module.NG Services API}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ MyController.$inject = ['$route'];
|
|||
</pre>
|
||||
|
||||
In this example, the `MyController` constructor function takes one argument, the {@link
|
||||
api/angular.service.$route $route} service. Angular is then responsible for supplying the instance
|
||||
api/angular.module.NG.$route $route} service. Angular is then responsible for supplying the instance
|
||||
of `$route` to the controller when the constructor is instantiated. There are two ways to cause
|
||||
controller instantiation – by configuring routes with the `$route` service, or by referencing the
|
||||
controller from the HTML template, as follows:
|
||||
|
|
|
|||
|
|
@ -78,19 +78,19 @@ Returns the window.location.search of the currently loaded page in the test fram
|
|||
Returns the window.location.hash (without `#`) of the currently loaded page in the test frame.
|
||||
|
||||
## browser().location().url()
|
||||
Returns the {@link api/angular.service.$location $location.url()} of the currently loaded page in
|
||||
Returns the {@link api/angular.module.NG.$location $location.url()} of the currently loaded page in
|
||||
the test frame.
|
||||
|
||||
## browser().location().path()
|
||||
Returns the {@link api/angular.service.$location $location.path()} of the currently loaded page in
|
||||
Returns the {@link api/angular.module.NG.$location $location.path()} of the currently loaded page in
|
||||
the test frame.
|
||||
|
||||
## browser().location().search()
|
||||
Returns the {@link api/angular.service.$location $location.search()} of the currently loaded page
|
||||
Returns the {@link api/angular.module.NG.$location $location.search()} of the currently loaded page
|
||||
in the test frame.
|
||||
|
||||
## browser().location().hash()
|
||||
Returns the {@link api/angular.service.$location $location.hash()} of the currently loaded page in
|
||||
Returns the {@link api/angular.module.NG.$location $location.hash()} of the currently loaded page in
|
||||
the test frame.
|
||||
|
||||
## expect(future).{matcher}
|
||||
|
|
|
|||
|
|
@ -165,15 +165,15 @@ JavaScript method instead.
|
|||
Built-in types have methods like `[].push()`, but the richness of these methods is limited.
|
||||
Consider the example below, which allows you to do a simple search over a canned set of contacts.
|
||||
The example would be much more complicated if we did not have the `Array:$filter()`. There is no
|
||||
built-in method on `Array` called {@link api/angular.Array.filter $filter} and angular doesn't add
|
||||
built-in method on `Array` called {@link api/angular.module.NG.$filter.filter $filter} and angular doesn't add
|
||||
it to `Array.prototype` because that could collide with other JavaScript frameworks.
|
||||
|
||||
For this reason the scope expression evaluator augments the built-in types to make them act like
|
||||
they have extra methods. The actual method for `$filter()` is `angular.Array.filter()`. You can
|
||||
they have extra methods. The actual method for `$filter()` is `angular.module.NG.$filter.filter()`. You can
|
||||
call it from JavaScript.
|
||||
|
||||
Extensions: You can further extend the expression vocabulary by adding new methods to
|
||||
`angular.Array` or `angular.String`, etc.
|
||||
`angular.module.NG.$filter` or `angular.String`, etc.
|
||||
|
||||
<doc:example>
|
||||
<doc:source>
|
||||
|
|
@ -212,7 +212,7 @@ of filters like this:
|
|||
|
||||
name | uppercase
|
||||
|
||||
The expression evaluator simply passes the value of name to angular.filter.uppercase.
|
||||
The expression evaluator simply passes the value of name to angular.module.NG.$filter.uppercase.
|
||||
|
||||
Chain filters using this syntax:
|
||||
|
||||
|
|
|
|||
|
|
@ -18,14 +18,14 @@ Forms consist of all of the following:
|
|||
|
||||
A form groups a set of widgets together into a single logical data-set. A form is created using
|
||||
the {@link api/angular.widget.form <form>} element that calls the
|
||||
{@link api/angular.service.$formFactory $formFactory} service. The form is responsible for managing
|
||||
{@link api/angular.module.NG.$formFactory $formFactory} service. The form is responsible for managing
|
||||
the widgets and for tracking validation information.
|
||||
|
||||
A form is:
|
||||
|
||||
- The collection which contains widgets or other forms.
|
||||
- Responsible for marshaling data from the model into a widget. This is
|
||||
triggered by {@link api/angular.scope.$watch $watch} of the model expression.
|
||||
triggered by {@link api/angular.module.NG.$rootScope.Scope#$watch $watch} of the model expression.
|
||||
- Responsible for marshaling data from the widget into the model. This is
|
||||
triggered by the widget emitting the `$viewChange` event.
|
||||
- Responsible for updating the validation state of the widget, when the widget emits
|
||||
|
|
@ -57,7 +57,7 @@ In Angular, a widget is the term used for the UI with which the user input. Exam
|
|||
bult-in Angular widgets are {@link api/angular.widget.input input} and
|
||||
{@link api/angular.widget.select select}. Widgets provide the rendering and the user
|
||||
interaction logic. Widgets should be declared inside a form, if no form is provided an implicit
|
||||
form {@link api/angular.service.$formFactory $formFactory.rootForm} form is used.
|
||||
form {@link api/angular.module.NG.$formFactory $formFactory.rootForm} form is used.
|
||||
|
||||
Widgets are implemented as Angular controllers. A widget controller:
|
||||
|
||||
|
|
@ -218,7 +218,7 @@ The following example demonstrates:
|
|||
# Life-cycle
|
||||
|
||||
- The `<form>` element triggers creation of a new form {@link dev_guide.scopes scope} using the
|
||||
{@link api/angular.service.$formFactory $formfactory}. The new form scope is added to the
|
||||
{@link api/angular.module.NG.$formFactory $formfactory}. The new form scope is added to the
|
||||
`<form>` element using the jQuery `.data()` method for later retrieval under the key `$form`.
|
||||
The form also sets up these listeners:
|
||||
|
||||
|
|
@ -227,8 +227,8 @@ The following example demonstrates:
|
|||
- `$valid` / `$invalid` - This event is emitted by the widget on validation state change.
|
||||
|
||||
- `<input>` element triggers the creation of the widget using the
|
||||
{@link api/angular.service.$formFactory $formfactory.$createWidget()} method. The `$createWidget()`
|
||||
creates new widget instance by calling the current scope {@link api/angular.scope.$new .$new()} and
|
||||
{@link api/angular.module.NG.$formFactory $formfactory.$createWidget()} method. The `$createWidget()`
|
||||
creates new widget instance by calling the current scope {@link api/angular.module.NG.$rootScope.Scope#$new .$new()} and
|
||||
registers these listeners:
|
||||
|
||||
- `$watch` on the model scope.
|
||||
|
|
@ -244,7 +244,7 @@ The following example demonstrates:
|
|||
1. The DOM element fires the `change` event which the widget intercepts. Widget then emits
|
||||
a `$viewChange` event which includes the new user-entered value. (Remember that the DOM events
|
||||
are outside of the Angular environment so the widget must emit its event within the
|
||||
{@link api/angular.scope.$apply $apply} method).
|
||||
{@link api/angular.module.NG.$rootScope.Scope#$apply $apply} method).
|
||||
2. The form's `$viewChange` listener copies the user-entered value to the widget's `$viewValue`
|
||||
property. Since the `$viewValue` is the raw value as entered by user, it may need to be
|
||||
translated to a different format/type (for example, translating a string to a number).
|
||||
|
|
@ -517,7 +517,7 @@ function LoginController() {
|
|||
|
||||
describe('LoginController', function() {
|
||||
it('should disable login button when form is invalid', function() {
|
||||
var scope = angular.scope();
|
||||
var scope = angular.module.NG.$rootScope.Scope();
|
||||
var loginController = scope.$new(LoginController);
|
||||
|
||||
// In production the 'loginForm' form instance gets set from the view,
|
||||
|
|
@ -570,7 +570,7 @@ function LoginController(){
|
|||
|
||||
describe('LoginController', function() {
|
||||
it('should disable login button when form is invalid', function() {
|
||||
var scope = angular.scope();
|
||||
var scope = angular.module.NG.$rootScope.Scope();
|
||||
var loginController = scope.$new(LoginController);
|
||||
var input = angular.element('<input>');
|
||||
|
||||
|
|
|
|||
|
|
@ -17,15 +17,15 @@ abstracted bits.
|
|||
**What level of support for i18n/l10n is currently in Angular?**
|
||||
|
||||
Currently, Angular supports i18n/l10n for {@link
|
||||
http://docs.angularjs.org/#!/api/angular.filter.date datetime}, {@link
|
||||
http://docs.angularjs.org/#!/api/angular.filter.number number} and {@link
|
||||
http://docs.angularjs.org/#!/api/angular.filter.currency currency} filters.
|
||||
http://docs.angularjs.org/#!/api/angular.module.NG.$filter.date datetime}, {@link
|
||||
http://docs.angularjs.org/#!/api/angular.module.NG.$filter.number number} and {@link
|
||||
http://docs.angularjs.org/#!/api/angular.module.NG.$filter.currency currency} filters.
|
||||
|
||||
Additionally, Angular supports localizable pluralization support provided by the {@link
|
||||
api/angular.widget.ng:pluralize ng:pluralize widget}.
|
||||
|
||||
All localizable Angular components depend on locale-specific rule sets managed by the {@link
|
||||
api/angular.service.$locale $locale service}.
|
||||
api/angular.module.NG.$locale $locale service}.
|
||||
|
||||
For readers who want to jump straight into examples, we have a few web pages that showcase how to
|
||||
use Angular filters with various locale rule sets. You can find these examples either on {@link
|
||||
|
|
@ -90,8 +90,8 @@ because an extra script needs to be loaded.
|
|||
|
||||
**Currency symbol "gotcha"**
|
||||
|
||||
Angular's {@link http://docs.angularjs.org/#!/api/angular.filter.currency currency filter} allows
|
||||
you to use the default currency symbol from the {@link api/angular.service.$locale locale service},
|
||||
Angular's {@link http://docs.angularjs.org/#!/api/angular.module.NG.$filter.currency currency filter} allows
|
||||
you to use the default currency symbol from the {@link api/angular.module.NG.$locale locale service},
|
||||
or you can provide the filter with a custom currency symbol. If your app will be used only in one
|
||||
locale, it is fine to rely on the default currency symbol. However, if you anticipate that viewers
|
||||
in other locales might use your app, you should provide your own currency symbol to make sure the
|
||||
|
|
@ -104,7 +104,7 @@ browser will specify the locale as ja, and the balance of '¥1000.00' will be sh
|
|||
will really upset your client.
|
||||
|
||||
In this case, you need to override the default currency symbol by providing the {@link
|
||||
http://docs.angularjs.org/#!/api/angular.filter.currency currency filter} with a currency symbol as
|
||||
http://docs.angularjs.org/#!/api/angular.module.NG.$filter.currency currency filter} with a currency symbol as
|
||||
a parameter when you configure the filter, for example, {{ 1000 | currency:"USD$"}}. This way,
|
||||
Angular will always show a balance of 'USD$1000' and disregard any locale changes.
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
In angular, a controller is a JavaScript function(type/class) that is used to augment instances of
|
||||
angular {@link dev_guide.scopes Scope}, excluding the root scope. When you or angular create a new
|
||||
child scope object via the {@link api/angular.scope.$new scope.$new} API , there is an
|
||||
child scope object via the {@link api/angular.module.NG.$rootScope.Scope#$new scope.$new} API , there is an
|
||||
option to pass in a controller as a method argument. This will tell angular to associate the
|
||||
controller with the new scope and to augment its behavior.
|
||||
|
||||
|
|
@ -77,9 +77,9 @@ instances).
|
|||
|
||||
# Associating Controllers with Angular Scope Objects
|
||||
|
||||
You can associate controllers with scope objects explicitly via the {@link api/angular.scope.$new
|
||||
You can associate controllers with scope objects explicitly via the {@link api/angular.module.NG.$rootScope.Scope#$new
|
||||
scope.$new} api or implicitly via the {@link api/angular.directive.ng:controller ng:controller
|
||||
directive} or {@link api/angular.service.$route $route service}.
|
||||
directive} or {@link api/angular.module.NG.$route $route service}.
|
||||
|
||||
|
||||
## Controller Constructor and Methods Example
|
||||
|
|
@ -160,7 +160,7 @@ input box) in the second button.
|
|||
|
||||
## Controller Inheritance Example
|
||||
|
||||
Controller inheritance in angular is based on {@link api/angular.scope Scope} inheritance. Let's
|
||||
Controller inheritance in angular is based on {@link api/angular.module.NG.$rootScope.Scope Scope} inheritance. Let's
|
||||
have a look at an example:
|
||||
|
||||
<pre>
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ pattern, a scope's properties comprise both the model and the controller methods
|
|||
|
||||
|
||||
### Scope characteristics
|
||||
- Scopes provide APIs ({@link api/angular.scope.$watch $watch}) to observe model mutations.
|
||||
- Scopes provide APIs ({@link api/angular.scope.$apply $apply}) to propagate any model changes
|
||||
- Scopes provide APIs ({@link api/angular.module.NG.$rootScope.Scope#$watch $watch}) to observe model mutations.
|
||||
- Scopes provide APIs ({@link api/angular.module.NG.$rootScope.Scope#$apply $apply}) to propagate any model changes
|
||||
through the system into the view from outside of the "Angular realm" (controllers, services,
|
||||
Angular event handlers).
|
||||
- Scopes can be nested to isolate application components while providing access to shared model
|
||||
|
|
@ -24,19 +24,19 @@ available as `this` within the given context. (Note: This api will change before
|
|||
### Root scope
|
||||
|
||||
Every application has a root scope, which is the ancestor of all other scopes. The root scope is
|
||||
responsible for creating the injector which is assigned to the {@link api/angular.scope.$service
|
||||
responsible for creating the injector which is assigned to the {@link api/angular.module.NG.$rootScope.Scope#$service
|
||||
$service} property, and initializing the services.
|
||||
|
||||
### What is scope used for?
|
||||
|
||||
{@link dev_guide.expressions Expressions} in the view are {@link api/angular.scope.$eval evaluated}
|
||||
{@link dev_guide.expressions Expressions} in the view are {@link api/angular.module.NG.$rootScope.Scope#$eval evaluated}
|
||||
against the current scope. When HTML DOM elements are attached to a scope, expressions in those
|
||||
elements are evaluated against the attached scope.
|
||||
|
||||
There are two kinds of expressions:
|
||||
|
||||
- Binding expressions, which are observations of property changes. Property changes are reflected
|
||||
in the view during the {@link api/angular.scope.$digest digest cycle}.
|
||||
in the view during the {@link api/angular.module.NG.$rootScope.Scope#$digest digest cycle}.
|
||||
- Action expressions, which are expressions with side effects. Typically, the side effects cause
|
||||
execution of a method in a controller in response to a user action, such as clicking on a button.
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ A property write will always write to the current scope. This means that a write
|
|||
property within the scope it writes to, as shown in the following example.
|
||||
|
||||
<pre>
|
||||
var root = angular.scope();
|
||||
var root = angular.module.NG.$rootScope.Scope();
|
||||
var child = root.$new();
|
||||
|
||||
root.name = 'angular';
|
||||
|
|
@ -75,25 +75,25 @@ expect(root.name).toEqual('angular');
|
|||
### Scope life cycle
|
||||
1. **Creation**
|
||||
|
||||
* You can create the root scope via {@link api/angular.scope angular.scope()}.
|
||||
* To create a child scopes, you should call {@link api/angular.scope.$new parentScope.$new()}.
|
||||
* You can create the root scope via {@link api/angular.module.NG.$rootScope.Scope angular.module.NG.$rootScope.Scope()}.
|
||||
* To create a child scopes, you should call {@link api/angular.module.NG.$rootScope.Scope#$new parentScope.$new()}.
|
||||
|
||||
2. **Watcher registration**
|
||||
|
||||
Watcher registration can happen at any time and on any scope (root or child) via {@link
|
||||
api/angular.scope.$watch scope.$watch()} API.
|
||||
api/angular.module.NG.$rootScope.Scope#$watch scope.$watch()} API.
|
||||
|
||||
3. **Model mutation**
|
||||
|
||||
For mutations to be properly observed, you should make them only within the execution of the
|
||||
function passed into {@link api/angular.scope.$apply scope.$apply()} call. (Angular apis do this
|
||||
function passed into {@link api/angular.module.NG.$rootScope.Scope#$apply scope.$apply()} call. (Angular apis do this
|
||||
implicitly, so no extra `$apply` call is needed when doing synchronous work in controllers, or
|
||||
asynchronous work with {@link api/angular.service.$xhr $xhr} or {@link api/angular.service.$defer
|
||||
asynchronous work with {@link api/angular.module.NG.$xhr $xhr} or {@link api/angular.module.NG.$defer
|
||||
$defer} services.
|
||||
|
||||
4. **Mutation observation**
|
||||
|
||||
At the end of each `$apply` call {@link api/angular.scope.$digest $digest} cycle is started on
|
||||
At the end of each `$apply` call {@link api/angular.module.NG.$rootScope.Scope#$digest $digest} cycle is started on
|
||||
the root scope, which then propagates throughout all child scopes.
|
||||
|
||||
During the `$digest` cycle, all `$watch-ers` expressions or functions are checked for model
|
||||
|
|
@ -102,7 +102,7 @@ mutation and if a mutation is detected, the `$watch-er` listener is called.
|
|||
5. **Scope destruction**
|
||||
|
||||
When child scopes are no longer needed, it is the responsibility of the child scope creator to
|
||||
destroy them via {@link api/angular.scope.$destroy scope.$destroy()} API. This will stop
|
||||
destroy them via {@link api/angular.module.NG.$rootScope.Scope#$destroy scope.$destroy()} API. This will stop
|
||||
propagation of `$digest` calls into the child scope and allow for memory used by the child scope
|
||||
models to be reclaimed by the garbage collector.
|
||||
|
||||
|
|
@ -117,28 +117,28 @@ scopes come into play throughout and get a sense of their interactions.
|
|||
1. At application compile time, a root scope is created and is attached to the root `<HTML>` DOM
|
||||
element.
|
||||
1. The root scope creates an {@link api/angular.injector injector} which is assigned to the
|
||||
{@link api/angular.scope.$service $service} property of the root scope.
|
||||
2. Any eager {@link api/angular.scope.$service services} are initialized at this point.
|
||||
{@link api/angular.module.NG.$rootScope.Scope#$service $service} property of the root scope.
|
||||
2. Any eager {@link api/angular.module.NG.$rootScope.Scope#$service services} are initialized at this point.
|
||||
2. During the compilation phase, the {@link dev_guide.compiler compiler} matches {@link
|
||||
api/angular.directive directives} against the DOM template. The directives usually fall into one of
|
||||
two categories:
|
||||
- Observing {@link api/angular.directive directives}, such as double-curly expressions
|
||||
`{{expression}}`, register listeners using the {@link api/angular.scope.$watch $watch()} method.
|
||||
`{{expression}}`, register listeners using the {@link api/angular.module.NG.$rootScope.Scope#$watch $watch()} method.
|
||||
This type of directive needs to be notified whenever the expression changes so that it can update
|
||||
the view.
|
||||
- Listener directives, such as {@link api/angular.directive.ng:click ng:click}, register a
|
||||
listener with the DOM. When the DOM listener fires, the directive executes the associated
|
||||
expression and updates the view using the {@link api/angular.scope.$apply $apply()} method.
|
||||
expression and updates the view using the {@link api/angular.module.NG.$rootScope.Scope#$apply $apply()} method.
|
||||
3. When an external event (such as a user action, timer or XHR) is received, the associated {@link
|
||||
dev_guide.expressions expression} must be applied to the scope through the {@link
|
||||
api/angular.scope.$apply $apply()} method so that all listeners are updated correctly.
|
||||
api/angular.module.NG.$rootScope.Scope#$apply $apply()} method so that all listeners are updated correctly.
|
||||
|
||||
|
||||
### Directives that create scopes
|
||||
In most cases, {@link api/angular.directive directives} and scopes interact but do not create new
|
||||
instances of scope. However, some directives, such as {@link api/angular.directive.ng:controller
|
||||
ng:controller} and {@link api/angular.widget.@ng:repeat ng:repeat}, create new child scopes using
|
||||
the {@link api/angular.scope.$new $new()} method and then attach the child scope to the
|
||||
the {@link api/angular.module.NG.$rootScope.Scope#$new $new()} method and then attach the child scope to the
|
||||
corresponding DOM element. You can retrieve a scope for any DOM element by using an
|
||||
`angular.element(aDomElement).scope()` method call.)
|
||||
|
||||
|
|
@ -148,13 +148,13 @@ Scopes and controllers interact with each other in the following situations:
|
|||
- Controllers use scopes to expose controller methods to templates (see {@link
|
||||
api/angular.directive.ng:controller ng:controller}).
|
||||
- Controllers define methods (behavior) that can mutate the model (properties on the scope).
|
||||
- Controllers may register {@link api/angular.scope.$watch watches} on the model. These watches
|
||||
- Controllers may register {@link api/angular.module.NG.$rootScope.Scope#$watch watches} on the model. These watches
|
||||
execute immediately after the controller behavior executes, but before the DOM gets updated.
|
||||
|
||||
See the {@link dev_guide.mvc.understanding_controller controller docs} for more information.
|
||||
|
||||
### Updating scope properties
|
||||
You can update a scope by calling its {@link api/angular.scope.$apply $apply()} method with an
|
||||
You can update a scope by calling its {@link api/angular.module.NG.$rootScope.Scope#$apply $apply()} method with an
|
||||
expression or a function as the function argument. However it is typically not necessary to do this
|
||||
explicitly. In most cases, angular intercepts all external events (such as user interactions, XHRs,
|
||||
and timers) and wraps their callbacks into the `$apply()` method call on the scope object for you
|
||||
|
|
@ -177,8 +177,8 @@ doesn't need to worry about propagating the `$digest` call from the parent scope
|
|||
This happens automatically.
|
||||
|
||||
## Scopes in unit-testing
|
||||
You can create scopes, including the root scope, in tests using the {@link api/angular.scope
|
||||
angular.scope()} API. This allows you to mimic the run-time environment and have full control over
|
||||
You can create scopes, including the root scope, in tests using the {@link api/angular.module.NG.$rootScope.Scope
|
||||
angular.module.NG.$rootScope.Scope()} API. This allows you to mimic the run-time environment and have full control over
|
||||
the life cycle of the scope so that you can assert correct model transitions. Since these scopes
|
||||
are created outside the normal compilation process, their life cycles must be managed by the test.
|
||||
|
||||
|
|
@ -188,7 +188,7 @@ within the unit-tests.
|
|||
|
||||
<pre>
|
||||
// example of a test
|
||||
var scope = angular.scope();
|
||||
var scope = angular.module.NG.$rootScope.Scope();
|
||||
scope.$watch('name', function(scope, name){
|
||||
scope.greeting = 'Hello ' + name + '!';
|
||||
});
|
||||
|
|
@ -210,7 +210,7 @@ service instances, as shown in the following example.
|
|||
|
||||
<pre>
|
||||
var myLocation = {};
|
||||
var scope = angular.scope(angular.service, {$location: myLocation});
|
||||
var scope = angular.module.NG.$rootScope.Scope(angular.module.NG, {$location: myLocation});
|
||||
expect(scope.$service('$location')).toEqual(myLocation);
|
||||
</pre>
|
||||
|
||||
|
|
@ -221,5 +221,5 @@ expect(scope.$service('$location')).toEqual(myLocation);
|
|||
|
||||
## Related API
|
||||
|
||||
* {@link api/angular.scope Angular Scope API}
|
||||
* {@link api/angular.module.NG.$rootScope.Scope Angular Scope API}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,15 +13,15 @@ the contexts in which Angular creates data-bindings between the model and the vi
|
|||
|
||||
In addition to providing the context in which data is evaluated, Angular scope objects watch for
|
||||
model changes. The scope objects also notify all components interested in any model changes (for
|
||||
example, functions registered through {@link api/angular.scope.$watch $watch}, bindings created by
|
||||
example, functions registered through {@link api/angular.module.NG.$rootScope.Scope#$watch $watch}, bindings created by
|
||||
{@link api/angular.directive.ng:bind ng:bind}, or HTML input elements).
|
||||
|
||||
Angular scope objects:
|
||||
|
||||
* Link the model, controller and view template together.
|
||||
* Provide the mechanism to watch for model changes ({@link api/angular.scope.$watch $watch}).
|
||||
* Apply model changes to the system ({@link api/angular.scope.$apply $apply}).
|
||||
* Provide the context in which expressions are evaluated ({@link api/angular.scope.$eval $eval}).
|
||||
* Provide the mechanism to watch for model changes ({@link api/angular.module.NG.$rootScope.Scope#$watch $watch}).
|
||||
* Apply model changes to the system ({@link api/angular.module.NG.$rootScope.Scope#$apply $apply}).
|
||||
* Provide the context in which expressions are evaluated ({@link api/angular.module.NG.$rootScope.Scope#$eval $eval}).
|
||||
|
||||
|
||||
## Related Topics
|
||||
|
|
@ -31,5 +31,5 @@ Angular scope objects:
|
|||
|
||||
## Related API
|
||||
|
||||
* {@link api/angular.scope Angular Scope API}
|
||||
* {@link api/angular.module.NG.$rootScope.Scope Angular Scope API}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,4 +63,4 @@ The following illustration shows the DOM and angular scopes for the example abov
|
|||
|
||||
## Related API
|
||||
|
||||
* {@link api/angular.scope Angular Scope API}
|
||||
* {@link api/angular.module.NG.$rootScope.Scope Angular Scope API}
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ current URL without creating a new browser history record you can call:
|
|||
</pre>
|
||||
|
||||
Note that the setters don't update `window.location` immediately. Instead, `$location` service is
|
||||
aware of the {@link api/angular.scope scope} life-cycle and coalesces multiple `$location`
|
||||
aware of the {@link api/angular.module.NG.$rootScope.Scope scope} life-cycle and coalesces multiple `$location`
|
||||
mutations into one "commit" to the `window.location` object during the scope `$digest` phase. Since
|
||||
multiple changes to the $location's state will be pushed to the browser as a single change, it's
|
||||
enough to call the `replace()` method just once to make the entire "commit" a replace operation
|
||||
|
|
@ -210,7 +210,7 @@ In this mode, `$location` uses Hashbang URLs in all browsers.
|
|||
### Example
|
||||
|
||||
<pre>
|
||||
angular.service('$locationConfig', function() {
|
||||
angular.module.NG('$locationConfig', function() {
|
||||
return {
|
||||
html5Mode: false,
|
||||
hashPrefix: '!'
|
||||
|
|
@ -258,7 +258,7 @@ having to worry about whether the browser displaying your app supports the histo
|
|||
### Example
|
||||
|
||||
<pre>
|
||||
angular.service('$locationConfig', function() {
|
||||
angular.module.NG('$locationConfig', function() {
|
||||
return {
|
||||
html5Mode: true,
|
||||
hashPrefix: '!'
|
||||
|
|
@ -461,7 +461,7 @@ In this examples we use `<base href="/base/index.html" />`
|
|||
|
||||
function initEnv(name) {
|
||||
var root = angular.element(document.getElementById(name + '-mode'));
|
||||
var scope = angular.scope(null, {
|
||||
var scope = angular.module.NG.$rootScope.Scope(null, {
|
||||
$locationConfig: {html5Mode: true, hashPrefix: '!'},
|
||||
$browser: browsers[name],
|
||||
$document: root,
|
||||
|
|
@ -488,11 +488,11 @@ In this examples we use `<base href="/base/index.html" />`
|
|||
|
||||
The `$location` service allows you to change only the URL; it does not allow you to reload the
|
||||
page. When you need to change the URL and reload the page or navigate to a different page, please
|
||||
use a lower level API, {@link api/angular.service.$window $window.location.href}.
|
||||
use a lower level API, {@link api/angular.module.NG.$window $window.location.href}.
|
||||
|
||||
## Using $location outside of the scope life-cycle
|
||||
|
||||
`$location` knows about Angular's {@link api/angular.scope scope} life-cycle. When a URL changes in
|
||||
`$location` knows about Angular's {@link api/angular.module.NG.$rootScope.Scope scope} life-cycle. When a URL changes in
|
||||
the browser it updates the `$location` and calls `$apply` so that all $watchers / $observers are
|
||||
notified.
|
||||
When you change the `$location` inside the `$digest` phase everything is ok; `$location` will
|
||||
|
|
@ -512,10 +512,10 @@ hashPrefix.
|
|||
# Testing with the $location service
|
||||
|
||||
When using `$location` service during testing, you are outside of the angular's {@link
|
||||
api/angular.scope scope} life-cycle. This means it's your responsibility to call `scope.$apply()`.
|
||||
api/angular.module.NG.$rootScope.Scope scope} life-cycle. This means it's your responsibility to call `scope.$apply()`.
|
||||
|
||||
<pre>
|
||||
angular.service('$serviceUnderTest', function($location) {
|
||||
angular.module.NG('$serviceUnderTest', function($location) {
|
||||
// whatever it does...
|
||||
};
|
||||
|
||||
|
|
@ -523,7 +523,7 @@ describe('$serviceUnderTest', function() {
|
|||
var scope, $location, $sut;
|
||||
|
||||
beforeEach(function() {
|
||||
scope = angular.scope();
|
||||
scope = angular.module.NG.$rootScope.Scope();
|
||||
$location = scope.$service('$location');
|
||||
$sut = scope.$service('$serviceUnderTest');
|
||||
});
|
||||
|
|
@ -636,7 +636,7 @@ this.$watch('$location.path()', function(scope, path) {
|
|||
|
||||
# Related API
|
||||
|
||||
* {@link api/angular.service.$location $location API}
|
||||
* {@link api/angular.module.NG.$location $location API}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ While angular offers several useful services, for any nontrivial application you
|
|||
to write your own custom services. To do this you begin by registering a service factory function
|
||||
that angular's DI will use to create the service object when it is needed.
|
||||
|
||||
The `angular.service` method accepts three parameters:
|
||||
The `angular.module.NG` method accepts three parameters:
|
||||
|
||||
- `{string} name` - Name of the service.
|
||||
- `{function()} factory` - Factory function(called just once by DI).
|
||||
|
|
@ -32,7 +32,7 @@ stores all notifications; after the third one, the service displays all of the n
|
|||
window alert.
|
||||
|
||||
<pre>
|
||||
angular.service('notify', function(win) {
|
||||
angular.module.NG('notify', function(win) {
|
||||
var msgs = [];
|
||||
return function(msg) {
|
||||
msgs.push(msg);
|
||||
|
|
@ -55,4 +55,4 @@ window alert.
|
|||
|
||||
## Related API
|
||||
|
||||
* {@link api/angular.service Angular Service API}
|
||||
* {@link api/angular.module.NG Angular Service API}
|
||||
|
|
|
|||
|
|
@ -77,4 +77,4 @@ it('should test service', function() {
|
|||
|
||||
## Related API
|
||||
|
||||
{@link api/angular.service Angular Service API}
|
||||
{@link api/angular.module.NG Angular Service API}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ provided by angular's web framework:
|
|||
*
|
||||
* @param {*} message Message to be logged.
|
||||
*/
|
||||
angular.service('batchLog', function($defer, $log) {
|
||||
angular.module.NG('batchLog', function($defer, $log) {
|
||||
var messageQueue = [];
|
||||
|
||||
function log() {
|
||||
|
|
@ -43,7 +43,7 @@ angular.service('batchLog', function($defer, $log) {
|
|||
* routeTemplateMonitor monitors each $route change and logs the current
|
||||
* template via the batchLog service.
|
||||
*/
|
||||
angular.service('routeTemplateMonitor', function($route, batchLog) {
|
||||
angular.module.NG('routeTemplateMonitor', function($route, batchLog) {
|
||||
this.$on('$afterRouteChange', function() {
|
||||
batchLog($route.current ? $route.current.template : null);
|
||||
});
|
||||
|
|
@ -52,10 +52,10 @@ angular.service('routeTemplateMonitor', function($route, batchLog) {
|
|||
|
||||
Things to notice in this example:
|
||||
|
||||
* The `batchLog` service depends on the built-in {@link api/angular.service.$defer $defer} and
|
||||
{@link api/angular.service.$log $log} services, and allows messages to be logged into the
|
||||
* The `batchLog` service depends on the built-in {@link api/angular.module.NG.$defer $defer} and
|
||||
{@link api/angular.module.NG.$log $log} services, and allows messages to be logged into the
|
||||
`console.log` in batches.
|
||||
* The `routeTemplateMonitor` service depends on the built-in {@link api/angular.service.$route
|
||||
* The `routeTemplateMonitor` service depends on the built-in {@link api/angular.module.NG.$route
|
||||
$route} service as well as our custom `batchLog` service.
|
||||
* The `routeTemplateMonitor` service is declared to be eager, so that it is started as soon as the
|
||||
application starts.
|
||||
|
|
@ -80,5 +80,5 @@ order to inject.
|
|||
|
||||
## Related API
|
||||
|
||||
* {@link api/angular.service Angular Service API}
|
||||
* {@link api/angular.module.NG Angular Service API}
|
||||
* {@link api/angular.injector Angular Injector API}
|
||||
|
|
|
|||
|
|
@ -19,4 +19,4 @@ most often used with {@link dev_guide.di dependency injection}, also a key featu
|
|||
|
||||
## Related API
|
||||
|
||||
* {@link api/angular.service Angular Service API}
|
||||
* {@link api/angular.module.NG Angular Service API}
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
@description
|
||||
|
||||
To register a service, register a factory function that creates the service with angular's
|
||||
Injector. The Injector is exposed as {@link api/angular.scope.$service scope.$service}. The
|
||||
Injector. The Injector is exposed as {@link api/angular.module.NG.$rootScope.Scope#$service scope.$service}. The
|
||||
following pseudo-code shows a simple service registration:
|
||||
|
||||
<pre>
|
||||
angular.service('service id', function() {
|
||||
angular.module.NG('service id', function() {
|
||||
var shinyNewServiceInstance;
|
||||
//factory function body that constructs shinyNewServiceInstance
|
||||
return shinyNewServiceInstance;
|
||||
|
|
@ -30,7 +30,7 @@ which happens when the angular {@link dev_guide.bootstrap application initialize
|
|||
To override the default, you can request that a service is eagerly instantiated as follows:
|
||||
|
||||
<pre>
|
||||
angular.service('service id', function() {
|
||||
angular.module.NG('service id', function() {
|
||||
var shinyNewServiceInstance;
|
||||
//factory function body that constructs shinyNewServiceInstance
|
||||
return shinyNewServiceInstance;
|
||||
|
|
@ -66,4 +66,4 @@ important.
|
|||
|
||||
## Related API
|
||||
|
||||
* {@link api/angular.service Angular Service API}
|
||||
* {@link api/angular.module.NG Angular Service API}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ var mock, notify;
|
|||
|
||||
beforeEach(function() {
|
||||
mock = {alert: jasmine.createSpy()};
|
||||
notify = angular.service('notify')(mock);
|
||||
notify = angular.module.NG('notify')(mock);
|
||||
});
|
||||
|
||||
it('should not alert first two notifications', function() {
|
||||
|
|
@ -53,6 +53,6 @@ it('should clear messages after alert', function() {
|
|||
|
||||
## Related API
|
||||
|
||||
* {@link api/angular.service Angular Service API}
|
||||
* {@link api/angular.module.NG Angular Service API}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
@description
|
||||
|
||||
Angular services are singletons that carry out specific tasks common to web apps, such as the
|
||||
{@link api/angular.service.$xhr $xhr service} that provides low level access to the browser's
|
||||
{@link api/angular.module.NG.$xhr $xhr service} that provides low level access to the browser's
|
||||
`XMLHttpRequest` object.
|
||||
|
||||
To use an angular service, you identify it as a dependency for the dependent (a controller, or
|
||||
|
|
@ -33,5 +33,5 @@ above). You can also create your own custom services.
|
|||
|
||||
## Related API
|
||||
|
||||
* {@link api/angular.service Angular Service API}
|
||||
* {@link api/angular.module.NG Angular Service API}
|
||||
* {@link api/angular.injector Injector API}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
@name Developer Guide: Templates: Filters: Creating Angular Filters
|
||||
@description
|
||||
|
||||
Writing your own filter is very easy: just define a JavaScript function on the `angular.filter`
|
||||
Writing your own filter is very easy: just define a JavaScript function on the `angular.module.NG.$filter`
|
||||
object.
|
||||
The framework passes in the input value as the first argument to your function. Any filter
|
||||
arguments are passed in as additional function arguments.
|
||||
|
|
@ -19,9 +19,9 @@ text upper-case and assigns color.
|
|||
<doc:example>
|
||||
<doc:source>
|
||||
<script type="text/javascript">
|
||||
angular.module.MyReverseModule = function MyModule($provide) {
|
||||
$provide.filter('reverse', function() {
|
||||
return function(input, uppercase, color) {
|
||||
angular.module.MyReverseModule = function MyModule($filterProvider) {
|
||||
$filterProvider.register('reverse', function() {
|
||||
return function(input, uppercase) {
|
||||
var out = "";
|
||||
for (var i = 0; i < input.length; i++) {
|
||||
out = input.charAt(i) + out;
|
||||
|
|
@ -30,10 +30,6 @@ angular.module.MyReverseModule = function MyModule($provide) {
|
|||
if (uppercase) {
|
||||
out = out.toUpperCase();
|
||||
}
|
||||
// DOM manipulation using $element
|
||||
if (color) {
|
||||
this.$element.css('color', color);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
});
|
||||
|
|
@ -49,7 +45,6 @@ angular.module.MyReverseModule = function MyModule($provide) {
|
|||
No filter: {{greeting}}<br>
|
||||
Reverse: {{greeting|reverse}}<br>
|
||||
Reverse + uppercase: {{greeting|reverse:true}}<br>
|
||||
Reverse + uppercase + blue: {{greeting|reverse:true:"blue"}}
|
||||
</div>
|
||||
</doc:source>
|
||||
<doc:scenario>
|
||||
|
|
@ -69,4 +64,4 @@ angular.module.MyReverseModule = function MyModule($provide) {
|
|||
|
||||
## Related API
|
||||
|
||||
* {@link api/angular.filter Angular Filter API}
|
||||
* {@link api/angular.module.NG.$filter Angular Filter API}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ displaying it to the user. You can pass expressions through a chain of filters l
|
|||
|
||||
name | uppercase
|
||||
|
||||
The expression evaluator simply passes the value of name to `angular.filter.uppercase()`.
|
||||
The expression evaluator simply passes the value of name to `angular.module.NG.$filter.uppercase()`.
|
||||
|
||||
In addition to formatting data, filters can also modify the DOM. This allows filters to handle
|
||||
tasks such as conditionally applying CSS styles to filtered output.
|
||||
|
|
@ -24,4 +24,4 @@ tasks such as conditionally applying CSS styles to filtered output.
|
|||
|
||||
## Related API
|
||||
|
||||
* {@link api/angular.filter Angular Filter API}
|
||||
* {@link api/angular.module.NG.$filter Angular Filter API}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
@name Developer Guide: Templates: Filters: Using Angular Filters
|
||||
@description
|
||||
|
||||
Filters can be part of any {@link api/angular.scope} evaluation but are typically used to format
|
||||
Filters can be part of any {@link api/angular.module.NG.$rootScope.Scope} evaluation but are typically used to format
|
||||
expressions in bindings in your templates:
|
||||
|
||||
{{ expression | filter }}
|
||||
|
|
@ -37,4 +37,4 @@ argument that specifies how many digits to display to the right of the decimal p
|
|||
|
||||
## Related API
|
||||
|
||||
* {@link api/angular.filter Angular Filter API}
|
||||
* {@link api/angular.module.NG.$filter Angular Filter API}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ and {@link dev_guide.expressions expressions}:
|
|||
In a simple single-page app, the template consists of HTML, CSS, and angular directives contained
|
||||
in just one HTML file (usually `index.html`). In a more complex app, you can display multiple views
|
||||
within one main page using "partials", which are segments of template located in separate HTML
|
||||
files. You "include" the partials in the main page using the {@link api/angular.service.$route
|
||||
files. You "include" the partials in the main page using the {@link api/angular.module.NG.$route
|
||||
$route} service in conjunction with the {@link api/angular.widget.ng:view ng:view} directive. An
|
||||
example of this technique is shown in the {@link tutorial/ angular tutorial}, in steps seven and
|
||||
eight.
|
||||
|
|
|
|||
|
|
@ -247,16 +247,16 @@ that such a test tells a story, rather then asserting random bits which don't se
|
|||
|
||||
|
||||
## Filters
|
||||
{@link api/angular.filter Filters} are functions which transform the data into user readable
|
||||
{@link api/angular.module.NG.$filter Filters} are functions which transform the data into user readable
|
||||
format. They are important because they remove the formatting responsibility from the application
|
||||
logic, further simplifying the application logic.
|
||||
|
||||
<pre>
|
||||
angular.filter('length', function(text){
|
||||
angular.module.NG.$filter('length', function(text){
|
||||
return (''+(text||'')).length;
|
||||
});
|
||||
|
||||
var length = angular.filter('length');
|
||||
var length = angular.module.NG.$filter('length');
|
||||
expect(length(null)).toEqual(0);
|
||||
expect(length('abc')).toEqual(3);
|
||||
</pre>
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ manipulate the DOM.
|
|||
### What is testability like in angular?
|
||||
|
||||
Very testable. It has an integrated dependency injection framework. See
|
||||
{@link api/angular.service service} for details.
|
||||
{@link api/angular.module.NG service} for details.
|
||||
|
||||
### How can I learn more about angular?
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ contained in the template, data model, and controller, to keep models and views
|
|||
sync. Any changes made to the model are reflected in the view; any changes that occur in the view
|
||||
are reflected in the model.
|
||||
|
||||
To learn more about Angular scopes, see the {@link api/angular.scope angular scope documentation}.
|
||||
To learn more about Angular scopes, see the {@link api/angular.module.NG.$rootScope.Scope angular scope documentation}.
|
||||
|
||||
|
||||
## Tests
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ __`app/index.html`:__
|
|||
...
|
||||
</pre>
|
||||
|
||||
We added a standard HTML `<input>` tag and used angular's {@link api/angular.Array.filter $filter}
|
||||
We added a standard HTML `<input>` tag and used angular's {@link api/angular.module.NG.$filter.filter $filter}
|
||||
function to process the input for the `ng:repeater`.
|
||||
|
||||
This lets a user enter search criteria and immediately see the effects of their search on the phone
|
||||
|
|
@ -59,7 +59,7 @@ the DOM to reflect the current state of the model.
|
|||
|
||||
<img src="img/tutorial/tutorial_03_final.png">
|
||||
|
||||
* Use of `$filter`. The {@link api/angular.Array.filter $filter} method uses the `query` value to
|
||||
* Use of `$filter`. The {@link api/angular.module.NG.$filter.filter $filter} method uses the `query` value to
|
||||
create a new array that contains only those records that match the `query`.
|
||||
|
||||
`ng:repeat` automatically updates the view in response to the changing number of phones returned
|
||||
|
|
|
|||
|
|
@ -54,9 +54,9 @@ two provided sorting options.
|
|||
|
||||
<img src="img/tutorial/tutorial_04-06_final.png">
|
||||
|
||||
* We then chained the `$filter` method with {@link api/angular.Array.orderBy `$orderBy`} method to
|
||||
* We then chained the `$filter` method with {@link api/angular.module.NG.$filter.orderBy `$orderBy`} method to
|
||||
further process the input into the repeater. `$orderBy` is a utility method similar to {@link
|
||||
api/angular.Array.filter `$filter`}, but instead of filtering an array, it reorders it.
|
||||
api/angular.module.NG.$filter.filter `$filter`}, but instead of filtering an array, it reorders it.
|
||||
|
||||
Angular creates a two way data-binding between the select element and the `orderProp` model.
|
||||
`orderProp` is then used as the input for the `$orderBy` method.
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
|
||||
Enough of building an app with three phones in a hard-coded dataset! Let's fetch a larger dataset
|
||||
from our server using one of angular's built-in {@link api/angular.service services} called {@link
|
||||
api/angular.service.$xhr $xhr}. We will use angular's {@link guide/dev_guide.di dependency
|
||||
from our server using one of angular's built-in {@link api/angular.module.NG services} called {@link
|
||||
api/angular.module.NG.$xhr $xhr}. We will use angular's {@link guide/dev_guide.di dependency
|
||||
injection (DI)} to provide the service to the `PhoneListCtrl` controller.
|
||||
|
||||
|
||||
|
|
@ -42,9 +42,9 @@ Following is a sample of the file:
|
|||
|
||||
## Controller
|
||||
|
||||
We'll use angular's {@link api/angular.service.$xhr $xhr} service in our controller to make an HTTP
|
||||
We'll use angular's {@link api/angular.module.NG.$xhr $xhr} service in our controller to make an HTTP
|
||||
request to your web server to fetch the data in the `app/phones/phones.json` file. `$xhr` is just
|
||||
one of several built-in {@link api/angular.service angular services} that handle common operations
|
||||
one of several built-in {@link api/angular.module.NG angular services} that handle common operations
|
||||
in web apps. Angular injects these services for you where you need them.
|
||||
|
||||
Services are managed by angular's {@link guide/dev_guide.di DI subsystem}. Dependency injection
|
||||
|
|
@ -127,7 +127,7 @@ describe('PhoneCat controllers', function() {
|
|||
var scope, $browser, ctrl;
|
||||
|
||||
beforeEach(function() {
|
||||
scope = angular.scope();
|
||||
scope = angular.module.NG.$rootScope.Scope();
|
||||
$browser = scope.$service('$browser');
|
||||
|
||||
$browser.xhr.expectGET('phones/phones.json')
|
||||
|
|
@ -140,7 +140,7 @@ describe('PhoneCat controllers', function() {
|
|||
|
||||
We created the controller in the test environment, as follows:
|
||||
|
||||
* We created a root scope object by calling `angular.scope()`
|
||||
* We created a root scope object by calling `angular.module.NG.$rootScope.Scope()`
|
||||
|
||||
* We called `scope.$new(PhoneListCtrl)` to get angular to create the child scope associated with
|
||||
the `PhoneListCtrl` controller
|
||||
|
|
@ -149,7 +149,7 @@ Because our code now uses the `$xhr` service to fetch the phone list data in our
|
|||
we create the `PhoneListCtrl` child scope, we need to tell the testing harness to expect an
|
||||
incoming request from the controller. To do this we:
|
||||
|
||||
* Use the {@link api/angular.scope.$service `$service`} method to retrieve the `$browser` service,
|
||||
* Use the {@link api/angular.module.NG.$rootScope.Scope#$service `$service`} method to retrieve the `$browser` service,
|
||||
a service that angular uses to represent various browser APIs. In tests, angular automatically uses
|
||||
a mock version of this service that allows you to write tests without having to deal with these
|
||||
native APIs and the global state associated with them.
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ template into what we call a "layout template". This is a template that is commo
|
|||
our application. Other "partial templates" are then included into this layout template depending on
|
||||
the current "route" — the view that is currently displayed to the user.
|
||||
|
||||
Application routes in angular are declared via the {@link api/angular.service.$route $route}
|
||||
Application routes in angular are declared via the {@link api/angular.module.NG.$route $route}
|
||||
service. This service makes it easy to wire together controllers, view templates, and the current
|
||||
URL location in the browser. Using this feature we can implement {@link
|
||||
http://en.wikipedia.org/wiki/Deep_linking deep linking}, which lets us utilize the browser's
|
||||
|
|
@ -91,7 +91,7 @@ Note the use of the `:phoneId` parameter in the second route declaration. The `$
|
|||
the route declaration — `'/phones/:phoneId'` — as a template that is matched against the current
|
||||
URL. All variables defined with the `:` notation are extracted into the `$route.current.params` map.
|
||||
|
||||
The `params` alias created in the {@link api/angular.service.$route `$route.onChange`} callback
|
||||
The `params` alias created in the {@link api/angular.module.NG.$route `$route.onChange`} callback
|
||||
allows us to use the `phoneId` property of this map in the `phone-details.html` template.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ phone in the phone list.
|
|||
Now when you click on a phone on the list, the phone details page with phone-specific information
|
||||
is displayed.
|
||||
|
||||
To implement the phone details view we will use {@link api/angular.service.$xhr $xhr} to fetch our
|
||||
To implement the phone details view we will use {@link api/angular.module.NG.$xhr $xhr} to fetch our
|
||||
data, and we'll flesh out the `phone-details.html` view template.
|
||||
|
||||
The most important changes are listed below. You can see the full diff on {@link
|
||||
|
|
|
|||
|
|
@ -25,11 +25,11 @@ GitHub}:
|
|||
## Custom Filter
|
||||
|
||||
In order to create a new filter, simply register your custom filter function with the {@link
|
||||
api/angular.filter `angular.filter`} API.
|
||||
api/angular.module.NG.$filter `angular.module.NG.$filter`} API.
|
||||
|
||||
__`app/js/filters.js`:__
|
||||
<pre>
|
||||
angular.filter('checkmark', function(input) {
|
||||
angular.module.NG.$filter('checkmark', function(input) {
|
||||
return input ? '\u2713' : '\u2718';
|
||||
});
|
||||
</pre>
|
||||
|
|
@ -82,8 +82,8 @@ __`test/unit/filtersSpec.js`:__
|
|||
describe('checkmark filter', function() {
|
||||
|
||||
it('should convert boolean values to unicode checkmark or cross', function() {
|
||||
expect(angular.filter.checkmark(true)).toBe('\u2713');
|
||||
expect(angular.filter.checkmark(false)).toBe('\u2718');
|
||||
expect(angular.module.NG.$filter.checkmark(true)).toBe('\u2713');
|
||||
expect(angular.module.NG.$filter.checkmark(false)).toBe('\u2718');
|
||||
});
|
||||
})
|
||||
</pre>
|
||||
|
|
@ -99,7 +99,7 @@ output.
|
|||
|
||||
# Experiments
|
||||
|
||||
* Let's experiment with some of the {@link api/angular.filter built-in angular filters} and add the
|
||||
* Let's experiment with some of the {@link api/angular.module.NG.$filter built-in angular filters} and add the
|
||||
following bindings to `index.html`:
|
||||
* `{{ "lower cap string" | uppercase }}`
|
||||
* `{{ {foo: "bar", baz: 23} | json }}`
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ In this step, you will improve the way our app fetches data.
|
|||
The last improvement we will make to our app is to define a custom service that represents a {@link
|
||||
http://en.wikipedia.org/wiki/Representational_State_Transfer RESTful} client. Using this client we
|
||||
can make xhr requests for data in an easier way, without having to deal with the lower-level {@link
|
||||
api/angular.service.$xhr $xhr} API, HTTP methods and URLs.
|
||||
api/angular.module.NG.$xhr $xhr} API, HTTP methods and URLs.
|
||||
|
||||
The most important changes are listed below. You can see the full diff on {@link
|
||||
https://github.com/angular/angular-phonecat/compare/step-10...step-11
|
||||
|
|
@ -37,30 +37,30 @@ __`app/index.html`.__
|
|||
|
||||
__`app/js/services.js`.__
|
||||
<pre>
|
||||
angular.service('Phone', function($resource) {
|
||||
angular.module.NG('Phone', function($resource) {
|
||||
return $resource('phones/:phoneId.json', {}, {
|
||||
query: {method: 'GET', params: {phoneId: 'phones'}, isArray: true}
|
||||
});
|
||||
});
|
||||
</pre>
|
||||
|
||||
We used the {@link api/angular.service} API to register a custom service. We passed in the name of
|
||||
We used the {@link api/angular.module.NG} API to register a custom service. We passed in the name of
|
||||
the service - 'Phone' - and a factory function. The factory function is similar to a controller's
|
||||
constructor in that both can declare dependencies via function arguments. The Phone service
|
||||
declared a dependency on the `$resource` service.
|
||||
|
||||
The {@link api/angular.service.$resource `$resource`} service makes it easy to create a {@link
|
||||
The {@link api/angular.module.NG.$resource `$resource`} service makes it easy to create a {@link
|
||||
http://en.wikipedia.org/wiki/Representational_State_Transfer RESTful} client with just a few lines
|
||||
of code. This client can then be used in our application, instead of the lower-level {@link
|
||||
api/angular.service.$xhr $xhr} service.
|
||||
api/angular.module.NG.$xhr $xhr} service.
|
||||
|
||||
|
||||
## Controller
|
||||
|
||||
We simplified our sub-controllers (`PhoneListCtrl` and `PhoneDetailCtrl`) by factoring out the
|
||||
lower-level {@link api/angular.service.$xhr $xhr} service, replacing it with a new service called
|
||||
`Phone`. Angular's {@link api/angular.service.$resource `$resource`} service is easier to use than
|
||||
{@link api/angular.service.$xhr $xhr} for interacting with data sources exposed as RESTful
|
||||
lower-level {@link api/angular.module.NG.$xhr $xhr} service, replacing it with a new service called
|
||||
`Phone`. Angular's {@link api/angular.module.NG.$resource `$resource`} service is easier to use than
|
||||
{@link api/angular.module.NG.$xhr $xhr} for interacting with data sources exposed as RESTful
|
||||
resources. It is also easier now to understand what the code in our controllers is doing.
|
||||
|
||||
__`app/js/controllers.js`.__
|
||||
|
|
@ -116,7 +116,7 @@ We have modified our unit tests to verify that our new service is issuing HTTP r
|
|||
processing them as expected. The tests also check that our controllers are interacting with the
|
||||
service correctly.
|
||||
|
||||
The {@link api/angular.service.$resource $resource} service augments the response object with
|
||||
The {@link api/angular.module.NG.$resource $resource} service augments the response object with
|
||||
methods for updating and deleting the resource. If we were to use the standard `toEqual` matcher,
|
||||
our tests would fail because the test values would not match the responses exactly. To solve the
|
||||
problem, we use a newly-defined `toEqualData` {@link
|
||||
|
|
@ -141,7 +141,7 @@ describe('PhoneCat controllers', function() {
|
|||
var scope, $browser, ctrl;
|
||||
|
||||
beforeEach(function() {
|
||||
scope = angular.scope();
|
||||
scope = angular.module.NG.$rootScope.Scope();
|
||||
$browser = scope.$service('$browser');
|
||||
|
||||
$browser.xhr.expectGET('phones/phones.json')
|
||||
|
|
@ -167,12 +167,12 @@ describe('PhoneCat controllers', function() {
|
|||
var scope, $browser, ctrl;
|
||||
|
||||
beforeEach(function() {
|
||||
scope = angular.scope();
|
||||
scope = angular.module.NG.$rootScope.Scope();
|
||||
$browser = scope.$service('$browser');
|
||||
});
|
||||
|
||||
beforeEach(function() {
|
||||
scope = angular.scope();
|
||||
scope = angular.module.NG.$rootScope.Scope();
|
||||
$browser = scope.$service('$browser');
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -255,17 +255,17 @@ describe('ngdoc', function() {
|
|||
|
||||
describe('merge', function() {
|
||||
it('should merge child with parent', function() {
|
||||
var parent = new Doc({id: 'angular.service.abc', name: 'angular.service.abc', section: 'api'});
|
||||
var methodA = new Doc({name: 'methodA', methodOf: 'angular.service.abc'});
|
||||
var methodB = new Doc({name: 'methodB', methodOf: 'angular.service.abc'});
|
||||
var propA = new Doc({name: 'propA', propertyOf: 'angular.service.abc'});
|
||||
var propB = new Doc({name: 'propB', propertyOf: 'angular.service.abc'});
|
||||
var eventA = new Doc({name: 'eventA', eventOf: 'angular.service.abc'});
|
||||
var eventB = new Doc({name: 'eventB', eventOf: 'angular.service.abc'});
|
||||
var parent = new Doc({id: 'angular.module.NG.abc', name: 'angular.module.NG.abc', section: 'api'});
|
||||
var methodA = new Doc({name: 'methodA', methodOf: 'angular.module.NG.abc'});
|
||||
var methodB = new Doc({name: 'methodB', methodOf: 'angular.module.NG.abc'});
|
||||
var propA = new Doc({name: 'propA', propertyOf: 'angular.module.NG.abc'});
|
||||
var propB = new Doc({name: 'propB', propertyOf: 'angular.module.NG.abc'});
|
||||
var eventA = new Doc({name: 'eventA', eventOf: 'angular.module.NG.abc'});
|
||||
var eventB = new Doc({name: 'eventB', eventOf: 'angular.module.NG.abc'});
|
||||
var docs = [methodB, methodA, eventB, eventA, propA, propB, parent]; // keep wrong order;
|
||||
ngdoc.merge(docs);
|
||||
expect(docs.length).toEqual(1);
|
||||
expect(docs[0].id).toEqual('angular.service.abc');
|
||||
expect(docs[0].id).toEqual('angular.module.NG.abc');
|
||||
expect(docs[0].methods).toEqual([methodA, methodB]);
|
||||
expect(docs[0].events).toEqual([eventA, eventB]);
|
||||
expect(docs[0].properties).toEqual([propA, propB]);
|
||||
|
|
@ -335,8 +335,8 @@ describe('ngdoc', function() {
|
|||
expect(doc.requires).toEqual([
|
||||
{name:'$service', text:'<p>for \n<code>A</code></p>'},
|
||||
{name:'$another', text:'<p>for <code>B</code></p>'}]);
|
||||
expect(doc.html()).toContain('<a href="api/angular.service.$service">$service</a>');
|
||||
expect(doc.html()).toContain('<a href="api/angular.service.$another">$another</a>');
|
||||
expect(doc.html()).toContain('<a href="api/angular.module.NG.$service">$service</a>');
|
||||
expect(doc.html()).toContain('<a href="api/angular.module.NG.$another">$another</a>');
|
||||
expect(doc.html()).toContain('<p>for \n<code>A</code></p>');
|
||||
expect(doc.html()).toContain('<p>for <code>B</code></p>');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ Doc.prototype = {
|
|||
}
|
||||
dom.h('Dependencies', self.requires, function(require){
|
||||
dom.tag('code', function() {
|
||||
dom.tag('a', {href: 'api/angular.service.' + require.name}, require.name);
|
||||
dom.tag('a', {href: 'api/angular.module.NG.' + require.name}, require.name);
|
||||
});
|
||||
dom.html(require.text);
|
||||
});
|
||||
|
|
@ -620,12 +620,12 @@ var KEYWORD_PRIORITY = {
|
|||
'.index': 1,
|
||||
'.guide': 2,
|
||||
'.angular': 7,
|
||||
'.angular.Array': 7,
|
||||
'.angular.module.NG.$filter': 7,
|
||||
'.angular.Object': 7,
|
||||
'.angular.directive': 7,
|
||||
'.angular.filter': 7,
|
||||
'.angular.scope': 7,
|
||||
'.angular.service': 7,
|
||||
'.angular.module.NG.$filter': 7,
|
||||
'.angular.module.NG.$rootScope.Scope': 7,
|
||||
'.angular.module.NG': 7,
|
||||
'.angular.inputType': 7,
|
||||
'.angular.widget': 7,
|
||||
'.angular.mock': 8,
|
||||
|
|
@ -724,7 +724,13 @@ function merge(docs){
|
|||
|
||||
// check links - do they exist ?
|
||||
doc.links.forEach(function(link) {
|
||||
if (!byFullId[link]) console.log('WARNING: In ' + doc.section + '/' + doc.id + ', non existing link: "' + link + '"');
|
||||
// convert #id to path#id
|
||||
if (link[0] == '#') {
|
||||
link = doc.section + '/' + doc.id.split('#').shift() + link;
|
||||
}
|
||||
if (!byFullId[link]) {
|
||||
console.log('WARNING: In ' + doc.section + '/' + doc.id + ', non existing link: "' + link + '"');
|
||||
}
|
||||
});
|
||||
|
||||
// merge into parents
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
angular.service('myApplication', function($resource){
|
||||
angular.module.NG('myApplication', function($resource){
|
||||
this.Activity = $resource(
|
||||
'https://www.googleapis.com/buzz/v1/activities/:userId/:visibility/:activityId/:comments',
|
||||
{alt:'json', callback:'JSON_CALLBACK'},
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<title>angular dev sandbox</title>
|
||||
<script src="../src/angular-bootstrap.js" ng:autobind></script>
|
||||
<script>
|
||||
angular.service('routeConfig', function($route) {
|
||||
angular.module.NG('routeConfig', function($route) {
|
||||
$route.when('/view1', {controller: MyCtrl, template: 'view1.html'});
|
||||
$route.when('/view2', {controller: MyCtrl, template: 'view2.html'});
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<script type="text/javascript" src="../src/angular-bootstrap.js" ng:autobind></script>
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
angular.service('myService', function($resource){
|
||||
angular.module.NG('myService', function($resource){
|
||||
this.myData = $resource('resource_json_date.json');
|
||||
}, {$inject:['$resource'], $creation:'eager'});
|
||||
|
||||
|
|
@ -27,4 +27,4 @@
|
|||
<p>Parsed date: {{ jsonData.reportDate }} (A date should be displayed here)</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -99,9 +99,9 @@ var $$scope = '$scope',
|
|||
angularDirective = extensionMap(angular, 'directive', lowercase),
|
||||
/** @name angular.widget */
|
||||
angularWidget = extensionMap(angular, 'widget', shivForIE),
|
||||
/** @name angular.service */
|
||||
/** @name angular.module.NG */
|
||||
angularInputType = extensionMap(angular, 'inputType', lowercase),
|
||||
/** @name angular.service */
|
||||
/** @name angular.module.NG */
|
||||
angularCallbacks = extensionMap(angular, 'callbacks'),
|
||||
nodeName_,
|
||||
uid = ['0', '0', '0'],
|
||||
|
|
@ -571,7 +571,7 @@ function isLeafNode (node) {
|
|||
* * If `source` is not an object or array, `source` is returned.
|
||||
*
|
||||
* Note: this function is used to augment the Object type in Angular expressions. See
|
||||
* {@link angular.Array} for more information about Angular arrays.
|
||||
* {@link angular.module.NG.$filter} for more information about Angular arrays.
|
||||
*
|
||||
* @param {*} source The source that will be used to make a copy.
|
||||
* Can be any type, including primitives, `null`, and `undefined`.
|
||||
|
|
@ -629,7 +629,7 @@ function copy(source, destination){
|
|||
* that begin with `$` are ignored.
|
||||
*
|
||||
* Note: This function is used to augment the Object type in Angular expressions. See
|
||||
* {@link angular.Array} for more information about Angular arrays.
|
||||
* {@link angular.module.NG.$filter} for more information about Angular arrays.
|
||||
*
|
||||
* @param {*} o1 Object or value to compare.
|
||||
* @param {*} o2 Object or value to compare.
|
||||
|
|
|
|||
10
src/angular-mocks.js
vendored
10
src/angular-mocks.js
vendored
|
|
@ -149,7 +149,7 @@ angular.module.NG_MOCK.$Browser = function() {
|
|||
* @param {string} url Url path for which a request is expected.
|
||||
* @returns {object} Response configuration object. You can call its `respond()` method to
|
||||
* configure what should the browser mock return when the response is
|
||||
* {@link angular.module.NG_MOCK.$browser.xhr.flush flushed}.
|
||||
* {@link angular.module.NG_MOCK.$browser#xhr.flush flushed}.
|
||||
*/
|
||||
self.xhr.expectGET = angular.bind(self, self.xhr.expect, 'GET');
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ angular.module.NG_MOCK.$Browser = function() {
|
|||
* @param {string} url Url path for which a request is expected.
|
||||
* @returns {object} Response configuration object. You can call its `respond()` method to
|
||||
* configure what should the browser mock return when the response is
|
||||
* {@link angular.module.NG_MOCK.$browser.xhr.flush flushed}.
|
||||
* {@link angular.module.NG_MOCK.$browser#xhr.flush flushed}.
|
||||
*/
|
||||
self.xhr.expectPOST = angular.bind(self, self.xhr.expect, 'POST');
|
||||
|
||||
|
|
@ -179,7 +179,7 @@ angular.module.NG_MOCK.$Browser = function() {
|
|||
* @param {string} url Url path for which a request is expected.
|
||||
* @returns {object} Response configuration object. You can call its `respond()` method to
|
||||
* configure what should the browser mock return when the response is
|
||||
* {@link angular.module.NG_MOCK.$browser.xhr.flush flushed}.
|
||||
* {@link angular.module.NG_MOCK.$browser#xhr.flush flushed}.
|
||||
*/
|
||||
self.xhr.expectDELETE = angular.bind(self, self.xhr.expect, 'DELETE');
|
||||
|
||||
|
|
@ -194,7 +194,7 @@ angular.module.NG_MOCK.$Browser = function() {
|
|||
* @param {string} url Url path for which a request is expected.
|
||||
* @returns {object} Response configuration object. You can call its `respond()` method to
|
||||
* configure what should the browser mock return when the response is
|
||||
* {@link angular.module.NG_MOCK.$browser.xhr.flush flushed}.
|
||||
* {@link angular.module.NG_MOCK.$browser#xhr.flush flushed}.
|
||||
*/
|
||||
self.xhr.expectPUT = angular.bind(self, self.xhr.expect, 'PUT');
|
||||
|
||||
|
|
@ -209,7 +209,7 @@ angular.module.NG_MOCK.$Browser = function() {
|
|||
* @param {string} url Url path for which a request is expected.
|
||||
* @returns {object} Response configuration object. You can call its `respond()` method to
|
||||
* configure what should the browser mock return when the response is
|
||||
* {@link angular.module.NG_MOCK.$browser.xhr.flush flushed}.
|
||||
* {@link angular.module.NG_MOCK.$browser#xhr.flush flushed}.
|
||||
*/
|
||||
self.xhr.expectJSON = angular.bind(self, self.xhr.expect, 'JSON');
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ angularDirective("ng:init", function(expression){
|
|||
* * Controller — The `ng:controller` directive specifies a Controller class; the class has
|
||||
* methods that typically express the business logic behind the application.
|
||||
*
|
||||
* Note that an alternative way to define controllers is via the `{@link angular.service.$route}`
|
||||
* Note that an alternative way to define controllers is via the `{@link angular.module.NG.$route}`
|
||||
* service.
|
||||
*
|
||||
* @element ANY
|
||||
|
|
@ -138,7 +138,7 @@ angularDirective("ng:init", function(expression){
|
|||
this.contacts.push({type:'email', value:'yourname@example.org'});
|
||||
},
|
||||
removeContact: function(contactToRemove) {
|
||||
angular.Array.remove(this.contacts, contactToRemove);
|
||||
angular.module.NG.$filter.remove(this.contacts, contactToRemove);
|
||||
},
|
||||
clearContact: function(contact) {
|
||||
contact.type = 'phone';
|
||||
|
|
|
|||
|
|
@ -38,10 +38,10 @@ angular.scenario.dsl('sleep', function() {
|
|||
* browser().window.path() window.location.pathname
|
||||
* browser().window.search() window.location.search
|
||||
* browser().window.hash() window.location.hash without # prefix
|
||||
* browser().location().url() see angular.service.$location#url
|
||||
* browser().location().path() see angular.service.$location#path
|
||||
* browser().location().search() see angular.service.$location#search
|
||||
* browser().location().hash() see angular.service.$location#hash
|
||||
* browser().location().url() see angular.module.NG.$location#url
|
||||
* browser().location().path() see angular.module.NG.$location#path
|
||||
* browser().location().search() see angular.module.NG.$location#search
|
||||
* browser().location().hash() see angular.module.NG.$location#hash
|
||||
*/
|
||||
angular.scenario.dsl('browser', function() {
|
||||
var chain = {};
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ function $CompileProvider(){
|
|||
*
|
||||
* @description
|
||||
* Compiles a piece of HTML string or DOM into a template and produces a template function, which
|
||||
* can then be used to link {@link angular.scope scope} and the template together.
|
||||
* can then be used to link {@link angular.module.NG.$rootScope.Scope scope} and the template together.
|
||||
*
|
||||
* The compilation is a process of walking the DOM tree and trying to match DOM elements to
|
||||
* {@link angular.markup markup}, {@link angular.attrMarkup attrMarkup},
|
||||
|
|
@ -117,7 +117,7 @@ function $CompileProvider(){
|
|||
* @returns {function(scope[, cloneAttachFn])} a template function which is used to bind template
|
||||
* (a DOM element/tree) to a scope. Where:
|
||||
*
|
||||
* * `scope` - A {@link angular.scope Scope} to bind to.
|
||||
* * `scope` - A {@link angular.module.NG.$rootScope.Scope Scope} to bind to.
|
||||
* * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the
|
||||
* `template` and call the `cloneAttachFn` function allowing the caller to attach the
|
||||
* cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is
|
||||
|
|
@ -136,7 +136,7 @@ function $CompileProvider(){
|
|||
* bring the view to life, the scope needs to run through a $digest phase which typically is done by
|
||||
* Angular automatically, except for the case when an application is being
|
||||
* {@link guide/dev_guide.bootstrap.manual_bootstrap} manually bootstrapped, in which case the
|
||||
* $digest phase must be invoked by calling {@link angular.scope.$apply}.
|
||||
* $digest phase must be invoked by calling {@link angular.module.NG.$rootScope.Scope#$apply}.
|
||||
*
|
||||
* If you need access to the bound view, there are two ways to do it:
|
||||
*
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
* Selects a subset of items from `array` and returns it as a new array.
|
||||
*
|
||||
* Note: This function is used to augment the `Array` type in Angular expressions. See
|
||||
* {@link angular.Array} for more information about Angular arrays.
|
||||
* {@link angular.module.NG.$filter} for more information about Angular arrays.
|
||||
*
|
||||
* @param {Array} array The source array.
|
||||
* @param {string|Object|function()} expression The predicate to be used for selecting items from
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* value and sign (positive or negative) of `limit`.
|
||||
*
|
||||
* Note: This function is used to augment the `Array` type in Angular expressions. See
|
||||
* {@link angular.Array} for more information about Angular arrays.
|
||||
* {@link angular.module.NG.$filter} for more information about Angular arrays.
|
||||
*
|
||||
* @param {Array} array Source array to be limited.
|
||||
* @param {string|Number} limit The length of the returned array. If the `limit` number is
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
* Orders a specified `array` by the `expression` predicate.
|
||||
*
|
||||
* Note: this function is used to augment the `Array` type in Angular expressions. See
|
||||
* {@link angular.Array} for more informaton about Angular arrays.
|
||||
* {@link angular.module.NG.$filter} for more informaton about Angular arrays.
|
||||
*
|
||||
* @param {Array} array The array to sort.
|
||||
* @param {function(*)|string|Array.<(function(*)|string)>} expression A predicate to be
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* The form instance is a collection of widgets, and is responsible for life cycle and validation
|
||||
* of widget.
|
||||
*
|
||||
* Keep in mind that both form and widget instances are {@link api/angular.scope scopes}.
|
||||
* Keep in mind that both form and widget instances are {@link api/angular.module.NG.$rootScope.Scope scopes}.
|
||||
*
|
||||
* @param {Form=} parentForm The form which should be the parent form of the new form controller.
|
||||
* If none specified default to the `rootForm`.
|
||||
|
|
|
|||
|
|
@ -401,7 +401,6 @@ function locationGetterSetter(property, preprocess) {
|
|||
*
|
||||
* @requires $browser
|
||||
* @requires $sniffer
|
||||
* @requires $locationConfig
|
||||
* @requires $document
|
||||
*
|
||||
* @description
|
||||
|
|
@ -420,10 +419,25 @@ function locationGetterSetter(property, preprocess) {
|
|||
*
|
||||
* For more information see {@link guide/dev_guide.services.$location Developer Guide: Angular Services: Using $location}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ngdoc object
|
||||
* @name angular.module.NG.$locationProvider
|
||||
* @description
|
||||
* Use the `$locationPrvoder` to configure how the application deep linking paths are stored.
|
||||
*/
|
||||
function $LocationProvider(){
|
||||
var hashPrefix = '',
|
||||
html5Mode = false;
|
||||
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name angular.module.NG.$locationProvider#hashPrefix
|
||||
* @methodOf angular.module.NG.$locationProvider
|
||||
* @description
|
||||
* @param {string=} prefix Prefix for hash part (containing path and search)
|
||||
* @returns current value if used as getter or itself (chaining) if used as setter
|
||||
*/
|
||||
this.hashPrefix = function(prefix) {
|
||||
if (isDefined(prefix)) {
|
||||
hashPrefix = prefix;
|
||||
|
|
@ -433,6 +447,14 @@ function $LocationProvider(){
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name angular.module.NG.$locationProvider#hashPrefix
|
||||
* @propertyOf angular.module.NG.$locationProvider
|
||||
* @description
|
||||
* @param mode= Use HTML5 strategy if available.
|
||||
* @returns current value if used as getter or itself (chaining) if used as setter
|
||||
*/
|
||||
this.html5Mode = function(mode) {
|
||||
if (isDefined(mode)) {
|
||||
html5Mode = mode;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
* @name angular.module.NG.$rootScope
|
||||
* @description
|
||||
*
|
||||
* Every application has a single root {@link angular.model.NG.$rootScope.Scope scope}.
|
||||
* Every application has a single root {@link angular.module.NG.$rootScope.Scope scope}.
|
||||
* All other scopes are child scopes of the root scope. Scopes provide mechanism for watching the model and provide
|
||||
* event processing life-cycle. See {@link guide/dev_guide.scopes developer guide on scopes}.
|
||||
*/
|
||||
|
|
@ -43,8 +43,8 @@ function $RootScopeProvider(){
|
|||
*
|
||||
* @description
|
||||
* A root scope can be retrieved using the {@link angular.module.NG.$rootScope $rootScope} key from the
|
||||
* {@link angular.model.AUTO.$injector $injector}. Child scopes are created using the
|
||||
* {@link angular.module.NG.$rootScope.Scope.$new $new()} method. (Most scopes are created automatically when
|
||||
* {@link angular.module.AUTO.$injector $injector}. Child scopes are created using the
|
||||
* {@link angular.module.NG.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when
|
||||
* compiled HTML template is executed.)
|
||||
*
|
||||
* Here is a simple scope snippet to show how you can interact with the scope.
|
||||
|
|
@ -90,7 +90,7 @@ function $RootScopeProvider(){
|
|||
*
|
||||
*
|
||||
* @param {Object.<string, function()>=} providers Map of service factory which need to be provided
|
||||
* for the current scope. Defaults to {@link angular.service}.
|
||||
* for the current scope. Defaults to {@link angular.module.NG}.
|
||||
* @param {Object.<string, *>=} instanceCache Provides pre-instantiated services which should
|
||||
* append/override services provided by `providers`. This is handy when unit-testing and having
|
||||
* the need to override a default service.
|
||||
|
|
@ -126,11 +126,11 @@ function $RootScopeProvider(){
|
|||
*
|
||||
* @description
|
||||
* Creates a new child {@link angular.module.NG.$rootScope.Scope scope}. The new scope can optionally behave as a
|
||||
* controller. The parent scope will propagate the {@link angular.module.NG.$rootScope.Scope.$digest $digest()} and
|
||||
* {@link angular.module.NG.$rootScope.Scope.$digest $digest()} events. The scope can be removed from the scope
|
||||
* hierarchy using {@link angular.module.NG.$rootScope.Scope.$destroy $destroy()}.
|
||||
* controller. The parent scope will propagate the {@link angular.module.NG.$rootScope.Scope#$digest $digest()} and
|
||||
* {@link angular.module.NG.$rootScope.Scope#$digest $digest()} events. The scope can be removed from the scope
|
||||
* hierarchy using {@link angular.module.NG.$rootScope.Scope#$destroy $destroy()}.
|
||||
*
|
||||
* {@link angular.module.NG.$rootScope.Scope.$destroy $destroy()} must be called on a scope when it is desired for
|
||||
* {@link angular.module.NG.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is desired for
|
||||
* the scope and its child scopes to be permanently detached from the parent and thus stop
|
||||
* participating in model change detection and listener notification by invoking.
|
||||
*
|
||||
|
|
@ -182,10 +182,10 @@ function $RootScopeProvider(){
|
|||
* @description
|
||||
* Registers a `listener` callback to be executed whenever the `watchExpression` changes.
|
||||
*
|
||||
* - The `watchExpression` is called on every call to {@link angular.module.NG.$rootScope.Scope.$digest $digest()} and
|
||||
* should return the value which will be watched. (Since {@link angular.module.NG.$rootScope.Scope.$digest $digest()}
|
||||
* - The `watchExpression` is called on every call to {@link angular.module.NG.$rootScope.Scope#$digest $digest()} and
|
||||
* should return the value which will be watched. (Since {@link angular.module.NG.$rootScope.Scope#$digest $digest()}
|
||||
* reruns when it detects changes the `watchExpression` can execute multiple times per
|
||||
* {@link angular.module.NG.$rootScope.Scope.$digest $digest()} and should be idempotent.)
|
||||
* {@link angular.module.NG.$rootScope.Scope#$digest $digest()} and should be idempotent.)
|
||||
* - The `listener` is called only when the value from the current `watchExpression` and the
|
||||
* previous call to `watchExpression' are not equal. The inequality is determined according to
|
||||
* {@link angular.equals} function. To save the value of the object for later comparison
|
||||
|
|
@ -196,9 +196,9 @@ function $RootScopeProvider(){
|
|||
* limit is 100 to prevent infinity loop deadlock.
|
||||
*
|
||||
*
|
||||
* If you want to be notified whenever {@link angular.module.NG.$rootScope.Scope.$digest $digest} is called,
|
||||
* If you want to be notified whenever {@link angular.module.NG.$rootScope.Scope#$digest $digest} is called,
|
||||
* you can register an `watchExpression` function with no `listener`. (Since `watchExpression`,
|
||||
* can execute multiple times per {@link angular.module.NG.$rootScope.Scope.$digest $digest} cycle when a change is
|
||||
* can execute multiple times per {@link angular.module.NG.$rootScope.Scope#$digest $digest} cycle when a change is
|
||||
* detected, be prepared for multiple calls to your listener.)
|
||||
*
|
||||
*
|
||||
|
|
@ -224,7 +224,7 @@ function $RootScopeProvider(){
|
|||
*
|
||||
*
|
||||
* @param {(function()|string)} watchExpression Expression that is evaluated on each
|
||||
* {@link angular.module.NG.$rootScope.Scope.$digest $digest} cycle. A change in the return value triggers a
|
||||
* {@link angular.module.NG.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers a
|
||||
* call to the `listener`.
|
||||
*
|
||||
* - `string`: Evaluated as {@link guide/dev_guide.expressions expression}
|
||||
|
|
@ -268,19 +268,19 @@ function $RootScopeProvider(){
|
|||
* @function
|
||||
*
|
||||
* @description
|
||||
* Process all of the {@link angular.module.NG.$rootScope.Scope.$watch watchers} of the current scope and its children.
|
||||
* Because a {@link angular.module.NG.$rootScope.Scope.$watch watcher}'s listener can change the model, the
|
||||
* `$digest()` keeps calling the {@link angular.module.NG.$rootScope.Scope.$watch watchers} until no more listeners are
|
||||
* Process all of the {@link angular.module.NG.$rootScope.Scope#$watch watchers} of the current scope and its children.
|
||||
* Because a {@link angular.module.NG.$rootScope.Scope#$watch watcher}'s listener can change the model, the
|
||||
* `$digest()` keeps calling the {@link angular.module.NG.$rootScope.Scope#$watch watchers} until no more listeners are
|
||||
* firing. This means that it is possible to get into an infinite loop. This function will throw
|
||||
* `'Maximum iteration limit exceeded.'` if the number of iterations exceeds 100.
|
||||
*
|
||||
* Usually you don't call `$digest()` directly in
|
||||
* {@link angular.directive.ng:controller controllers} or in {@link angular.directive directives}.
|
||||
* Instead a call to {@link angular.module.NG.$rootScope.Scope.$apply $apply()} (typically from within a
|
||||
* Instead a call to {@link angular.module.NG.$rootScope.Scope#$apply $apply()} (typically from within a
|
||||
* {@link angular.directive directive}) will force a `$digest()`.
|
||||
*
|
||||
* If you want to be notified whenever `$digest()` is called,
|
||||
* you can register a `watchExpression` function with {@link angular.module.NG.$rootScope.Scope.$watch $watch()}
|
||||
* you can register a `watchExpression` function with {@link angular.module.NG.$rootScope.Scope#$watch $watch()}
|
||||
* with no `listener`.
|
||||
*
|
||||
* You may have a need to call `$digest()` from within unit-tests, to simulate the scope
|
||||
|
|
@ -388,11 +388,11 @@ function $RootScopeProvider(){
|
|||
*
|
||||
* @description
|
||||
* Remove the current scope (and all of its children) from the parent scope. Removal implies
|
||||
* that calls to {@link angular.module.NG.$rootScope.Scope.$digest $digest()} will no longer propagate to the current
|
||||
* that calls to {@link angular.module.NG.$rootScope.Scope#$digest $digest()} will no longer propagate to the current
|
||||
* scope and its children. Removal also implies that the current scope is eligible for garbage
|
||||
* collection.
|
||||
*
|
||||
* The destructing scope emits an `$destroy` {@link angular.module.NG.$rootScope.Scope.$emit event}.
|
||||
* The destructing scope emits an `$destroy` {@link angular.module.NG.$rootScope.Scope#$emit event}.
|
||||
*
|
||||
* The `$destroy()` is usually used by directives such as
|
||||
* {@link angular.widget.@ng:repeat ng:repeat} for managing the unrolling of the loop.
|
||||
|
|
@ -452,11 +452,11 @@ function $RootScopeProvider(){
|
|||
* The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only that:
|
||||
*
|
||||
* - it will execute in the current script execution context (before any DOM rendering).
|
||||
* - at least one {@link angular.module.NG.$rootScope.Scope.$digest $digest cycle} will be performed after
|
||||
* - at least one {@link angular.module.NG.$rootScope.Scope#$digest $digest cycle} will be performed after
|
||||
* `expression` execution.
|
||||
*
|
||||
* Any exceptions from the execution of the expression are forwarded to the
|
||||
* {@link angular.service.$exceptionHandler $exceptionHandler} service.
|
||||
* {@link angular.module.NG.$exceptionHandler $exceptionHandler} service.
|
||||
*
|
||||
* @param {(string|function())=} expression An angular expression to be executed.
|
||||
*
|
||||
|
|
@ -478,8 +478,8 @@ function $RootScopeProvider(){
|
|||
* `$apply()` is used to execute an expression in angular from outside of the angular framework.
|
||||
* (For example from browser DOM events, setTimeout, XHR or third party libraries).
|
||||
* Because we are calling into the angular framework we need to perform proper scope life-cycle
|
||||
* of {@link angular.service.$exceptionHandler exception handling},
|
||||
* {@link angular.module.NG.$rootScope.Scope.$digest executing watches}.
|
||||
* of {@link angular.module.NG.$exceptionHandler exception handling},
|
||||
* {@link angular.module.NG.$rootScope.Scope#$digest executing watches}.
|
||||
*
|
||||
* ## Life cycle
|
||||
*
|
||||
|
|
@ -498,11 +498,11 @@ function $RootScopeProvider(){
|
|||
* Scope's `$apply()` method transitions through the following stages:
|
||||
*
|
||||
* 1. The {@link guide/dev_guide.expressions expression} is executed using the
|
||||
* {@link angular.module.NG.$rootScope.Scope.$eval $eval()} method.
|
||||
* {@link angular.module.NG.$rootScope.Scope#$eval $eval()} method.
|
||||
* 2. Any exceptions from the execution of the expression are forwarded to the
|
||||
* {@link angular.service.$exceptionHandler $exceptionHandler} service.
|
||||
* 3. The {@link angular.module.NG.$rootScope.Scope.$watch watch} listeners are fired immediately after the expression
|
||||
* was executed using the {@link angular.module.NG.$rootScope.Scope.$digest $digest()} method.
|
||||
* {@link angular.module.NG.$exceptionHandler $exceptionHandler} service.
|
||||
* 3. The {@link angular.module.NG.$rootScope.Scope#$watch watch} listeners are fired immediately after the expression
|
||||
* was executed using the {@link angular.module.NG.$rootScope.Scope#$digest $digest()} method.
|
||||
*
|
||||
*
|
||||
* @param {(string|function())=} exp An angular expression to be executed.
|
||||
|
|
@ -529,7 +529,7 @@ function $RootScopeProvider(){
|
|||
* @function
|
||||
*
|
||||
* @description
|
||||
* Listen on events of a given type. See {@link angular.module.NG.$rootScope.Scope.$emit $emit} for discussion of
|
||||
* Listen on events of a given type. See {@link angular.module.NG.$rootScope.Scope#$emit $emit} for discussion of
|
||||
* event life cycle.
|
||||
*
|
||||
* @param {string} name Event name to listen on.
|
||||
|
|
@ -565,15 +565,15 @@ function $RootScopeProvider(){
|
|||
*
|
||||
* @description
|
||||
* Dispatches an event `name` upwards through the scope hierarchy notifying the
|
||||
* registered {@link angular.module.NG.$rootScope.Scope.$on} listeners.
|
||||
* registered {@link angular.module.NG.$rootScope.Scope#$on} listeners.
|
||||
*
|
||||
* The event life cycle starts at the scope on which `$emit` was called. All
|
||||
* {@link angular.module.NG.$rootScope.Scope.$on listeners} listening for `name` event on this scope get notified.
|
||||
* {@link angular.module.NG.$rootScope.Scope#$on listeners} listening for `name` event on this scope get notified.
|
||||
* Afterwards, the event traverses upwards toward the root scope and calls all registered
|
||||
* listeners along the way. The event will stop propagating if one of the listeners cancels it.
|
||||
*
|
||||
* Any exception emmited from the {@link angular.module.NG.$rootScope.Scope.$on listeners} will be passed
|
||||
* onto the {@link angular.service.$exceptionHandler $exceptionHandler} service.
|
||||
* Any exception emmited from the {@link angular.module.NG.$rootScope.Scope#$on listeners} will be passed
|
||||
* onto the {@link angular.module.NG.$exceptionHandler $exceptionHandler} service.
|
||||
*
|
||||
* @param {string} name Event name to emit.
|
||||
* @param {...*} args Optional set of arguments which will be passed onto the event listeners.
|
||||
|
|
@ -616,15 +616,15 @@ function $RootScopeProvider(){
|
|||
*
|
||||
* @description
|
||||
* Dispatches an event `name` downwards to all child scopes (and their children) notifying the
|
||||
* registered {@link angular.module.NG.$rootScope.Scope.$on} listeners.
|
||||
* registered {@link angular.module.NG.$rootScope.Scope#$on} listeners.
|
||||
*
|
||||
* The event life cycle starts at the scope on which `$broadcast` was called. All
|
||||
* {@link angular.module.NG.$rootScope.Scope.$on listeners} listening for `name` event on this scope get notified.
|
||||
* {@link angular.module.NG.$rootScope.Scope#$on listeners} listening for `name` event on this scope get notified.
|
||||
* 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.
|
||||
*
|
||||
* Any exception emmited from the {@link angular.module.NG.$rootScope.Scope.$on listeners} will be passed
|
||||
* onto the {@link angular.service.$exceptionHandler $exceptionHandler} service.
|
||||
* Any exception emmited from the {@link angular.module.NG.$rootScope.Scope#$on listeners} will be passed
|
||||
* onto the {@link angular.module.NG.$exceptionHandler $exceptionHandler} service.
|
||||
*
|
||||
* @param {string} name Event name to emit.
|
||||
* @param {...*} args Optional set of arguments which will be passed onto the event listeners.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
*
|
||||
* @description
|
||||
* Angular widget that creates a form scope using the
|
||||
* {@link angular.service.$formFactory $formFactory} API. The resulting form scope instance is
|
||||
* {@link angular.module.NG.$formFactory $formFactory} API. The resulting form scope instance is
|
||||
* attached to the DOM element using the jQuery `.data()` method under the `$form` key.
|
||||
* See {@link guide/dev_guide.forms forms} on detailed discussion of forms and widgets.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -617,7 +617,7 @@ var HTML5_INPUTS_TYPES = makeMap(
|
|||
*
|
||||
* The {@link angular.inputType custom angular.inputType}s provide a shorthand for declaring new
|
||||
* inputs. This is a sharthand for text-box based inputs, and there is no need to go through the
|
||||
* full {@link angular.service.$formFactory $formFactory} widget lifecycle.
|
||||
* full {@link angular.module.NG.$formFactory $formFactory} widget lifecycle.
|
||||
*
|
||||
*
|
||||
* @param {string} type Widget types as defined by {@link angular.inputType}. If the
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
* @param {string} src angular expression evaluating to URL. If the source is a string constant,
|
||||
* make sure you wrap it in quotes, e.g. `src="'myPartialTemplate.html'"`.
|
||||
* @param {Scope=} [scope=new_child_scope] optional expression which evaluates to an
|
||||
* instance of angular.scope to set the HTML fragment to.
|
||||
* instance of angular.module.NG.$rootScope.Scope to set the HTML fragment to.
|
||||
* @param {string=} onload Expression to evaluate when a new partial is loaded.
|
||||
*
|
||||
* @example
|
||||
|
|
@ -491,7 +491,7 @@ angularWidget("@ng:non-bindable", noop);
|
|||
*
|
||||
* @description
|
||||
* # Overview
|
||||
* `ng:view` is a widget that complements the {@link angular.service.$route $route} service by
|
||||
* `ng:view` is a widget that complements the {@link angular.module.NG.$route $route} service by
|
||||
* including the rendered template of the current route into the main layout (`index.html`) file.
|
||||
* Every time the current route changes, the included view changes with it according to the
|
||||
* configuration of the `$route` service.
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ function sortedHtml(element, showNgClass) {
|
|||
|
||||
|
||||
// TODO(vojta): migrate these helpers into jasmine matchers
|
||||
/**
|
||||
/**a
|
||||
* This method is a cheap way of testing if css for a given node is not set to 'none'. It doesn't
|
||||
* actually test if an element is displayed by the browser. Be aware!!!
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue