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

Commit

Permalink
docs(*): simplify doc urls
Browse files Browse the repository at this point in the history
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
  • Loading branch information
IgorMinar committed Jun 12, 2012
1 parent fc0b2b5 commit f16150d
Show file tree
Hide file tree
Showing 106 changed files with 803 additions and 799 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@ngdoc overview
@name angular.module.ng
@name ng
@description

The `ng` is an angular module which contains all of the core angular services.
6 changes: 3 additions & 3 deletions docs/content/cookbook/deeplinking.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ In this example we have a simple app which consist of two screens:
# Things to notice

* Routes are defined in the `AppCntl` class. The initialization of the controller causes the
initialization of the {@link api/angular.module.ng.$route $route} service with the proper URL
initialization of the {@link api/ng.$route $route} service with the proper URL
routes.
* The {@link api/angular.module.ng.$route $route} service then watches the URL and instantiates the
* The {@link api/ng.$route $route} service then watches the URL and instantiates the
appropriate controller when the URL changes.
* The {@link api/angular.module.ng.$compileProvider.directive.ngView ngView} widget loads the
* The {@link api/ng.directive:ngView ngView} widget loads the
view when the URL changes. It also sets the view scope to the newly instantiated controller.
* Changing the URL is sufficient to change the controller and view. It makes no difference whether
the URL is changed programatically or by the user.
6 changes: 3 additions & 3 deletions docs/content/cookbook/form.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ allow a user to enter data.

# Things to notice

* The user data model is initialized {@link api/angular.module.ng.$compileProvider.directive.ngController controller} and is
available in the {@link api/angular.module.ng.$rootScope.Scope scope} with the initial data.
* The user data model is initialized {@link api/ng.directive:ngController controller} and is
available in the {@link api/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.module.ng.$compileProvider.directive.input input directives} simply refer
* The {@link api/ng.directive:input input directives} simply refer
to the model and are data-bound.
* The inputs validate. (Try leaving them blank or entering non digits in the zip field)
* In your application you can simply read from or write to the model and the form will be updated.
Expand Down
4 changes: 2 additions & 2 deletions docs/content/cookbook/helloworld.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
Take a look through the source and note:

* The script tag that {@link guide/bootstrap bootstraps} the angular environment.
* The text {@link api/angular.module.ng.$compileProvider.directive.input input widget} which is
* The text {@link api/ng.directive:input input form control} 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.module.ng.$rootScope.Scope scope}.
* The implicit presence of the `name` variable which is in the root {@link api/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
Expand Down
2 changes: 1 addition & 1 deletion docs/content/cookbook/index.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ allowing you to send links to specific screens in your app.

# Services

{@link api/angular.module.ng Services}: Services are long lived objects in your applications that are
{@link api/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
Expand Down
2 changes: 1 addition & 1 deletion docs/content/cookbook/mvc.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,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.module.ng.$rootScope.Scope#$watch $watch()} to set up a listener that invokes `readUrl()` when needed.
api/ng.$rootScope.Scope#$watch $watch()} to set up a listener that invokes `readUrl()` when needed.
18 changes: 9 additions & 9 deletions docs/content/guide/bootstrap.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,26 @@ initialization.
* If you chose to use the old style directive syntax `ng:` then include xml-namespace in `html`
to make IE happy. (This is here for historical resons, and we no longer recomend use of
`ng:`.)

<html xmlns:ng="http://angularjs.org">



# Automatic Initialization

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

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


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


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

<pre>
<!doctype html>
Expand Down
18 changes: 9 additions & 9 deletions docs/content/guide/compiler.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

# Overview

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

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

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

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

# Compiler

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

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

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

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

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

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

# Understanding View

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

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

Expand Down
8 changes: 4 additions & 4 deletions docs/content/guide/dev_guide.e2e-testing.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -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/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/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/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/ng.$location $location.hash()} of the currently loaded page in
the test frame.

## expect(future).{matcher}
Expand Down
12 changes: 6 additions & 6 deletions docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

In angular, a controller is a JavaScript function(type/class) that is used to augment instances of
angular {@link scope 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/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.

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

# Using Controllers Correctly

Expand Down Expand Up @@ -68,9 +68,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
scope.$new} api or implicitly via the {@link api/angular.module.ng.$compileProvider.directive.ngController ngController
directive} or {@link api/angular.module.ng.$route $route service}.
You can associate controllers with scope objects explicitly via the {@link api/ng.$rootScope.Scope#$new
scope.$new} api or implicitly via the {@link api/ng.directive:ngController ngController
directive} or {@link api/ng.$route $route service}.


## Controller Constructor and Methods Example
Expand Down Expand Up @@ -157,7 +157,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/ng.$rootScope.Scope Scope} inheritance. Let's
have a look at an example:

<pre>
Expand Down
4 changes: 2 additions & 2 deletions docs/content/guide/dev_guide.mvc.understanding_model.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ occurs in controllers:

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

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

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions docs/content/guide/dev_guide.mvc.understanding_view.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ the DOM based on information in the template, controller and model.

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

Expand Down
14 changes: 7 additions & 7 deletions docs/content/guide/dev_guide.services.$location.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ 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/ng.$locationProvider $locationProvider} and set the parameters as follows:


- **html5Mode(mode)**: {boolean}<br />
Expand Down Expand Up @@ -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.module.ng.$rootScope.Scope scope} life-cycle and coalesces multiple `$location`
aware of the {@link api/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
Expand Down Expand Up @@ -489,11 +489,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/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/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
Expand All @@ -513,7 +513,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/ng.$rootScope.Scope scope} life-cycle. This means it's your responsibility to call `scope.$apply()`.

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

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

# Related API

* {@link api/angular.module.ng.$location $location API}
* {@link api/ng.$location $location API}



6 changes: 3 additions & 3 deletions docs/content/guide/dev_guide.services.creating_services.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
While angular offers several useful services, for any nontrivial application you'll find it useful
to write your own custom services. To do this you begin by registering a service factory function
with a module either via the {@link api/angular.module Module#factory api} or directly
via the {@link api/angular.module.AUTO.$provide $provide} api inside of module config function.
via the {@link api/AUTO.$provide $provide} api inside of module config function.

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

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

Using the angular.Module api:
Expand Down Expand Up @@ -101,4 +101,4 @@ important.

## Related API

* {@link api/angular.module.ng Angular Service API}
* {@link api/ng Angular Service API}
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ dependencies with the `$inject` property.

## Related API

{@link api/angular.module.ng Angular Service API}
{@link api/ng Angular Service API}
Loading

0 comments on commit f16150d

Please sign in to comment.