Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit f16150d

Browse files
committed
docs(*): simplify doc urls
we now have two types of namespaces: - true namespace: angular.* - used for all global apis - virtual namespace: ng.*, ngMock.*, ... - used for all DI modules the virual namespaces have services under the second namespace level (e.g. ng.) and filters and directives prefixed with filter: and directive: respectively (e.g. ng.filter:orderBy, ng.directive:ngRepeat) this simplifies urls and makes them a lot shorter while still avoiding name collisions
1 parent fc0b2b5 commit f16150d

File tree

106 files changed

+803
-799
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+803
-799
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@ngdoc overview
2-
@name angular.module.ng
2+
@name ng
33
@description
44

55
The `ng` is an angular module which contains all of the core angular services.

docs/content/cookbook/deeplinking.ngdoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ In this example we have a simple app which consist of two screens:
141141
# Things to notice
142142

143143
* Routes are defined in the `AppCntl` class. The initialization of the controller causes the
144-
initialization of the {@link api/angular.module.ng.$route $route} service with the proper URL
144+
initialization of the {@link api/ng.$route $route} service with the proper URL
145145
routes.
146-
* The {@link api/angular.module.ng.$route $route} service then watches the URL and instantiates the
146+
* The {@link api/ng.$route $route} service then watches the URL and instantiates the
147147
appropriate controller when the URL changes.
148-
* The {@link api/angular.module.ng.$compileProvider.directive.ngView ngView} widget loads the
148+
* The {@link api/ng.directive:ngView ngView} widget loads the
149149
view when the URL changes. It also sets the view scope to the newly instantiated controller.
150150
* Changing the URL is sufficient to change the controller and view. It makes no difference whether
151151
the URL is changed programatically or by the user.

docs/content/cookbook/form.ngdoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ allow a user to enter data.
102102

103103
# Things to notice
104104

105-
* The user data model is initialized {@link api/angular.module.ng.$compileProvider.directive.ngController controller} and is
106-
available in the {@link api/angular.module.ng.$rootScope.Scope scope} with the initial data.
105+
* The user data model is initialized {@link api/ng.directive:ngController controller} and is
106+
available in the {@link api/ng.$rootScope.Scope scope} with the initial data.
107107
* For debugging purposes we have included a debug view of the model to better understand what
108108
is going on.
109-
* The {@link api/angular.module.ng.$compileProvider.directive.input input directives} simply refer
109+
* The {@link api/ng.directive:input input directives} simply refer
110110
to the model and are data-bound.
111111
* The inputs validate. (Try leaving them blank or entering non digits in the zip field)
112112
* In your application you can simply read from or write to the model and the form will be updated.

docs/content/cookbook/helloworld.ngdoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
Take a look through the source and note:
3030

3131
* The script tag that {@link guide/bootstrap bootstraps} the angular environment.
32-
* The text {@link api/angular.module.ng.$compileProvider.directive.input input widget} which is
32+
* The text {@link api/ng.directive:input input form control} which is
3333
bound to the greeting name text.
3434
* No need for listener registration and event firing on change events.
35-
* The implicit presence of the `name` variable which is in the root {@link api/angular.module.ng.$rootScope.Scope scope}.
35+
* The implicit presence of the `name` variable which is in the root {@link api/ng.$rootScope.Scope scope}.
3636
* The double curly brace `{{markup}}`, which binds the name variable to the greeting text.
3737
* The concept of {@link guide/dev_guide.templates.databinding data binding}, which reflects any
3838
changes to the

docs/content/cookbook/index.ngdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ allowing you to send links to specific screens in your app.
4444

4545
# Services
4646

