Skip to content

Commit efd5bd7

Browse files
committed
Merge remote-tracking branch 'upstream/master' into ng-repeat-start
2 parents 6861142 + af0eaa3 commit efd5bd7

40 files changed

+984
-1593
lines changed

docs/content/guide/di.ngdoc

+16-13
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ book.
1414

1515
## DI in a nutshell
1616

17-
There are only three ways how an object or a function can get a hold of its dependencies:
17+
There are only three ways an object or a function can get a hold of its dependencies:
1818

1919
1. The dependency can be created, typically using the `new` operator.
2020

@@ -23,8 +23,8 @@ There are only three ways how an object or a function can get a hold of its depe
2323
3. The dependency can be passed in to where it is needed.
2424

2525

26-
The first two options of creating or looking up dependencies are not optimal, because they hard
27-
code the dependency, making it difficult, if not impossible, to modify the dependencies.
26+
The first two options of creating or looking up dependencies are not optimal because they hard
27+
code the dependency. This make it difficult, if not impossible, to modify the dependencies.
2828
This is especially problematic in tests, where it is often desirable to provide mock dependencies
2929
for test isolation.
3030

@@ -33,26 +33,26 @@ dependency from the component. The dependency is simply handed to the component.
3333

3434
<pre>
3535
function SomeClass(greeter) {
36-
this.greeter = greeter
36+
this.greeter = greeter;
3737
}
3838

3939
SomeClass.prototype.doSomething = function(name) {
4040
this.greeter.greet(name);
4141
}
4242
</pre>
4343

44-
In the above example the `SomeClass` is not concerned with locating the `greeter` dependency, it
44+
In the above example `SomeClass` is not concerned with locating the `greeter` dependency, it
4545
is simply handed the `greeter` at runtime.
4646

47-
This is desirable, but it puts the responsibility of getting hold of the dependency onto the
48-
code responsible for the construction of `SomeClass`.
47+
This is desirable, but it puts the responsibility of getting hold of the dependency on the
48+
code that constructs `SomeClass`.
4949

5050
To manage the responsibility of dependency creation, each Angular application has an {@link
5151
api/angular.injector injector}. The injector is a service locator that is responsible for
5252
construction and lookup of dependencies.
5353

54+
Here is an example of using the injector service:
5455

55-
Here is an example of using the injector service.
5656
<pre>
5757
// Provide the wiring information in a module
5858
angular.module('myModule', []).
@@ -101,7 +101,7 @@ dependency lookup responsibility to the injector by declaring the dependencies a
101101
</pre>
102102

103103
Notice that by having the `ng-controller` instantiate the class, it can satisfy all of the
104-
dependencies of the `MyController` without the controller ever knowing about the injector. This is
104+
dependencies of `MyController` without the controller ever knowing about the injector. This is
105105
the best outcome. The application code simply ask for the dependencies it needs, without having to
106106
deal with the injector. This setup does not break the Law of Demeter.
107107

@@ -159,16 +159,18 @@ Sometimes using the `$inject` annotation style is not convenient such as when an
159159
directives.
160160

161161
For example:
162+
162163
<pre>
163164
someModule.factory('greeter', function($window) {
164-
...;
165+
...
165166
});
166167
</pre>
167168

168-
Results in code bloat due to the need of temporary variable:
169+
Results in code bloat due to needing a temporary variable:
170+
169171
<pre>
170172
var greeterFactory = function(renamed$window) {
171-
...;
173+
...
172174
};
173175

174176
greeterFactory.$inject = ['$window'];
@@ -177,9 +179,10 @@ Results in code bloat due to the need of temporary variable:
177179
</pre>
178180

179181
For this reason the third annotation style is provided as well.
182+
180183
<pre>
181184
someModule.factory('greeter', ['$window', function(renamed$window) {
182-
...;
185+
...
183186
}]);
184187
</pre>
185188

docs/content/guide/directive.ngdoc

+7
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ Here's an example directive declared with a Directive Definition Object:
269269
transclude: false,
270270
restrict: 'A',
271271
scope: false,
272+
controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... },
272273
compile: function compile(tElement, tAttrs, transclude) {
273274
return {
274275
pre: function preLink(scope, iElement, iAttrs, controller) { ... },
@@ -392,6 +393,12 @@ compiler}. The attributes are:
392393
* `$transclude` - A transclude linking function pre-bound to the correct transclusion scope:
393394
`function(cloneLinkingFn)`.
394395

396+
To avoid errors after minification the bracket notation should be used:
397+
398+
<pre>
399+
controller: ['$scope', '$element', '$attrs', '$transclude', function($scope, $element, $attrs, $transclude) { ... }]
400+
</pre>
401+
395402
* `require` - Require another controller be passed into current directive linking function. The
396403
`require` takes a name of the directive controller to pass in. If no such controller can be
397404
found an error is raised. The name can be prefixed with:

docs/content/misc/contribute.ngdoc

+4
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ quite a good source for information on Git.
8888
development web server, run tests, and generate a build. Depending on your system, you can install Node either from source or as a
8989
pre-packaged bundle.
9090

91+
* {@link http://www.java.com Java}: JavaScript is minified using
92+
{@link https://developers.google.com/closure/ Closure Tools} jar. Make sure you have Java (version 6 or higher) installed
93+
and included in your {@link http://docs.oracle.com/javase/tutorial/essential/environment/paths.html PATH} variable.
94+
9195
Once installed, you'll also need several npms (node packages), which you can install once you checked out a local copy
9296
of the Angular repository (see below) with:
9397

docs/src/ngdoc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* All parsing/transformation code goes here. All code here should be sync to ease testing.
33
*/
44

5-
var Showdown = require('../../lib/showdown').Showdown;
5+
var Showdown = require('showdown');
66
var DOM = require('./dom.js').DOM;
77
var htmlEscape = require('./dom.js').htmlEscape;
88
var Example = require('./example.js').Example;
@@ -216,7 +216,7 @@ Doc.prototype = {
216216
});
217217
});
218218
text = parts.join('');
219-
text = new Showdown.converter().makeHtml(text);
219+
text = new Showdown.converter({ extensions : ['table'] }).makeHtml(text);
220220
text = text.replace(/(?:<p>)?(REPLACEME\d+)(?:<\/p>)?/g, function(_, id) {
221221
return placeholderMap[id];
222222
});

lib/showdown/index.js

-7
This file was deleted.

0 commit comments

Comments
 (0)