diff options
| author | Vojta Jina | 2011-11-11 17:15:22 -0800 |
|---|---|---|
| committer | Misko Hevery | 2011-11-14 20:31:19 -0800 |
| commit | acbd7cdf320f0570fcc1952c8680d4c78bc8fa2c (patch) | |
| tree | 2483609ada03b9e6ff477596f0402dc24fdd7518 /docs/content/guide | |
| parent | 035c7510763a9742294d51ba55aea0b6dd08ea58 (diff) | |
| download | angular.js-acbd7cdf320f0570fcc1952c8680d4c78bc8fa2c.tar.bz2 | |
style(docs): make jslint happy - fix some warnings
Diffstat (limited to 'docs/content/guide')
34 files changed, 112 insertions, 111 deletions
diff --git a/docs/content/guide/dev_guide.bootstrap.auto_bootstrap.ngdoc b/docs/content/guide/dev_guide.bootstrap.auto_bootstrap.ngdoc index a75dc52f..d461bfb4 100644 --- a/docs/content/guide/dev_guide.bootstrap.auto_bootstrap.ngdoc +++ b/docs/content/guide/dev_guide.bootstrap.auto_bootstrap.ngdoc @@ -98,4 +98,4 @@ APIs are bound to fields of this global object. ## Related API -{@link api/angular.module.NG.$compile Compiler API} +{@link api/angular.module.ng.$compile Compiler API} diff --git a/docs/content/guide/dev_guide.bootstrap.manual_bootstrap.ngdoc b/docs/content/guide/dev_guide.bootstrap.manual_bootstrap.ngdoc index 435f1418..c042b2e3 100644 --- a/docs/content/guide/dev_guide.bootstrap.manual_bootstrap.ngdoc +++ b/docs/content/guide/dev_guide.bootstrap.manual_bootstrap.ngdoc @@ -43,4 +43,4 @@ an executable, bi-directionally bound application. ## Related API -{@link api/angular.module.NG.$compile Compiler API} +{@link api/angular.module.ng.$compile Compiler API} diff --git a/docs/content/guide/dev_guide.compiler.directives.creating_directives.ngdoc b/docs/content/guide/dev_guide.compiler.directives.creating_directives.ngdoc index 18b9d630..2d6723cf 100644 --- a/docs/content/guide/dev_guide.compiler.directives.creating_directives.ngdoc +++ b/docs/content/guide/dev_guide.compiler.directives.creating_directives.ngdoc @@ -23,7 +23,7 @@ angular.directive('ng:bind', function(expression, compiledElement) { The angular compiler exposes methods that you may need to use when writing your own widgets and directives. For example, the `descend()` method lets you control whether the compiler ignores or processes child elements of the element it is compiling. For information on this and other -compiler methods, see the {@link api/angular.module.NG.$compile Compiler API doc}. +compiler methods, see the {@link api/angular.module.ng.$compile Compiler API doc}. ## Related Docs diff --git a/docs/content/guide/dev_guide.compiler.extending_compiler.ngdoc b/docs/content/guide/dev_guide.compiler.extending_compiler.ngdoc index 49f76b2b..90c7f5e2 100644 --- a/docs/content/guide/dev_guide.compiler.extending_compiler.ngdoc +++ b/docs/content/guide/dev_guide.compiler.extending_compiler.ngdoc @@ -93,4 +93,4 @@ corresponding spans. ## Related API -* {@link api/angular.module.NG.$compile $compile()} +* {@link api/angular.module.ng.$compile $compile()} diff --git a/docs/content/guide/dev_guide.compiler.markup.ngdoc b/docs/content/guide/dev_guide.compiler.markup.ngdoc index ef327a5d..0a01da57 100644 --- a/docs/content/guide/dev_guide.compiler.markup.ngdoc +++ b/docs/content/guide/dev_guide.compiler.markup.ngdoc @@ -89,4 +89,4 @@ angular.attrMarkup('extraClass', function(attrValue, attrName, element){ ## Related API -* {@link api/angular.module.NG.$compile Compiler API Reference} +* {@link api/angular.module.ng.$compile Compiler API Reference} diff --git a/docs/content/guide/dev_guide.compiler.ngdoc b/docs/content/guide/dev_guide.compiler.ngdoc index cc673751..2789c843 100644 --- a/docs/content/guide/dev_guide.compiler.ngdoc +++ b/docs/content/guide/dev_guide.compiler.ngdoc @@ -23,4 +23,4 @@ All compilation takes place in the web browser; no server is involved. ## Related API -* {@link api/angular.module.NG.$compile Angular Compiler API} +* {@link api/angular.module.ng.$compile Angular Compiler API} diff --git a/docs/content/guide/dev_guide.compiler.testing_dom_element.ngdoc b/docs/content/guide/dev_guide.compiler.testing_dom_element.ngdoc index c7032d2f..e077bf4d 100644 --- a/docs/content/guide/dev_guide.compiler.testing_dom_element.ngdoc +++ b/docs/content/guide/dev_guide.compiler.testing_dom_element.ngdoc @@ -14,4 +14,4 @@ ## Related API -* {@link api/angular.module.NG.$compile $compile()} +* {@link api/angular.module.ng.$compile $compile()} diff --git a/docs/content/guide/dev_guide.compiler.understanding_compiler.ngdoc b/docs/content/guide/dev_guide.compiler.understanding_compiler.ngdoc index 4200c823..94bab26d 100644 --- a/docs/content/guide/dev_guide.compiler.understanding_compiler.ngdoc +++ b/docs/content/guide/dev_guide.compiler.understanding_compiler.ngdoc @@ -20,7 +20,7 @@ dataset]"`), the link function gets called to set up a listener on each element Note that angular's built-in widgets, directives, and markup have predefined compile and link functions that you don't need to modify. When you create your own widgets, directives, or markup, -you must write compile and link functions for them. Refer to the {@link api/angular.module.NG.$compile +you must write compile and link functions for them. Refer to the {@link api/angular.module.ng.$compile Compiler API} for details. When the angular compiler compiles a page, it proceeds through 3 phases: Compile, Create Root @@ -53,7 +53,7 @@ Note that while the compile function is executed exactly once, the link function multiple times, for example, once for each iteration in a repeater. The angular compiler exposes methods that you will need to make use of when writing your own -widgets and directives. For information on these methods, see the {@link api/angular.module.NG.$compile +widgets and directives. For information on these methods, see the {@link api/angular.module.ng.$compile Compiler API doc}. @@ -65,4 +65,4 @@ Compiler API doc}. ## Related API -* {@link api/angular.module.NG.$compile $compile()} +* {@link api/angular.module.ng.$compile $compile()} diff --git a/docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc b/docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc index 2c9fbb34..312f4000 100644 --- a/docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc +++ b/docs/content/guide/dev_guide.compiler.widgets.creating_widgets.ngdoc @@ -80,7 +80,7 @@ angular.widget('my:time', function(compileElement){ The angular compiler exposes methods that you may need to use of when writing your own widgets and directives. For example, the `descend()` method lets you control whether the compiler ignores or processes child elements of the element it is compiling. For information on this and other -compiler methods, see the {@link api/angular.module.NG.$compile Compiler API doc}. +compiler methods, see the {@link api/angular.module.ng.$compile Compiler API doc}. ## Related Topics @@ -92,4 +92,4 @@ compiler methods, see the {@link api/angular.module.NG.$compile Compiler API doc ## Related API -* {@link api/angular.module.NG.$compile Compiler API} +* {@link api/angular.module.ng.$compile Compiler API} diff --git a/docs/content/guide/dev_guide.compiler.widgets.ngdoc b/docs/content/guide/dev_guide.compiler.widgets.ngdoc index c9e95a57..003cba53 100644 --- a/docs/content/guide/dev_guide.compiler.widgets.ngdoc +++ b/docs/content/guide/dev_guide.compiler.widgets.ngdoc @@ -32,4 +32,4 @@ dev_guide.compiler.widgets.creating_widgets Creating Custom Widgets}. ## Related API -* {@link api/angular.module.NG.$compile Compiler API} +* {@link api/angular.module.ng.$compile Compiler API} diff --git a/docs/content/guide/dev_guide.di.ngdoc b/docs/content/guide/dev_guide.di.ngdoc index f9ff49c4..b21b05a7 100644 --- a/docs/content/guide/dev_guide.di.ngdoc +++ b/docs/content/guide/dev_guide.di.ngdoc @@ -28,5 +28,5 @@ book. ## Related API -* {@link api/angular.module.NG Service API} +* {@link api/angular.module.ng Service API} * {@link api/angular.injector Angular Injector API} diff --git a/docs/content/guide/dev_guide.di.understanding_di.ngdoc b/docs/content/guide/dev_guide.di.understanding_di.ngdoc index 1dc9bd85..4c40ff20 100644 --- a/docs/content/guide/dev_guide.di.understanding_di.ngdoc +++ b/docs/content/guide/dev_guide.di.understanding_di.ngdoc @@ -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.module.NG +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.module.NG 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.module.NG 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.module.NG.$rootScope.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.module.NG('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.module.NG Services API} +* {@link api/angular.module.ng Services API} diff --git a/docs/content/guide/dev_guide.di.using_di_controllers.ngdoc b/docs/content/guide/dev_guide.di.using_di_controllers.ngdoc index 3d087d18..fc27a5fd 100644 --- a/docs/content/guide/dev_guide.di.using_di_controllers.ngdoc +++ b/docs/content/guide/dev_guide.di.using_di_controllers.ngdoc @@ -14,7 +14,7 @@ MyController.$inject = ['$route']; </pre> In this example, the `MyController` constructor function takes one argument, the {@link -api/angular.module.NG.$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: diff --git a/docs/content/guide/dev_guide.e2e-testing.ngdoc b/docs/content/guide/dev_guide.e2e-testing.ngdoc index 6dbb9c1e..2cb82416 100644 --- a/docs/content/guide/dev_guide.e2e-testing.ngdoc +++ b/docs/content/guide/dev_guide.e2e-testing.ngdoc @@ -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.module.NG.$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.module.NG.$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.module.NG.$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.module.NG.$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} diff --git a/docs/content/guide/dev_guide.expressions.ngdoc b/docs/content/guide/dev_guide.expressions.ngdoc index 3d5d0266..4df69d28 100644 --- a/docs/content/guide/dev_guide.expressions.ngdoc +++ b/docs/content/guide/dev_guide.expressions.ngdoc @@ -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.module.NG.$filter.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.module.NG.$filter.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.module.NG.$filter` 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.module.NG.$filter.uppercase. +The expression evaluator simply passes the value of name to angular.module.ng.$filter.uppercase. Chain filters using this syntax: @@ -243,4 +243,4 @@ so that angular developers and developers who use angular can develop in harmony ## Related API -* {@link api/angular.module.NG.$compile Angular Compiler API} +* {@link api/angular.module.ng.$compile Angular Compiler API} diff --git a/docs/content/guide/dev_guide.forms.ngdoc b/docs/content/guide/dev_guide.forms.ngdoc index 5b4b1478..d2b81dcc 100644 --- a/docs/content/guide/dev_guide.forms.ngdoc +++ b/docs/content/guide/dev_guide.forms.ngdoc @@ -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.module.NG.$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.module.NG.$rootScope.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.module.NG.$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.module.NG.$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.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 + {@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.module.NG.$rootScope.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.module.NG.$rootScope.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.module.NG.$rootScope.Scope(); + var scope = angular.module.ng.$rootScope.Scope(); var loginController = scope.$new(LoginController); var input = angular.element('<input>'); diff --git a/docs/content/guide/dev_guide.i18n.ngdoc b/docs/content/guide/dev_guide.i18n.ngdoc index 50031b5d..d88715cd 100644 --- a/docs/content/guide/dev_guide.i18n.ngdoc +++ b/docs/content/guide/dev_guide.i18n.ngdoc @@ -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.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. +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.module.NG.$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.module.NG.$filter.currency currency filter} allows -you to use the default currency symbol from the {@link api/angular.module.NG.$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.module.NG.$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. diff --git a/docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc b/docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc index 779e7247..5f571680 100644 --- a/docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc +++ b/docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc @@ -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.module.NG.$rootScope.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.module.NG.$rootScope.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.module.NG.$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.module.NG.$rootScope.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> diff --git a/docs/content/guide/dev_guide.scopes.internals.ngdoc b/docs/content/guide/dev_guide.scopes.internals.ngdoc index 211a11bc..b63f566c 100644 --- a/docs/content/guide/dev_guide.scopes.internals.ngdoc +++ b/docs/content/guide/dev_guide.scopes.internals.ngdoc @@ -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.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 +- 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 @@ -27,14 +27,14 @@ Every application has a root scope, which is the ancestor of all other scopes. ### What is scope used for? -{@link dev_guide.expressions Expressions} in the view are {@link api/angular.module.NG.$rootScope.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.module.NG.$rootScope.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. @@ -57,7 +57,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.module.NG.$rootScope.Scope(); +var root = angular.module.ng.$rootScope.Scope(); var child = root.$new(); root.name = 'angular'; @@ -73,25 +73,25 @@ expect(root.name).toEqual('angular'); ### Scope life cycle 1. **Creation** - * The root scope is created by the {@link api/angular.module.NG.$rootScope $rootScope} service. - * To create a child scopes, you should call {@link api/angular.module.NG.$rootScope.Scope#$new parentScope.$new()}. + * The root scope is created by the {@link api/angular.module.ng.$rootScope $rootScope} service. + * 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.module.NG.$rootScope.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.module.NG.$rootScope.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.module.NG.$xhr $xhr} or {@link api/angular.module.NG.$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.module.NG.$rootScope.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 @@ -100,7 +100,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.module.NG.$rootScope.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. @@ -118,22 +118,22 @@ element. 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.module.NG.$rootScope.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.module.NG.$rootScope.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.module.NG.$rootScope.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.module.NG.$rootScope.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.) @@ -143,13 +143,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.module.NG.$rootScope.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.module.NG.$rootScope.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 @@ -172,8 +172,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.module.NG.$rootScope.Scope -angular.module.NG.$rootScope.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. @@ -183,7 +183,7 @@ within the unit-tests. <pre> // example of a test - var scope = angular.module.NG.$rootScope.Scope(); + var scope = angular.module.ng.$rootScope.Scope(); scope.$watch('name', function(scope, name){ scope.greeting = 'Hello ' + name + '!'; }); @@ -221,5 +221,5 @@ it('should allow override of providers', inject( ## Related API -* {@link api/angular.module.NG.$rootScope.Scope Angular Scope API} +* {@link api/angular.module.ng.$rootScope.Scope Angular Scope API} diff --git a/docs/content/guide/dev_guide.scopes.ngdoc b/docs/content/guide/dev_guide.scopes.ngdoc index dcf0dd1d..7b9b77ec 100644 --- a/docs/content/guide/dev_guide.scopes.ngdoc +++ b/docs/content/guide/dev_guide.scopes.ngdoc @@ -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.module.NG.$rootScope.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.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}). +* 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.module.NG.$rootScope.Scope Angular Scope API} +* {@link api/angular.module.ng.$rootScope.Scope Angular Scope API} diff --git a/docs/content/guide/dev_guide.scopes.understanding_scopes.ngdoc b/docs/content/guide/dev_guide.scopes.understanding_scopes.ngdoc index 84ef55dc..77f589dc 100644 --- a/docs/content/guide/dev_guide.scopes.understanding_scopes.ngdoc +++ b/docs/content/guide/dev_guide.scopes.understanding_scopes.ngdoc @@ -63,4 +63,4 @@ The following illustration shows the DOM and angular scopes for the example abov ## Related API -* {@link api/angular.module.NG.$rootScope.Scope Angular Scope API} +* {@link api/angular.module.ng.$rootScope.Scope Angular Scope API} diff --git a/docs/content/guide/dev_guide.services.$location.ngdoc b/docs/content/guide/dev_guide.services.$location.ngdoc index cdfd5ac2..2296a107 100644 --- a/docs/content/guide/dev_guide.services.$location.ngdoc +++ b/docs/content/guide/dev_guide.services.$location.ngdoc @@ -89,7 +89,8 @@ setter methods that allow you to get or change the current URL in the browser. ## $location service configuration To configure the `$location` service, retrieve the -{@link api/angular.module.NG.$locationProvider $locationProvider} and set the parameters as follows: +{@link api/angular.module.ng.$locationProvider $locationProvider} and set the parameters as follows: + - **html5Mode(mode)**: {boolean}<br /> `true` - see HTML5 mode<br /> @@ -133,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.module.NG.$rootScope.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 @@ -487,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.module.NG.$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.module.NG.$rootScope.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 @@ -511,7 +512,7 @@ hashPrefix. # Testing with the $location service When using `$location` service during testing, you are outside of the angular's {@link -api/angular.module.NG.$rootScope.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> describe('serviceUnderTest', function() { @@ -629,7 +630,7 @@ this.$watch('$location.path()', function(scope, path) { # Related API -* {@link api/angular.module.NG.$location $location API} +* {@link api/angular.module.ng.$location $location API} diff --git a/docs/content/guide/dev_guide.services.creating_services.ngdoc b/docs/content/guide/dev_guide.services.creating_services.ngdoc index b3c3a2ed..397f86c7 100644 --- a/docs/content/guide/dev_guide.services.creating_services.ngdoc +++ b/docs/content/guide/dev_guide.services.creating_services.ngdoc @@ -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.module.NG` 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.module.NG('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.module.NG Angular Service API} +* {@link api/angular.module.ng Angular Service API} diff --git a/docs/content/guide/dev_guide.services.injecting_controllers.ngdoc b/docs/content/guide/dev_guide.services.injecting_controllers.ngdoc index 6d4709ee..4b031860 100644 --- a/docs/content/guide/dev_guide.services.injecting_controllers.ngdoc +++ b/docs/content/guide/dev_guide.services.injecting_controllers.ngdoc @@ -77,4 +77,4 @@ it('should test service', function() { ## Related API -{@link api/angular.module.NG Angular Service API} +{@link api/angular.module.ng Angular Service API} diff --git a/docs/content/guide/dev_guide.services.managing_dependencies.ngdoc b/docs/content/guide/dev_guide.services.managing_dependencies.ngdoc index a172f97c..b3135b83 100644 --- a/docs/content/guide/dev_guide.services.managing_dependencies.ngdoc +++ b/docs/content/guide/dev_guide.services.managing_dependencies.ngdoc @@ -19,7 +19,7 @@ provided by angular's web framework: * * @param {*} message Message to be logged. */ -angular.module.NG('batchLog', function($defer, $log) { +angular.module.ng('batchLog', function($defer, $log) { var messageQueue = []; function log() { @@ -43,7 +43,7 @@ angular.module.NG('batchLog', function($defer, $log) { * routeTemplateMonitor monitors each $route change and logs the current * template via the batchLog service. */ -angular.module.NG('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.module.NG('routeTemplateMonitor', function($route, batchLog) { Things to notice in this example: -* 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 +* 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.module.NG.$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.module.NG Angular Service API} +* {@link api/angular.module.ng Angular Service API} * {@link api/angular.injector Angular Injector API} diff --git a/docs/content/guide/dev_guide.services.ngdoc b/docs/content/guide/dev_guide.services.ngdoc index ec3771da..d59dafe9 100644 --- a/docs/content/guide/dev_guide.services.ngdoc +++ b/docs/content/guide/dev_guide.services.ngdoc @@ -19,4 +19,4 @@ most often used with {@link dev_guide.di dependency injection}, also a key featu ## Related API -* {@link api/angular.module.NG Angular Service API} +* {@link api/angular.module.ng Angular Service API} diff --git a/docs/content/guide/dev_guide.services.registering_services.ngdoc b/docs/content/guide/dev_guide.services.registering_services.ngdoc index 7f04a617..24a21852 100644 --- a/docs/content/guide/dev_guide.services.registering_services.ngdoc +++ b/docs/content/guide/dev_guide.services.registering_services.ngdoc @@ -29,7 +29,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.module.NG('service id', function() { +angular.module.ng('service id', function() { var shinyNewServiceInstance; //factory function body that constructs shinyNewServiceInstance return shinyNewServiceInstance; @@ -65,4 +65,4 @@ important. ## Related API -* {@link api/angular.module.NG Angular Service API} +* {@link api/angular.module.ng Angular Service API} diff --git a/docs/content/guide/dev_guide.services.testing_services.ngdoc b/docs/content/guide/dev_guide.services.testing_services.ngdoc index f988c11b..c18cfda1 100644 --- a/docs/content/guide/dev_guide.services.testing_services.ngdoc +++ b/docs/content/guide/dev_guide.services.testing_services.ngdoc @@ -11,7 +11,7 @@ var mock, notify; beforeEach(function() { mock = {alert: jasmine.createSpy()}; - notify = angular.module.NG('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.module.NG Angular Service API} +* {@link api/angular.module.ng Angular Service API} diff --git a/docs/content/guide/dev_guide.services.understanding_services.ngdoc b/docs/content/guide/dev_guide.services.understanding_services.ngdoc index 0000c658..ca100561 100644 --- a/docs/content/guide/dev_guide.services.understanding_services.ngdoc +++ b/docs/content/guide/dev_guide.services.understanding_services.ngdoc @@ -3,7 +3,7 @@ @description Angular services are singletons that carry out specific tasks common to web apps, such as the -{@link api/angular.module.NG.$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.module.NG Angular Service API} +* {@link api/angular.module.ng Angular Service API} * {@link api/angular.injector Injector API} diff --git a/docs/content/guide/dev_guide.templates.filters.creating_filters.ngdoc b/docs/content/guide/dev_guide.templates.filters.creating_filters.ngdoc index 1f34b32b..92c749f7 100644 --- a/docs/content/guide/dev_guide.templates.filters.creating_filters.ngdoc +++ b/docs/content/guide/dev_guide.templates.filters.creating_filters.ngdoc @@ -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.module.NG.$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. @@ -64,4 +64,4 @@ angular.module.MyReverseModule = function MyModule($filterProvider) { ## Related API -* {@link api/angular.module.NG.$filter Angular Filter API} +* {@link api/angular.module.ng.$filter Angular Filter API} diff --git a/docs/content/guide/dev_guide.templates.filters.ngdoc b/docs/content/guide/dev_guide.templates.filters.ngdoc index 922d36d9..52780ec0 100644 --- a/docs/content/guide/dev_guide.templates.filters.ngdoc +++ b/docs/content/guide/dev_guide.templates.filters.ngdoc @@ -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.module.NG.$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.module.NG.$filter Angular Filter API} +* {@link api/angular.module.ng.$filter Angular Filter API} diff --git a/docs/content/guide/dev_guide.templates.filters.using_filters.ngdoc b/docs/content/guide/dev_guide.templates.filters.using_filters.ngdoc index c5c5cbb8..a159e1f5 100644 --- a/docs/content/guide/dev_guide.templates.filters.using_filters.ngdoc +++ b/docs/content/guide/dev_guide.templates.filters.using_filters.ngdoc @@ -2,7 +2,7 @@ @name Developer Guide: Templates: Filters: Using Angular Filters @description -Filters can be part of any {@link api/angular.module.NG.$rootScope.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.module.NG.$filter Angular Filter API} +* {@link api/angular.module.ng.$filter Angular Filter API} diff --git a/docs/content/guide/dev_guide.templates.ngdoc b/docs/content/guide/dev_guide.templates.ngdoc index edf9c1cc..584fdcfe 100644 --- a/docs/content/guide/dev_guide.templates.ngdoc +++ b/docs/content/guide/dev_guide.templates.ngdoc @@ -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.module.NG.$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. diff --git a/docs/content/guide/dev_guide.unit-testing.ngdoc b/docs/content/guide/dev_guide.unit-testing.ngdoc index 96758866..8b4d4687 100644 --- a/docs/content/guide/dev_guide.unit-testing.ngdoc +++ b/docs/content/guide/dev_guide.unit-testing.ngdoc @@ -247,16 +247,16 @@ that such a test tells a story, rather then asserting random bits which don't se ## Filters -{@link api/angular.module.NG.$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.module.NG.$filter('length', function(text){ +angular.module.ng.$filter('length', function(text){ return (''+(text||'')).length; }); -var length = angular.module.NG.$filter('length'); +var length = angular.module.ng.$filter('length'); expect(length(null)).toEqual(0); expect(length('abc')).toEqual(3); </pre> |