47-
{@link api/angular.module.ng Services}: Services are long lived objects in your applications that are
47+
{@link api/ng Services}: Services are long lived objects in your applications that are
4848
available across controllers. A collection of useful services are pre-bundled with angular but you
4949
will likely add your own. Services are initialized using dependency injection, which resolves the
5050
order of initialization. This safeguards you from the perils of global state (a common way to

docs/content/cookbook/mvc.ngdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@ board variable.
125125
* The view can call any controller function.
126126
* In this example, the `setUrl()` and `readUrl()` functions copy the game state to/from the URL's
127127
hash so the browser's back button will undo game steps. See deep-linking. This example calls {@link
128-
api/angular.module.ng.$rootScope.Scope#$watch $watch()} to set up a listener that invokes `readUrl()` when needed.
128+
api/ng.$rootScope.Scope#$watch $watch()} to set up a listener that invokes `readUrl()` when needed.

docs/content/guide/bootstrap.ngdoc

+9-9
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,26 @@ initialization.
4141
* If you chose to use the old style directive syntax `ng:` then include xml-namespace in `html`
4242
to make IE happy. (This is here for historical resons, and we no longer recomend use of
4343
`ng:`.)
44-
44+
4545
<html xmlns:ng="http://angularjs.org">
46-
47-
46+
47+
4848

4949
# Automatic Initialization
5050

5151
Angular initializes automatically upon `DOMContentLoaded` event, at which point angular looks for
52-
the {@link api/angular.module.ng.$compileProvider.directive.ngApp `ng-app`} directive which
52+
the {@link api/ng.directive:ngApp `ng-app`} directive which
5353
designates your application root. If {@link
54-
api/angular.module.ng.$compileProvider.directive.ngApp `ng-app`} directive is found then Angular
54+
api/ng.directive:ngApp `ng-app`} directive is found then Angular
5555
will:
5656

5757
* load the {@link guide/module module} associated with the directive.
58-
* create the application {@link api/angular.module.AUTO.$injector injector}
59-
* compile the DOM treating the {@link api/angular.module.ng.$compileProvider.directive.ngApp
58+
* create the application {@link api/AUTO.$injector injector}
59+
* compile the DOM treating the {@link api/ng.directive:ngApp
6060
`ng-app`} directive as the root of the compilation. This allows you to tell it to treat only a
6161
portion of the DOM as an Angular application.
6262

63-
63+
6464
<pre>
6565
<!doctype html>
6666
<html ng-app="optionalModuleName">
@@ -82,7 +82,7 @@ or the need to perform an operation before the Angular compiles a page.
8282

8383

8484
Here is an example of manually initializing Angular. The example is equivalent to using the {@link
85-
api/angular.module.ng.$compileProvider.directive.ngApp ng-app} directive.
85+
api/ng.directive:ngApp ng-app} directive.
8686

8787
<pre>
8888
<!doctype html>

docs/content/guide/compiler.ngdoc

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
# Overview
66

7-
Angular's {@link api/angular.module.ng.$compile HTML compiler} allows the developer to teach the
7+
Angular's {@link api/ng.$compile HTML compiler} allows the developer to teach the
88
browser new HTML syntax. The compiler allows you to attach behavior to any HTML element or attribute
99
and even create new HTML element or attributes with custom behavior. Angular calls these behavior
10-
extensions {@link api/angular.module.ng.$compileProvider.directive directives}.
10+
extensions {@link api/ng.$compileProvider.directive directives}.
1111

1212
HTML has a lot of constructs for formatting the HTML for static documents in declarative fashion.
1313
For example if something needs to be centered, there is no need to provide instructions to the
@@ -17,7 +17,7 @@ element to achieve the desired behavior. Such is the power of declarative langua
1717

1818
But the declarative language is also limited, since it does not allow you to teach the browser new
1919
syntax. For example there is no easy way to get the browser to align the text at 1/3 the position
20-
instead of 1/2. What is needed is a way to teach browser new HTML syntax.
20+
instead of 1/2. What is needed is a way to teach browser new HTML syntax.
2121

2222
Angular comes pre-bundled with common directives which are useful for building any app. We also
2323
expect that you will create directives that are specific to your app. These extension become a
@@ -29,7 +29,7 @@ involved.
2929

3030
# Compiler
3131

32-
Compiler is an angular service which traverses the DOM looking for attributes. The compilation
32+
Compiler is an angular service which traverses the DOM looking for attributes. The compilation
3333
process happens into two phases.
3434

