diff --git a/angularFiles.js b/angularFiles.js index 1ffe3310b336..39ccec907d0a 100755 --- a/angularFiles.js +++ b/angularFiles.js @@ -5,6 +5,7 @@ angularFiles = { 'src/AngularPublic.js', 'src/jqLite.js', 'src/apis.js', + 'src/ngError.js', 'src/auto/injector.js', diff --git a/docs/content/guide/compiler.ngdoc b/docs/content/guide/compiler.ngdoc index dc835808e239..fbba4a0eb638 100644 --- a/docs/content/guide/compiler.ngdoc +++ b/docs/content/guide/compiler.ngdoc @@ -6,21 +6,21 @@ 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 +and even create new HTML elements or attributes with custom behavior. Angular calls these behavior extensions {@link api/ng.$compileProvider#directive directives}. HTML has a lot of constructs for formatting the HTML for static documents in a declarative fashion. For example if something needs to be centered, there is no need to provide instructions to the -browser how the window size needs to be divided in half so that center is found, and that this -center needs to be aligned with the text's center. Simply add `align="center"` attribute to any +browser how the window size needs to be divided in half so that the center is found, and that this +center needs to be aligned with the text's center. Simply add an `align="center"` attribute to any element to achieve the desired behavior. Such is the power of declarative language. 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 the 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 +expect that you will create directives that are specific to your app. These extensions become a Domain Specific Language for building your application. All of this compilation takes place in the web browser; no server side or pre-compilation step is @@ -39,17 +39,16 @@ process happens in two phases. scope model are reflected in the view, and any user interactions with the view are reflected in the scope model. This makes the scope model the single source of truth. -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. +Some directives such as {@link api/ng.directive:ngRepeat `ng-repeat`} clone DOM elements once +for each item in a 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. # Directive -A directive is a behavior which should be triggered when specific HTML constructs are encountered in -the compilation process. The directives can be placed in element names, attributes, class names, as -well as comments. Here are some equivalent examples of invoking the {@link +A directive is a behavior which should be triggered when specific HTML constructs are encountered +during the compilation process. The directives can be placed in element names, attributes, class +names, as well as comments. Here are some equivalent examples of invoking the {@link api/ng.directive:ngBind `ng-bind`} directive.
diff --git a/docs/content/guide/concepts.ngdoc b/docs/content/guide/concepts.ngdoc
index 5e333c98c48f..fc5bce0add12 100644
--- a/docs/content/guide/concepts.ngdoc
+++ b/docs/content/guide/concepts.ngdoc
@@ -292,7 +292,7 @@ rendering the view compared to most other templating systems.
 # Directives
 
 A directive is a behavior or DOM transformation which is triggered by the presence of a custom attribute,
-element name, or a class name. A directive allows you to extend the HTML vocabulary in a
+element name, class name or comment. A directive allows you to extend the HTML vocabulary in a
 declarative fashion. Following is an example which enables data-binding for the `contenteditable`
 in HTML.
 
diff --git a/docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc b/docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc
index 47d594278609..e3a570d47761 100644
--- a/docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc
+++ b/docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc
@@ -21,9 +21,11 @@ constructor). Constructors are always applied to an existing scope object.
 
 You set up the initial state of a scope by creating model properties. For example:
 
-function GreetingCtrl($scope) {
- $scope.greeting = 'Hola!';
-}
+
+    function GreetingCtrl($scope) {
+        $scope.greeting = 'Hola!';
+    }
+
The `GreetingCtrl` controller creates a `greeting` model which can be referred to in a template. @@ -32,11 +34,13 @@ in the global scope. This is only for demonstration purposes - in a real application you should use the `.controller` method of your Angular module for your application as follows: -var myApp = angular.module('myApp',[]); +
+    var myApp = angular.module('myApp',[]);
 
-myApp.controller('GreetingCtrl', ['$scope', function($scope) {
-  $scope.greeting = 'Hola!';
-}]);
+    myApp.controller('GreetingCtrl', ['$scope', function($scope) {
+        $scope.greeting = 'Hola!';
+    }]);
+
Note also that we use the array notation to explicitly specify the dependency of the controller on the `$scope` service provided by Angular. diff --git a/docs/content/guide/dev_guide.mvc.understanding_model.ngdoc b/docs/content/guide/dev_guide.mvc.understanding_model.ngdoc index 9e2795347b6c..1f4715c1be44 100644 --- a/docs/content/guide/dev_guide.mvc.understanding_model.ngdoc +++ b/docs/content/guide/dev_guide.mvc.understanding_model.ngdoc @@ -28,7 +28,7 @@ occurs in controllers: * Use an {@link expression angular expression} with an assignment operator in templates: - + * Use {@link api/ng.directive:ngInit ngInit directive} in templates (for toy/example apps only, not recommended for real applications): diff --git a/docs/content/guide/dev_guide.unit-testing.ngdoc b/docs/content/guide/dev_guide.unit-testing.ngdoc index 175af471ff22..c27180fea84a 100644 --- a/docs/content/guide/dev_guide.unit-testing.ngdoc +++ b/docs/content/guide/dev_guide.unit-testing.ngdoc @@ -294,14 +294,14 @@ app.directive('aGreatEye', function () { return { restrict: 'E', replace: true, - template: '

lidless, wreathed in flame

' + template: '

lidless, wreathed in flame, {{1 + 1}} times

' }; });
This directive is used as a tag ``. It replaces the entire tag with the -template `

lidless, wreathed in flame

`. Now we are going to write a jasmine unit test to -verify this functionality. +template `

lidless, wreathed in flame, {{1 + 1}} times

`. Now we are going to write a jasmine unit test to +verify this functionality. Note that the expression `{{1 + 1}}` times will also be evaluated in the rendered content.
 describe('Unit testing great quotes', function() {
@@ -322,30 +322,18 @@ describe('Unit testing great quotes', function() {
     it('Replaces the element with the appropriate content', function() {
         // Compile a piece of HTML containing the directive
         var element = $compile("")($rootScope);
+        // fire all the watches, so the scope expression {{1 + 1}} will be evaluated
+        $rootScope.$digest();
         // Check that the compiled element contains the templated content
-        expect(element.html()).toContain("lidless, wreathed in flame");
+        expect(element.html()).toContain("lidless, wreathed in flame, 2 times");
     });
 });
 
We inject the $compile service and $rootScope before each jasmine test. The $compile service is used to render the aGreatEye directive. After rendering the directive we ensure that the directive has -replaced the content and "lidless, wreathed in flame" is present. +replaced the content and "lidless, wreathed in flame, 2 times" is present. -## Mocks -oue - -## Global State Isolation -oue - -# Preferred way of Testing -uo - -## JavaScriptTestDriver -ou - -## Jasmine -ou ## Sample project See the {@link https://github.com/angular/angular-seed angular-seed} project for an example. diff --git a/docs/content/guide/di.ngdoc b/docs/content/guide/di.ngdoc index a723e6c38740..e1b57d31aa6e 100644 --- a/docs/content/guide/di.ngdoc +++ b/docs/content/guide/di.ngdoc @@ -102,12 +102,12 @@ dependency lookup responsibility to the injector by declaring the dependencies a Notice that by having the `ng-controller` instantiate the class, it can satisfy all of the dependencies of `MyController` without the controller ever knowing about the injector. This is -the best outcome. The application code simply ask for the dependencies it needs, without having to +the best outcome. The application code simply asks for the dependencies it needs, without having to deal with the injector. This setup does not break the Law of Demeter. # Dependency Annotation -How does the injector know what service needs to be injected? +How does the injector know what service needs to be injected? The application developer needs to provide annotation information that the injector uses in order to resolve the dependencies. Throughout Angular certain API functions are invoked using the @@ -137,7 +137,7 @@ http://www.pretotyping.org/ pretotyping}, and demo applications. # `$inject` Annotation To allow the minifers to rename the function parameters and still be able to inject right services -the function needs to be annotate with the `$inject` property. The `$inject` property is an array +the function needs to be annotated with the `$inject` property. The `$inject` property is an array of service names to inject.
diff --git a/docs/content/guide/overview.ngdoc b/docs/content/guide/overview.ngdoc
index 837c0a3f3a1b..a8e806cd5f27 100644
--- a/docs/content/guide/overview.ngdoc
+++ b/docs/content/guide/overview.ngdoc
@@ -8,28 +8,28 @@
 AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template
 language and lets you extend HTML's syntax to express your application's components clearly and
 succinctly. Out of the box, it eliminates much of the code you currently write through data
-binding and dependency injection. And it all happens in JavaScript within the browser making it an
-ideal partner with any server technology.
+binding and dependency injection. And it all happens in JavaScript within the browser, making it
+an ideal partner with any server technology.
 
 Angular is what HTML would have been had it been designed for applications. HTML is a great
 declarative language for static documents. It does not contain much in the way of creating
-applications, and as a result building web applications is an exercise in *what do I have to do, so
-that I trick the browser in to doing what I want.*
+applications, and as a result building web applications is an exercise in *what do I have to do
+to trick the browser into doing what I want.*
 
-The impedance mismatch between dynamic applications and static documents is often solved as:
+The impedance mismatch between dynamic applications and static documents is often solved with:
 
-  * **library** - a collection of functions which are useful when writing web apps. Your code is
+  * **a library** - a collection of functions which are useful when writing web apps. Your code is
     in charge and it calls into the library when it sees fit. E.g., `jQuery`.
   * **frameworks** - a particular implementation of a web application, where your code fills in
     the details. The framework is in charge and it calls into your code when it needs something
-    app specific. E.g., `knockout`, `sproutcore`, etc.
+    app specific. E.g., `knockout`, `ember`, etc.
 
 
 Angular takes another approach. It attempts to minimize the impedance mismatch between document
 centric HTML and what an application needs by creating new HTML constructs. Angular teaches the
 browser new syntax through a construct we call directives. Examples include:
 
-  * Data binding as in `{{}}`.
+  * Data binding, as in `{{}}`.
   * DOM control structures for repeating/hiding DOM fragments.
   * Support for forms and form validation.
   * Attaching code-behind to DOM elements.
@@ -37,13 +37,13 @@ browser new syntax through a construct we call directives. Examples include:
 
 
 
-## End-to-end solution
+## A complete client-side solution
 
-Angular tries to be an end-to-end solution, when building a web application. This means it is
-not a single piece in an overall puzzle of building a web application, but an end-to-end solution.
-This makes Angular opinionated about how a CRUD application should be built. But while it is
-opinionated, it also tries to make sure that its opinion is just a starting point, which you can
-easily change. Angular comes with the following out-of-the-box:
+Angular is not a single piece in the overall puzzle of building the client-side of a web
+application. It handles all of the DOM and AJAX glue code you once wrote by hand and puts it in a
+well-defined structure. This makes Angular opinionated about how a CRUD application should be
+built. But while it is opinionated, it also tries to make sure that its opinion is just a
+starting point you can easily change. Angular comes with the following out-of-the-box:
 
   * Everything you need to build a CRUD app in a cohesive set: data-binding, basic templating
     directives, form validation, routing, deep-linking, reusable components, dependency injection.
diff --git a/docs/img/AngularJS-small.png b/docs/img/AngularJS-small.png
deleted file mode 100644
index ab5e20f883c1..000000000000
Binary files a/docs/img/AngularJS-small.png and /dev/null differ
diff --git a/docs/img/angular_logo_for_dark_background_small.svg b/docs/img/angular_logo_for_dark_background_small.svg
new file mode 100644
index 000000000000..58a6cc199a48
--- /dev/null
+++ b/docs/img/angular_logo_for_dark_background_small.svg
@@ -0,0 +1,41 @@
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/spec/ngdocSpec.js b/docs/spec/ngdocSpec.js
index 3cd9834b9423..9eed24ca28db 100644
--- a/docs/spec/ngdocSpec.js
+++ b/docs/spec/ngdocSpec.js
@@ -150,6 +150,11 @@ describe('ngdoc', function() {
         toMatch('
\n\n

One

\n\n/); + }); + it('should ignore nested doc widgets', function() { expect(new Doc().markdown( 'before
\n' + diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 7c07f00ffdcf..d66f33e64b0c 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -214,6 +214,10 @@ Doc.prototype = { (title || url).replace(/^#/g, '').replace(/\n/g, ' ') + (isAngular ? '' : '') + ''; + }). + replace(/{@type\s+(\S+)(?:\s+(\S+))?}/g, function(_, type, url) { + url = url || '#'; + return '' + type + ''; }); }); text = parts.join(''); diff --git a/docs/src/templates/css/docs.css b/docs/src/templates/css/docs.css index 00aac98d5a1d..a98f7429cae3 100644 --- a/docs/src/templates/css/docs.css +++ b/docs/src/templates/css/docs.css @@ -1,8 +1,3 @@ -img.AngularJS-small { - width: 95px; - height: 25px; -} - /* this is here to avoid the display=block shuffling of ngShow */ .breadcrumb li > * { float:left; diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html index 6054f81344e0..477fbf43e1f5 100644 --- a/docs/src/templates/index.html +++ b/docs/src/templates/index.html @@ -118,7 +118,12 @@