Skip to content

Commit fc060df

Browse files
committed
docs(guide/overview): Refactor overview and mvc docs
Before, there we multiple overview docs: - guide/overview - guide/introduction - guide/dev_guide.mvc - guide/dev_guide.mvc.understanding_model - guide/dev_guide.mvc.understanding_view - guide/concepts Now we have: - guide/introduction: High level description of Angular with the key benefits but without code or any concrete concepts - guide/concepts: explains all important concepts with a simple example and contains deep links to the other parts of the guide. All the old information was moved into existing documents or deleted when they were duplicates.
1 parent 947a44d commit fc060df

31 files changed

+4109
-4373
lines changed

Diff for: docs/components/angular-bootstrap/bootstrap-prettify.js

+16-14
Original file line numberDiff line numberDiff line change
@@ -169,21 +169,23 @@ directive.ngSetHtml = ['getEmbeddedTemplate', function(getEmbeddedTemplate) {
169169
directive.ngEvalJavascript = ['getEmbeddedTemplate', function(getEmbeddedTemplate) {
170170
return {
171171
compile: function (element, attr) {
172-
var script = getEmbeddedTemplate(attr.ngEvalJavascript);
173-
174-
try {
175-
if (window.execScript) { // IE
176-
window.execScript(script || '""'); // IE complains when evaling empty string
177-
} else {
178-
window.eval(script);
179-
}
180-
} catch (e) {
181-
if (window.console) {
182-
window.console.log(script, '\n', e);
183-
} else {
184-
window.alert(e);
172+
var fileNames = attr.ngEvalJavascript.split(' ');
173+
angular.forEach(fileNames, function(fileName) {
174+
var script = getEmbeddedTemplate(fileName);
175+
try {
176+
if (window.execScript) { // IE
177+
window.execScript(script || '""'); // IE complains when evaling empty string
178+
} else {
179+
window.eval(script + '//@ sourceURL=' + fileName);
180+
}
181+
} catch (e) {
182+
if (window.console) {
183+
window.console.log(script, '\n', e);
184+
} else {
185+
window.alert(e);
186+
}
185187
}
186-
}
188+
});
187189
}
188190
};
189191
}];

Diff for: docs/content/api/index.ngdoc

+11
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ Welcome to the AngularJS API docs page. These pages contain the AngularJS refere
88
The documentation is organized into **modules** which contain various components of an AngularJS application.
99
These components are directives, services, filters, providers, types, global APIs and testing mocks.
1010

11+
<div class="alert alert-info">
12+
**Angular Namspaces `$` and `$$`**
13+
14+
To prevent accidental name collisions with your code,
15+
Angular prefixes names of public objects with `$` and names of private objects with `$$`.
16+
Please do not use the `$` or `$$` prefix in your code.
17+
</div>
18+
19+
## Angular Namespace
20+
21+
1122
## {@link ng ng (core module)}
1223
This module is provided by default and contains the core components of AngularJS.
1324

Diff for: docs/content/cookbook/helloworld.ngdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ Take a look through the source and note:
3434
* There is no need for listener registration and event firing on change events.
3535
* 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.
37-
* The concept of {@link guide/dev_guide.templates.databinding data binding}, which reflects any
37+
* The concept of {@link guide/databinding data binding}, which reflects any
3838
changes to the
3939
input field in the greeting text.

Diff for: docs/content/guide/bootstrap.ngdoc

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ initialization.
5151

5252
## Automatic Initialization
5353

54+
<img class="pull-right" style="padding-left: 3em;" src="img/guide/concepts-startup.png">
55+
5456
Angular initializes automatically upon `DOMContentLoaded` event or when the `angular.js` script is
5557
evaluated if at that time `document.readyState` is set to `'complete'`. At this point Angular looks
5658
for the {@link api/ng.directive:ngApp `ng-app`} directive which designates your application root.

Diff for: docs/content/guide/concepts.ngdoc

+349-416
Large diffs are not rendered by default.

Diff for: docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc renamed to docs/content/guide/controller.ngdoc

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@ngdoc overview
2-
@name Developer Guide: About MVC in Angular: Understanding the Controller Component
2+
@name Controllers
33
@description
44

55
# Understanding Controllers
@@ -85,7 +85,7 @@ expression in the template:
8585
</div>
8686
</pre>
8787

88-
As discussed in the {@link dev_guide.mvc.understanding_model Model} section of this guide, any
88+
As discussed in the {@link concepts Concepts} section of this guide, any
8989
objects (or primitives) assigned to the scope become model properties. Any methods assigned to
9090
the scope are available in the template/view, and can be invoked via angular expressions
9191
and `ng` event handler directives (e.g. {@link api/ng.directive:ngClick ngClick}).
@@ -105,7 +105,7 @@ Do not use Controllers for:
105105
- Any kind of DOM manipulation — Controllers should contain only business logic. DOM
106106
manipulation (the presentation logic of an application) is well known for being hard to test.
107107
Putting any presentation logic into Controllers significantly affects testability of the business
108-
logic. Angular offers {@link dev_guide.templates.databinding databinding} for automatic DOM manipulation. If
108+
logic. Angular offers {@link databinding databinding} for automatic DOM manipulation. If
109109
you have to perform your own manual DOM manipulation, encapsulate the presentation logic in
110110
{@link guide/directive directives}.
111111
- Input formatting — Use {@link forms angular form controls} instead.
@@ -126,7 +126,7 @@ directive} or {@link api/ngRoute.$route $route service}.
126126
To illustrate further how Controller components work in Angular, let's create a little app with the
127127
following components:
128128

129-
- A {@link dev_guide.templates template} with two buttons and a simple message
129+
- A {@link templates template} with two buttons and a simple message
130130
- A model consisting of a string named `spice`
131131
- A Controller with two functions that set the value of `spice`
132132

@@ -337,10 +337,4 @@ describe('state', function() {
337337
</pre>
338338

339339

340-
## Related Topics
341-
342-
* {@link dev_guide.mvc About MVC in Angular}
343-
* {@link dev_guide.mvc.understanding_model Understanding the Model Component}
344-
* {@link dev_guide.mvc.understanding_view Understanding the View Component}
345-
346340

Diff for: docs/content/guide/dev_guide.templates.databinding.ngdoc renamed to docs/content/guide/databinding.ngdoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@ngdoc overview
2-
@name Developer Guide: Templates: Data Binding in Angular
2+
@name Data Binding
33
@description
44

55
Data-binding in Angular web apps is the automatic synchronization of data between the model and view
@@ -35,4 +35,4 @@ isolation without the view and the related DOM/browser dependency.
3535
## Related Topics
3636

3737
* {@link scope Angular Scopes}
38-
* {@link dev_guide.templates Angular Templates}
38+
* {@link templates Angular Templates}

Diff for: docs/content/guide/dev_guide.mvc.ngdoc

-24
This file was deleted.

Diff for: docs/content/guide/dev_guide.mvc.understanding_model.ngdoc

-71
This file was deleted.

Diff for: docs/content/guide/dev_guide.mvc.understanding_view.ngdoc

-22
This file was deleted.

Diff for: docs/content/guide/dev_guide.templates.css-styling.ngdoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Angular sets these CSS classes. It is up to your application to provide useful s
1313

1414
* `ng-binding`
1515
- **Usage:** angular applies this class to any element that is attached to a data binding, via `ng-bind` or
16-
{{}} curly braces, for example. (see {@link guide/dev_guide.templates.databinding databinding} guide)
16+
{{}} curly braces, for example. (see {@link guide/databinding databinding} guide)
1717

1818
* `ng-invalid`, `ng-valid`
1919
- **Usage:** angular applies this class to an input widget element if that element's input does
@@ -27,5 +27,5 @@ Angular sets these CSS classes. It is up to your application to provide useful s
2727

2828
## Related Topics
2929

30-
* {@link dev_guide.templates Angular Templates}
30+
* {@link templates Angular Templates}
3131
* {@link forms Angular Forms}

Diff for: docs/content/guide/di.ngdoc

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ is simply handed the `greeter` at runtime.
4747
This is desirable, but it puts the responsibility of getting hold of the dependency on the
4848
code that constructs `SomeClass`.
4949

50+
<img class="pull-right" style="padding-left: 3em; padding-bottom: 1em;" src="img/guide/concepts-module-injector.png">
51+
5052
To manage the responsibility of dependency creation, each Angular application has an {@link
5153
api/angular.injector injector}. The injector is a service locator that is responsible for
5254
construction and lookup of dependencies.

Diff for: docs/content/guide/index.ngdoc

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66

77
Everything you need to know about AngularJS
88

9-
## First steps
9+
* {@link guide/introduction What is AngularJS?}
1010

11-
Just starting with Angular? These links will give you a solid foundation to start building apps.
11+
* {@link guide/concepts Conceptual Overview}
12+
13+
## Tutorials
1214

1315
* {@link tutorial/index Official AngularJS Tutorial}
1416

@@ -26,7 +28,7 @@ Just starting with Angular? These links will give you a solid foundation to sta
2628

2729
In Angular applications, you move the job of filling page templates with data from the server to the client. The result is a system better structured for dynamic page updates. Below are the core features you'll use.
2830

29-
* {@link guide/dev_guide.templates.databinding Data binding}
31+
* {@link guide/databinding Data binding}
3032

3133
* {@link guide/expression Expressions}
3234

@@ -42,8 +44,6 @@ In Angular applications, you move the job of filling page templates with data fr
4244

4345
* **Blog post: **[When to use directives, controllers or services](http://kirkbushell.me/when-to-use-directives-controllers-or-services-in-angular/)
4446

45-
* **Separation of concerns:** {@link guide/dev_guide.mvc Model-View-Controller}
46-
4747
* **App wiring:** {@link guide/di Dependency injection}
4848

4949
* **Exposing model to templates:** {@link guide/scope Scopes}

0 commit comments

Comments
 (0)