3535
1. **Compile:** traverse the DOM and collect all of the directives. The result is a linking
@@ -39,7 +39,7 @@ process happens into two phases.
3939
scope model are reflected in the view, and any user interactions with the view are reflected
4040
in the scope model. Making the scope model a single source of truth.
4141

42-
Some directives such {@link api/angular.module.ng.$compileProvider.directive.ngRepeat
42+
Some directives such {@link api/ng.directive:ngRepeat
4343
`ng-repeat`} clone DOM elements once for each item in collection. Having a compile and link phase
4444
improves performance since the cloned template only needs to be compiled once, and then linked
4545
once for each clone instance.
@@ -50,7 +50,7 @@ once for each clone instance.
5050
Directive is a behavior which should be triggered when specific HTML constructs are encountered in
5151
compilation process. The directives can be placed in element names, attributes, class names, as
5252
well as comments. Here are some equivalent examples of invoking {@link
53-
api/angular.module.ng.$compileProvider.directive.ngBind `ng-bind`} directive.
53+
api/ng.directive:ngBind `ng-bind`} directive.
5454

5555
<pre>
5656
<span ng-bind="exp"></span>
@@ -60,7 +60,7 @@ api/angular.module.ng.$compileProvider.directive.ngBind `ng-bind`} directive.
6060
</pre>
6161

6262
Directive is just a function which executes when the compiler encounters it in the DOM. See {@link
63-
api/angular.module.ng.$compileProvider.directive directive API} for in depth documentation on how
63+
api/ng.$compileProvider.directive directive API} for in depth documentation on how
6464
to write directives.
6565

6666
Here is a directive which makes any element draggable. Notice the `draggable` attribute on the
@@ -115,9 +115,9 @@ principles.
115115

116116
# Understanding View
117117

118-
There are many templating systems out there. Most of them consume a static string template and
118+
There are many templating systems out there. Most of them consume a static string template and
119119
combine it with data, resulting in a new string. The resulting text is then `innerHTML`ed into
120-
an element.
120+
an element.
121121

122122
<img src="img/One_Way_Data_Binding.png">
123123

docs/content/guide/dev_guide.e2e-testing.ngdoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,19 @@ Returns the window.location.search of the currently loaded page in the test fram
7878
Returns the window.location.hash (without `#`) of the currently loaded page in the test frame.
7979

8080
## browser().location().url()
81-
Returns the {@link api/angular.module.ng.$location $location.url()} of the currently loaded page in
81+
Returns the {@link api/ng.$location $location.url()} of the currently loaded page in
8282
the test frame.
8383

8484
## browser().location().path()
85-
Returns the {@link api/angular.module.ng.$location $location.path()} of the currently loaded page in
85+
Returns the {@link api/ng.$location $location.path()} of the currently loaded page in
8686
the test frame.
8787

8888
## browser().location().search()
89-
Returns the {@link api/angular.module.ng.$location $location.search()} of the currently loaded page
89+
Returns the {@link api/ng.$location $location.search()} of the currently loaded page
9090
in the test frame.
9191

9292
## browser().location().hash()
93-
Returns the {@link api/angular.module.ng.$location $location.hash()} of the currently loaded page in
93+
Returns the {@link api/ng.$location $location.hash()} of the currently loaded page in
9494
the test frame.
9595

9696
## expect(future).{matcher}

docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
In angular, a controller is a JavaScript function(type/class) that is used to augment instances of
66
angular {@link scope Scope}, excluding the root scope. When you or angular create a new
7-
child scope object via the {@link api/angular.module.ng.$rootScope.Scope#$new scope.$new} API , there is an
7+
child scope object via the {@link api/ng.$rootScope.Scope#$new scope.$new} API , there is an
88
option to pass in a controller as a method argument. This will tell angular to associate the
99
controller with the new scope and to augment its behavior.
1010

@@ -38,7 +38,7 @@ template/view. This behavior interacts with and modifies the application model.
3838
As discussed in the {@link dev_guide.mvc.understanding_model Model} section of this guide, any
3939
objects (or primitives) assigned to the scope become model properties. Any functions assigned to
4040
the scope are available in the template/view, and can be invoked via angular expressions
41-
and `ng` event handler directives (e.g. {@link api/angular.module.ng.$compileProvider.directive.ngClick ngClick}).
41+
and `ng` event handler directives (e.g. {@link api/ng.directive:ngClick ngClick}).
4242

4343
# Using Controllers Correctly
4444

@@ -68,9 +68,9 @@ instances).
6868

6969
# Associating Controllers with Angular Scope Objects
7070

71-
You can associate controllers with scope objects explicitly via the {@link api/angular.module.ng.$rootScope.Scope#$new
72-
scope.$new} api or implicitly via the {@link api/angular.module.ng.$compileProvider.directive.ngController ngController
73-
directive} or {@link api/angular.module.ng.$route $route service}.
71+
You can associate controllers with scope objects explicitly via the {@link api/ng.$rootScope.Scope#$new
72+
scope.$new} api or implicitly via the {@link api/ng.directive:ngController ngController
73+
directive} or {@link api/ng.$route $route service}.
7474

7575

7676
## Controller Constructor and Methods Example
@@ -157,7 +157,7 @@ input box) in the second button.
157157

158158
## Controller Inheritance Example
159159

160-
Controller inheritance in angular is based on {@link api/angular.module.ng.$rootScope.Scope Scope} inheritance. Let's
160+
Controller inheritance in angular is based on {@link api/ng.$rootScope.Scope Scope} inheritance. Let's
161161
have a look at an example:
162162

163163
<pre>

docs/content/guide/dev_guide.mvc.understanding_model.ngdoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ occurs in controllers:
3030

3131
<button ng-click="{{foos='ball'}}">Click me</button>
3232

33-
* Use {@link api/angular.module.ng.$compileProvider.directive.ngInit ngInit directive} in templates (for toy/example apps
33+
* Use {@link api/ng.directive:ngInit ngInit directive} in templates (for toy/example apps
3434
only, not recommended for real applications):
3535

3636
<body ng-init=" foo = 'bar' ">
@@ -45,7 +45,7 @@ when processing the following template constructs:
4545
The code above creates a model called "query" on the current scope with the value set to "fluffy
4646
cloud".
4747

48-
* An iterator declaration in {@link api/angular.module.ng.$compileProvider.directive.ngRepeat ngRepeater}:
48+
* An iterator declaration in {@link api/ng.directive:ngRepeat ngRepeater}:
4949

5050
<p ng-repeat="phone in phones"></p>
5151

docs/content/guide/dev_guide.mvc.understanding_view.ngdoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ the DOM based on information in the template, controller and model.
99

1010
In the angular implementation of MVC, the view has knowledge of both the model and the controller.
1111
The view knows about the model where two-way data-binding occurs. The view has knowledge of the
12-
controller through angular directives, such as {@link api/angular.module.ng.$compileProvider.directive.ngController
13-
ngController} and {@link api/angular.module.ng.$compileProvider.directive.ngView ngView}, and through bindings of this form:
12+
controller through angular directives, such as {@link api/ng.directive:ngController
13+
ngController} and {@link api/ng.directive:ngView ngView}, and through bindings of this form:
1414
`{{someControllerFunction()}}`. In these ways, the view can call functions in an associated
1515
controller function.
1616

docs/content/guide/dev_guide.services.$location.ngdoc

+7-7
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ setter methods that allow you to get or change the current URL in the browser.
8989
## $location service configuration
9090

9191
To configure the `$location` service, retrieve the
92-
{@link api/angular.module.ng.$locationProvider $locationProvider} and set the parameters as follows:
92+
{@link api/ng.$locationProvider $locationProvider} and set the parameters as follows:
9393

9494

9595
- **html5Mode(mode)**: {boolean}<br />
@@ -134,7 +134,7 @@ current URL without creating a new browser history record you can call:
134134
</pre>
135135

136136
Note that the setters don't update `window.location` immediately. Instead, `$location` service is
137-
aware of the {@link api/angular.module.ng.$rootScope.Scope scope} life-cycle and coalesces multiple `$location`
137+
aware of the {@link api/ng.$rootScope.Scope scope} life-cycle and coalesces multiple `$location`
138138
mutations into one "commit" to the `window.location` object during the scope `$digest` phase. Since
139139
multiple changes to the $location's state will be pushed to the browser as a single change, it's
140140
enough to call the `replace()` method just once to make the entire "commit" a replace operation
@@ -489,11 +489,11 @@ In this examples we use `<base href="/base/index.html" />`
489489

490490
The `$location` service allows you to change only the URL; it does not allow you to reload the
491491
page. When you need to change the URL and reload the page or navigate to a different page, please
492-
use a lower level API, {@link api/angular.module.ng.$window $window.location.href}.
492+
use a lower level API, {@link api/ng.$window $window.location.href}.
493493

494494
## Using $location outside of the scope life-cycle
495495

496-
`$location` knows about Angular's {@link api/angular.module.ng.$rootScope.Scope scope} life-cycle. When a URL changes in
496+
`$location` knows about Angular's {@link api/ng.$rootScope.Scope scope} life-cycle. When a URL changes in
497497
the browser it updates the `$location` and calls `$apply` so that all $watchers / $observers are
498498
notified.
499499
When you change the `$location` inside the `$digest` phase everything is ok; `$location` will
@@ -513,7 +513,7 @@ hashPrefix.
513513
# Testing with the $location service
514514

515515
When using `$location` service during testing, you are outside of the angular's {@link
516-
api/angular.module.ng.$rootScope.Scope scope} life-cycle. This means it's your responsibility to call `scope.$apply()`.
516+
api/ng.$rootScope.Scope scope} life-cycle. This means it's your responsibility to call `scope.$apply()`.
517517

518518
<pre>
519519
describe('serviceUnderTest', function() {
@@ -612,7 +612,7 @@ then uses the information it obtains to compose hashbang URLs (such as
612612

613613
The Angular's compiler currently does not support two-way binding for methods (see {@link
614614
https://github.com/angular/angular.js/issues/404 issue}). If you should require two-way binding
615-
to the $location object (using {@link api/angular.module.ng.$compileProvider.directive.input.text
615+
to the $location object (using {@link api/ng.directive:input.text
616616
ngModel} directive on an input field), you will need to specify an extra model property
617617
(e.g. `locationPath`) with two watchers which push $location updates in both directions. For
618618
example:
@@ -634,7 +634,7 @@ $scope.$watch('$location.path()', function(path) {
634634

635635
# Related API
636636

637-
* {@link api/angular.module.ng.$location $location API}
637+
* {@link api/ng.$location $location API}
638638

639639

640640

docs/content/guide/dev_guide.services.creating_services.ngdoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
While angular offers several useful services, for any nontrivial application you'll find it useful
66
to write your own custom services. To do this you begin by registering a service factory function
77
with a module either via the {@link api/angular.module Module#factory api} or directly
8-
via the {@link api/angular.module.AUTO.$provide $provide} api inside of module config function.
8+
via the {@link api/AUTO.$provide $provide} api inside of module config function.
99

1010
All angular services participate in {@link di dependency injection (DI)} by registering
1111
themselves with Angular's DI system (injector) under a `name` (id) as well as by declaring
@@ -18,7 +18,7 @@ testable.
1818

1919
To register a service, you must have a module that this service will be part of. Afterwards, you
2020
can register the service with the module either via the {@link api/angular.Module Module api} or
21-
by using the {@link api/angular.module.AUTO.$provide $provide} service in the module configuration
21+
by using the {@link api/AUTO.$provide $provide} service in the module configuration
2222
function.The following pseudo-code shows both approaches:
2323

2424
Using the angular.Module api:
@@ -101,4 +101,4 @@ important.
101101

102102
## Related API
103103

104-
* {@link api/angular.module.ng Angular Service API}
104+
* {@link api/ng Angular Service API}

docs/content/guide/dev_guide.services.injecting_controllers.ngdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ dependencies with the `$inject` property.
115115

116116
## Related API
117117

118-
{@link api/angular.module.ng Angular Service API}
118+
{@link api/ng Angular Service API}

0 commit comments

Comments
 (0)