Compare commits
420 Commits
creating-l
...
10.0.6
Author | SHA1 | Date | |
---|---|---|---|
cdda60a430 | |||
7570356bfa | |||
c4a97d822e | |||
fc4dfc5eb1 | |||
25d95dae6d | |||
1c4fcce2a1 | |||
6e73faaed7 | |||
41c9910613 | |||
aaddef213d | |||
02f3aee1db | |||
c27ba96093 | |||
c5a474cb54 | |||
d5264f5645 | |||
0cd4b87021 | |||
b1e7775a8a | |||
87f5feff11 | |||
c3ddc3d6b1 | |||
cec39a7d16 | |||
c6c8e15813 | |||
752fd14fe5 | |||
776067cd43 | |||
e87a46be21 | |||
89a7ff3ada | |||
3d6e50dc02 | |||
264950bbf2 | |||
84c5be0b5b | |||
eda8f2f8b9 | |||
cc52945d00 | |||
07f184a69d | |||
a123ef58b1 | |||
024126dde4 | |||
4275c34818 | |||
c4e6f585c5 | |||
7467fd36b9 | |||
aca01985fd | |||
eb5e14e6e0 | |||
b8af10902f | |||
f411c9e5b9 | |||
7f455e6eec | |||
e36caafa52 | |||
5e89d98876 | |||
200dbd4860 | |||
c90952884a | |||
7c2d8fc672 | |||
a50a688aaf | |||
6ec7297e43 | |||
f264cd1cb8 | |||
fc17bddcde | |||
0765626761 | |||
f146b34042 | |||
f899d6ea44 | |||
c18d7a1469 | |||
2c7ff82f31 | |||
3f8f3a2daa | |||
f5eeb1a714 | |||
2af3d9c040 | |||
4664acce50 | |||
3797861dfe | |||
d6d3984524 | |||
c17f5c10cc | |||
9cb318f5a2 | |||
b026dd8b52 | |||
0ebc316311 | |||
dc412c5f02 | |||
e80278cf02 | |||
307699ac89 | |||
4df0b7e9de | |||
371831f9cb | |||
8e305e7099 | |||
481df830ad | |||
14b4718cc2 | |||
7b6e73cb98 | |||
f2ca4634e2 | |||
d30cf2f9d6 | |||
e9cb6fbe87 | |||
99960a98d2 | |||
9ac3383d01 | |||
06ac75724f | |||
a1d691ecc8 | |||
6e329721be | |||
739bf5c325 | |||
ee340b7c6c | |||
17ddab98fb | |||
4f65f473e4 | |||
527a04d21e | |||
f2ee468d76 | |||
0320096538 | |||
7abb48adfe | |||
b40d3c0817 | |||
0e5617152a | |||
dba402344f | |||
13d176302b | |||
e3b801053a | |||
6626739798 | |||
396033da80 | |||
02ee9d2938 | |||
a4c7f183d7 | |||
d690eec88f | |||
10e4dfae27 | |||
f8d948b46b | |||
9cf78d5701 | |||
45471dbbd6 | |||
387e8386d1 | |||
eec6e4be7a | |||
b711f25892 | |||
788f0453f7 | |||
45b1775a53 | |||
53e4ff72d2 | |||
7813a7d129 | |||
c0ced6dc2d | |||
8157ee87b0 | |||
ab051aba27 | |||
5a61ef0c49 | |||
c451dbda9f | |||
0d38288078 | |||
2e9b953e9d | |||
a94383f168 | |||
75c40ddd61 | |||
86a75a0670 | |||
c776825fdd | |||
1cc9383d91 | |||
8ed1e53e99 | |||
7833c88ac4 | |||
12f177399f | |||
5be32366be | |||
5b7d2eeabf | |||
6cd10a1b10 | |||
822652aa0d | |||
cf47ace493 | |||
0595f11950 | |||
35df312ea4 | |||
489eb8519e | |||
b76a2dc2cb | |||
f2f5f7fc6e | |||
8ee23ba67b | |||
ecb422b360 | |||
60389d5441 | |||
b186db70db | |||
324b6f1b1a | |||
cdba1d37a4 | |||
dc42c97ee4 | |||
bc00e8d312 | |||
720b71d01f | |||
1132b07c53 | |||
9230194794 | |||
d724896f04 | |||
29866dfb91 | |||
a249622159 | |||
9f2393fb80 | |||
d5f8040d0a | |||
e0b8ea136b | |||
879b2273c1 | |||
f24972b1b1 | |||
d2886b3bb4 | |||
f296fea112 | |||
2605fc46e7 | |||
9d54b3a14b | |||
d09a6283ed | |||
1c168c3a44 | |||
0f74479c47 | |||
790bb949f6 | |||
2adcad6dd2 | |||
242ef1ace1 | |||
842b6a1247 | |||
98335529eb | |||
ca7ee794bf | |||
f9f2ba6faf | |||
aea1d211d4 | |||
57a518a36d | |||
29b83189b0 | |||
1d3df7885d | |||
fd06ffa2af | |||
36a1622dd1 | |||
7a91b23cb5 | |||
4b90b6a226 | |||
b13daa4cdf | |||
0c6f026828 | |||
a2520bd267 | |||
b928a209a4 | |||
89e16ed6a5 | |||
1a1f99af37 | |||
df2cd37ed2 | |||
12a71bc6bc | |||
7d270c235a | |||
b0b7248504 | |||
78460c1848 | |||
75b119eafc | |||
64b0ae93f7 | |||
7c0b25f5a6 | |||
07b5df3a19 | |||
e7023726f4 | |||
a9ccd9254c | |||
335f3271d2 | |||
7f93f7ef47 | |||
cf46a87fcd | |||
ad6680f602 | |||
5e287f67af | |||
ecfe6e0609 | |||
df9790dd11 | |||
67cfc4c9bc | |||
a68e623c80 | |||
9e3915ba48 | |||
ba2de61748 | |||
a9a4edebe2 | |||
64f2ffa166 | |||
13020b9cc2 | |||
96b96fba0f | |||
2cbe53a9ba | |||
48755114e5 | |||
a5d5f67be7 | |||
dfb58c44a2 | |||
69948ce919 | |||
3190ccf3b2 | |||
a8ea8173aa | |||
e13a49d1f0 | |||
2f0b8f675a | |||
c2aed033ba | |||
0f8a780b0d | |||
c5bc2e77c8 | |||
079310dc7c | |||
0d2cdf6165 | |||
436dde271f | |||
96891a076f | |||
9ce0067bdf | |||
345940bbc1 | |||
c49507b289 | |||
c730142508 | |||
27aa00b15f | |||
36a00a255b | |||
0e3249c89b | |||
920019ab70 | |||
82c8b44db7 | |||
bb3a307d5a | |||
dcb0ddaf5e | |||
4c1edd52c5 | |||
d512e27979 | |||
0619d82e0b | |||
a4038d5b94 | |||
e3d5e1fab7 | |||
035036308a | |||
0d29259d9b | |||
26b0f3dc96 | |||
5c9306b0fe | |||
3befb0e4b9 | |||
97bb88f10b | |||
6c7467a58b | |||
c579a85c12 | |||
400fdd08fd | |||
c1fe6c9c81 | |||
c58a0bea91 | |||
88a934b93c | |||
cde5cced69 | |||
472bedd3ea | |||
d8a06d03bd | |||
32020f9fb3 | |||
d574b14934 | |||
00c5d89e7d | |||
d2c8aefe64 | |||
ba796bbdd3 | |||
a0bb2ba7b7 | |||
f9fa3b5b6c | |||
f89d438116 | |||
1abe791d46 | |||
1502ae78b6 | |||
bad6e719de | |||
8c7129f3d2 | |||
dbff6f71e1 | |||
fcd934ccf6 | |||
45a8f340d9 | |||
5856513405 | |||
01fa3ee5c3 | |||
b8d69ffdf3 | |||
7ef60ec2a9 | |||
83f905c0e1 | |||
72ba3a3918 | |||
df10597da4 | |||
5db2e794a9 | |||
486aa06747 | |||
01ce1b32df | |||
c78b0b2c51 | |||
9ade1c3ea3 | |||
315a4cfcd4 | |||
11c04027ab | |||
eabe3b4c39 | |||
d471454675 | |||
bf57776b59 | |||
a32579ae5b | |||
780601d27a | |||
c909e731d7 | |||
9b8eb42354 | |||
0757174e8e | |||
3a43cdefe8 | |||
38c48beddd | |||
ad5749fb04 | |||
f6a838e9ee | |||
a6d1f4aaf1 | |||
eca8d11ee2 | |||
a195b7dbe4 | |||
083d7ec902 | |||
9d2d0cae6d | |||
c2f4a9bf71 | |||
231095fe8a | |||
28a532483a | |||
83853a215d | |||
8248307a99 | |||
67bd88b19a | |||
9f698b4de0 | |||
742f3d6787 | |||
323651bd38 | |||
9d397eb5a1 | |||
6114cd2bd4 | |||
d494f7bd5e | |||
ec6a7ab721 | |||
ad6d2b4619 | |||
c093390010 | |||
acd69f2be2 | |||
5d2f341653 | |||
420d1c35f5 | |||
08647267bb | |||
215d50d2f6 | |||
bf2cb6fa48 | |||
e97a2d4123 | |||
585e3f6adc | |||
7f77ce1a48 | |||
a1616ce181 | |||
1c22dff714 | |||
8d1d6e8f70 | |||
e7f4aba5a3 | |||
fdbe9f5d9f | |||
8bead6bfdd | |||
52dda73dbb | |||
31b3888a2f | |||
6f938470c2 | |||
776c4afc03 | |||
536dd647c6 | |||
51d581ab27 | |||
75294e7dad | |||
04bada7a9d | |||
2349143477 | |||
e9bff5fe9f | |||
411cb0cb92 | |||
53e1fb3554 | |||
2cb3b66640 | |||
5af3144330 | |||
e4043cbb3a | |||
fff424a35f | |||
b5d1c8b05a | |||
d713e33cc4 | |||
3d327d25f0 | |||
077283bf0f | |||
9ec25ea036 | |||
878cfe669c | |||
5f0be3cb2e | |||
9e28e14c08 | |||
954d002884 | |||
0a48591e53 | |||
d37c723951 | |||
9078ca557e | |||
2be1ef6ba0 | |||
47c02efccb | |||
d7ecfb432a | |||
59abf4a33f | |||
d6e715e726 | |||
fcfcd1037c | |||
f3ccd29e7b | |||
5c0bdae809 | |||
838902556b | |||
c6872c02d8 | |||
819982ea20 | |||
f9daa136c3 | |||
6a0d2ed6c8 | |||
2c1f35e794 | |||
5345e8da45 | |||
e35269dd87 | |||
60a03b7ef7 | |||
305b5a3887 | |||
bc549361d3 | |||
084b627f2e | |||
6755d00601 | |||
cba1da3e44 | |||
7be8bb1489 | |||
c7c0c1f626 | |||
3aa4629f92 | |||
2d86dbb090 | |||
91767ff0f9 | |||
078b004ecc | |||
930d204d83 | |||
8d82cdfc77 | |||
cb6996b5c3 | |||
a4f7740332 | |||
ba0faa2f77 | |||
3e68029522 | |||
b4e26b5828 | |||
15cf7fcac2 | |||
24ff0eb13b | |||
cf86f72eb7 | |||
61486f14f1 | |||
d16a7f3ecc | |||
82761ec50e | |||
235bfa77a9 | |||
299ae1bb1c | |||
80f7522dab | |||
028921e369 | |||
a4e11bb524 | |||
a4131752d2 | |||
060dcfbba1 | |||
4be7008f80 | |||
4a0d05515e | |||
83ab99c746 | |||
270da1f69f | |||
6b0e46e36c | |||
3642707145 | |||
0ea76edfd8 | |||
d493a83b2b | |||
f1721d5cef | |||
5b3fd6aa82 | |||
6f829180f7 | |||
27b95ba64a | |||
ef405b1e90 | |||
441073bad5 |
@ -731,8 +731,8 @@ jobs:
|
|||||||
- run: yarn --cwd packages/zone.js promisetest
|
- run: yarn --cwd packages/zone.js promisetest
|
||||||
- run: yarn --cwd packages/zone.js promisefinallytest
|
- run: yarn --cwd packages/zone.js promisefinallytest
|
||||||
- run: yarn bazel build //packages/zone.js:npm_package &&
|
- run: yarn bazel build //packages/zone.js:npm_package &&
|
||||||
cp dist/bin/packages/zone.js/npm_package/bundles/zone-mix.umd.js ./packages/zone.js/test/extra/ &&
|
cp dist/bin/packages/zone.js/npm_package/dist/zone-mix.js ./packages/zone.js/test/extra/ &&
|
||||||
cp dist/bin/packages/zone.js/npm_package/bundles/zone-patch-electron.umd.js ./packages/zone.js/test/extra/ &&
|
cp dist/bin/packages/zone.js/npm_package/dist/zone-patch-electron.js ./packages/zone.js/test/extra/ &&
|
||||||
yarn --cwd packages/zone.js electrontest
|
yarn --cwd packages/zone.js electrontest
|
||||||
- run: yarn --cwd packages/zone.js jesttest
|
- run: yarn --cwd packages/zone.js jesttest
|
||||||
|
|
||||||
|
69
.github/ISSUE_TEMPLATE/1-bug-report.md
vendored
Normal file
69
.github/ISSUE_TEMPLATE/1-bug-report.md
vendored
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
---
|
||||||
|
name: "\U0001F41EBug report"
|
||||||
|
about: Report a bug in the Angular Framework
|
||||||
|
---
|
||||||
|
<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅
|
||||||
|
|
||||||
|
Oh hi there! 😄
|
||||||
|
|
||||||
|
To expedite issue processing please search open and closed issues before submitting a new one.
|
||||||
|
Existing issues often contain information about workarounds, resolution, or progress updates.
|
||||||
|
|
||||||
|
🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->
|
||||||
|
|
||||||
|
|
||||||
|
# 🐞 bug report
|
||||||
|
|
||||||
|
### Affected Package
|
||||||
|
<!-- Can you pin-point one or more @angular/* packages as the source of the bug? -->
|
||||||
|
<!-- ✍️edit: --> The issue is caused by package @angular/....
|
||||||
|
|
||||||
|
|
||||||
|
### Is this a regression?
|
||||||
|
|
||||||
|
<!-- Did this behavior use to work in the previous version? -->
|
||||||
|
<!-- ✍️--> Yes, the previous version in which this bug was not present was: ....
|
||||||
|
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
<!-- ✍️--> A clear and concise description of the problem...
|
||||||
|
|
||||||
|
|
||||||
|
## 🔬 Minimal Reproduction
|
||||||
|
<!--
|
||||||
|
Please create and share minimal reproduction of the issue starting with this template: https://stackblitz.com/fork/angular-ivy
|
||||||
|
-->
|
||||||
|
<!-- ✍️--> https://stackblitz.com/...
|
||||||
|
|
||||||
|
<!--
|
||||||
|
If StackBlitz is not suitable for reproduction of your issue, please create a minimal GitHub repository with the reproduction of the issue.
|
||||||
|
A good way to make a minimal reproduction is to create a new app via `ng new repro-app` and add the minimum possible code to show the problem.
|
||||||
|
Share the link to the repo below along with step-by-step instructions to reproduce the problem, as well as expected and actual behavior.
|
||||||
|
|
||||||
|
Issues that don't have enough info and can't be reproduced will be closed.
|
||||||
|
|
||||||
|
You can read more about issue submission guidelines here: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-submitting-an-issue
|
||||||
|
-->
|
||||||
|
|
||||||
|
## 🔥 Exception or Error
|
||||||
|
<pre><code>
|
||||||
|
<!-- If the issue is accompanied by an exception or an error, please share it below: -->
|
||||||
|
<!-- ✍️-->
|
||||||
|
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
|
||||||
|
## 🌍 Your Environment
|
||||||
|
|
||||||
|
**Angular Version:**
|
||||||
|
<pre><code>
|
||||||
|
<!-- run `ng version` and paste output below -->
|
||||||
|
<!-- ✍️-->
|
||||||
|
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
**Anything else relevant?**
|
||||||
|
<!-- ✍️Is this a browser specific issue? If so, please specify the browser and version. -->
|
||||||
|
|
||||||
|
<!-- ✍️Do any of these matter: operating system, IDE, package manager, HTTP server, ...? If so, please mention it below. -->
|
32
.github/ISSUE_TEMPLATE/2-feature-request.md
vendored
Normal file
32
.github/ISSUE_TEMPLATE/2-feature-request.md
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
name: "\U0001F680Feature request"
|
||||||
|
about: Suggest a feature for Angular Framework
|
||||||
|
|
||||||
|
---
|
||||||
|
<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅
|
||||||
|
|
||||||
|
Oh hi there! 😄
|
||||||
|
|
||||||
|
To expedite issue processing please search open and closed issues before submitting a new one.
|
||||||
|
Existing issues often contain information about workarounds, resolution, or progress updates.
|
||||||
|
|
||||||
|
🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->
|
||||||
|
|
||||||
|
|
||||||
|
# 🚀 feature request
|
||||||
|
|
||||||
|
### Relevant Package
|
||||||
|
<!-- Can you pin-point one or more @angular/* packages the are relevant for this feature request? -->
|
||||||
|
<!-- ✍️edit: --> This feature request is for @angular/....
|
||||||
|
|
||||||
|
|
||||||
|
### Description
|
||||||
|
<!-- ✍️--> A clear and concise description of the problem or missing capability...
|
||||||
|
|
||||||
|
|
||||||
|
### Describe the solution you'd like
|
||||||
|
<!-- ✍️--> If you have a solution in mind, please describe it.
|
||||||
|
|
||||||
|
|
||||||
|
### Describe alternatives you've considered
|
||||||
|
<!-- ✍️--> Have you considered any alternative solutions or workarounds?
|
55
.github/ISSUE_TEMPLATE/3-docs-bug.md
vendored
Normal file
55
.github/ISSUE_TEMPLATE/3-docs-bug.md
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
---
|
||||||
|
name: "📚 Docs or angular.io issue report"
|
||||||
|
about: Report an issue in Angular's documentation or angular.io application
|
||||||
|
|
||||||
|
---
|
||||||
|
<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅
|
||||||
|
|
||||||
|
Oh hi there! 😄
|
||||||
|
|
||||||
|
To expedite issue processing please search open and closed issues before submitting a new one.
|
||||||
|
Existing issues often contain information about workarounds, resolution, or progress updates.
|
||||||
|
|
||||||
|
🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->
|
||||||
|
|
||||||
|
# 📚 Docs or angular.io bug report
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
<!-- ✍️edit:--> A clear and concise description of the problem...
|
||||||
|
|
||||||
|
|
||||||
|
## 🔬 Minimal Reproduction
|
||||||
|
|
||||||
|
### What's the affected URL?**
|
||||||
|
<!-- ✍️edit:--> https://angular.io/...
|
||||||
|
|
||||||
|
### Reproduction Steps**
|
||||||
|
<!-- If applicable please list the steps to take to reproduce the issue -->
|
||||||
|
<!-- ✍️edit:-->
|
||||||
|
|
||||||
|
### Expected vs Actual Behavior**
|
||||||
|
<!-- If applicable please describe the difference between the expected and actual behavior after following the repro steps. -->
|
||||||
|
<!-- ✍️edit:-->
|
||||||
|
|
||||||
|
|
||||||
|
## 📷Screenshot
|
||||||
|
<!-- Often a screenshot can help to capture the issue better than a long description. -->
|
||||||
|
<!-- ✍️upload a screenshot:-->
|
||||||
|
|
||||||
|
|
||||||
|
## 🔥 Exception or Error
|
||||||
|
<pre><code>
|
||||||
|
<!-- If the issue is accompanied by an exception or an error, please share it below: -->
|
||||||
|
<!-- ✍️-->
|
||||||
|
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
|
||||||
|
## 🌍 Your Environment
|
||||||
|
|
||||||
|
### Browser info
|
||||||
|
<!-- ✍️Is this a browser specific issue? If so, please specify the device, browser, and version. -->
|
||||||
|
|
||||||
|
### Anything else relevant?
|
||||||
|
<!-- ✍️Please provide additional info if necessary. -->
|
11
.github/ISSUE_TEMPLATE/4-security-issue-disclosure.md
vendored
Normal file
11
.github/ISSUE_TEMPLATE/4-security-issue-disclosure.md
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
name: ⚠️ Security issue disclosure
|
||||||
|
about: Report a security issue in Angular Framework, Material, or CLI
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑
|
||||||
|
|
||||||
|
Please read https://angular.io/guide/security#report-issues on how to disclose security related issues.
|
||||||
|
|
||||||
|
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑
|
16
.github/ISSUE_TEMPLATE/5-support-request.md
vendored
Normal file
16
.github/ISSUE_TEMPLATE/5-support-request.md
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
name: "❓Support request"
|
||||||
|
about: Questions and requests for support
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑
|
||||||
|
|
||||||
|
Please do not file questions or support requests on the GitHub issues tracker.
|
||||||
|
|
||||||
|
You can get your questions answered using other communication channels. Please see:
|
||||||
|
https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
|
||||||
|
|
||||||
|
Thank you!
|
||||||
|
|
||||||
|
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑
|
13
.github/ISSUE_TEMPLATE/6-angular-cli.md
vendored
Normal file
13
.github/ISSUE_TEMPLATE/6-angular-cli.md
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: "\U0001F6E0️Angular CLI"
|
||||||
|
about: Issues and feature requests for Angular CLI
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑
|
||||||
|
|
||||||
|
Please file any Angular CLI issues at: https://github.com/angular/angular-cli/issues/new
|
||||||
|
|
||||||
|
For the time being, we keep Angular CLI issues in a separate repository.
|
||||||
|
|
||||||
|
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑
|
13
.github/ISSUE_TEMPLATE/7-angular-components.md
vendored
Normal file
13
.github/ISSUE_TEMPLATE/7-angular-components.md
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: "\U0001F48EAngular Components"
|
||||||
|
about: Issues and feature requests for Angular Components
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑
|
||||||
|
|
||||||
|
Please file any Angular Components issues at: https://github.com/angular/components/issues/new
|
||||||
|
|
||||||
|
For the time being, we keep Angular Components issues in a separate repository.
|
||||||
|
|
||||||
|
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑
|
22
.github/ISSUE_TEMPLATE/8-translate-docs.md
vendored
22
.github/ISSUE_TEMPLATE/8-translate-docs.md
vendored
@ -1,22 +0,0 @@
|
|||||||
---
|
|
||||||
name: "📚Traducir doc al español"
|
|
||||||
about: Solicitud para traducir ciertos docs al español
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
📚Traducir: <!-- ✍️ editar: --> creating-libraries.md
|
|
||||||
|
|
||||||
<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅
|
|
||||||
|
|
||||||
Traducción de la documentación oficial de Angular a español
|
|
||||||
|
|
||||||
🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->
|
|
||||||
|
|
||||||
|
|
||||||
## Nombre del archivo:
|
|
||||||
<!-- ✍️ editar: --> creating-libraries.md
|
|
||||||
|
|
||||||
|
|
||||||
## Ruta donde se encuentra el archivo dentro del proyecto de Angular
|
|
||||||
|
|
||||||
<!-- ✍️ editar: --> https://github.com/angular-hispano/angular/blob/master/aio/content/guide/creating-libraries.md
|
|
62
.github/PULL_REQUEST_TEMPLATE.md
vendored
62
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,35 +1,43 @@
|
|||||||
## Lista de Verificación del PR
|
## PR Checklist
|
||||||
Comprueba si tu PR cumple los siguientes requisitos:
|
Please check if your PR fulfills the following requirements:
|
||||||
|
|
||||||
- [ ] El mensaje de commit conforme con [nuestras reglas](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit)
|
- [ ] The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit
|
||||||
- [ ] Prueba los cambios que agregaste (arreglo de bugs / funcionalidades)
|
- [ ] Tests for the changes have been added (for bug fixes / features)
|
||||||
- [ ] Revisa tus traducciones o cambios de contenido
|
- [ ] Docs have been added / updated (for bug fixes / features)
|
||||||
- [ ] Consulté el [diccionario de términos](https://github.com/angular-hispano/angular/issues/9) en español
|
|
||||||
- [ ] Se han creado dos archivos con la extensión correspondiente(.en.md para el archivo en inglés y .md para el Archivo en español)
|
|
||||||
- [ ] PR enlazada con el issue correspondiente
|
|
||||||
|
|
||||||
|
|
||||||
## Tipo de PR
|
## PR Type
|
||||||
¿Qué tipo de cambio introduce este PR?
|
What kind of change does this PR introduce?
|
||||||
|
|
||||||
<!-- Marca con una "x" las opciones que aplican. -->
|
<!-- Please check the one that applies to this PR using "x". -->
|
||||||
|
|
||||||
- [ ] Bugfix
|
- [ ] Bugfix
|
||||||
- [ ] Funcionalidad
|
- [ ] Feature
|
||||||
- [ ] Actualizar el estilo del código (formato, variables locales)
|
- [ ] Code style update (formatting, local variables)
|
||||||
- [ ] Refactorización (no cambios en la funcionalidad, no cambios en el api)
|
- [ ] Refactoring (no functional changes, no api changes)
|
||||||
- [ ] Cambios relacionados al build
|
- [ ] Build related changes
|
||||||
- [ ] Cambios relacionados al CI (Integración continua)
|
- [ ] CI related changes
|
||||||
- [ ] Cambios en el contenido de la documentación
|
- [ ] Documentation content changes
|
||||||
- [ ] Cambios en la aplicación / infrastructura de angular.io
|
- [ ] angular.io application / infrastructure changes
|
||||||
- [ ] Otro... Por favor describela:
|
- [ ] Other... Please describe:
|
||||||
|
|
||||||
## ¿Cuál es el comportamiento actual?
|
|
||||||
<!-- Describe el comportamiento actual que está modificando o vincule a un problema relevante.
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
## ¿Cuál es el nuevo comportamiento?
|
## What is the current behavior?
|
||||||
<!--
|
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
|
||||||
Ejemplo: Archivo en inglés traducido al español
|
|
||||||
-->
|
Issue Number: N/A
|
||||||
|
|
||||||
|
|
||||||
|
## What is the new behavior?
|
||||||
|
|
||||||
|
|
||||||
|
## Does this PR introduce a breaking change?
|
||||||
|
|
||||||
|
- [ ] Yes
|
||||||
|
- [ ] No
|
||||||
|
|
||||||
|
|
||||||
|
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
|
||||||
|
|
||||||
|
|
||||||
|
## Other information
|
||||||
|
168
.pullapprove.yml
168
.pullapprove.yml
@ -67,6 +67,25 @@ version: 3
|
|||||||
# Meta field that goes unused by PullApprove to allow for defining aliases to be
|
# Meta field that goes unused by PullApprove to allow for defining aliases to be
|
||||||
# used throughout the config.
|
# used throughout the config.
|
||||||
meta:
|
meta:
|
||||||
|
# The following groups have no file based conditions and will be initially `active` on all PRs
|
||||||
|
# - `global-approvers`
|
||||||
|
# - `global-docs-approvers`
|
||||||
|
# - `required-minimum-review`
|
||||||
|
#
|
||||||
|
# By checking the number of active/pending/rejected groups when these are excluded, we can determine
|
||||||
|
# if any other groups are matched.
|
||||||
|
#
|
||||||
|
# Note: Because all inactive groups start as pending, we are only checking pending and rejected active groups.
|
||||||
|
#
|
||||||
|
# Also note that the ordering of groups matters in this file. The only groups visible to the current
|
||||||
|
# one are those that appear above it.
|
||||||
|
no-groups-above-this-pending: &no-groups-above-this-pending
|
||||||
|
len(groups.active.pending.exclude("required-minimum-review").exclude("global-approvers").exclude("global-docs-approvers")) == 0
|
||||||
|
no-groups-above-this-rejected: &no-groups-above-this-rejected
|
||||||
|
len(groups.active.rejected.exclude("required-minimum-review").exclude("global-approvers").exclude("global-docs-approvers")) == 0
|
||||||
|
no-groups-above-this-active: &no-groups-above-this-active
|
||||||
|
len(groups.active.exclude("required-minimum-review").exclude("global-approvers").exclude("global-docs-approvers")) == 0
|
||||||
|
|
||||||
can-be-global-approved: &can-be-global-approved "\"global-approvers\" not in groups.approved"
|
can-be-global-approved: &can-be-global-approved "\"global-approvers\" not in groups.approved"
|
||||||
can-be-global-docs-approved: &can-be-global-docs-approved "\"global-docs-approvers\" not in groups.approved"
|
can-be-global-docs-approved: &can-be-global-docs-approved "\"global-docs-approvers\" not in groups.approved"
|
||||||
defaults: &defaults
|
defaults: &defaults
|
||||||
@ -96,6 +115,54 @@ pullapprove_conditions:
|
|||||||
|
|
||||||
|
|
||||||
groups:
|
groups:
|
||||||
|
# =========================================================
|
||||||
|
# Require review on all PRs
|
||||||
|
#
|
||||||
|
# All PRs require at least one review. This rule will not
|
||||||
|
# request any reviewers, however will require that at least
|
||||||
|
# one review is provided before the group is satisfied.
|
||||||
|
# =========================================================
|
||||||
|
required-minimum-review:
|
||||||
|
reviews:
|
||||||
|
request: 0 # Do not request any reviews from the reviewer group
|
||||||
|
required: 1 # Require that all PRs have approval from at least one of the users in the group
|
||||||
|
author_value: 0 # The author of the PR cannot provide an approval for themself
|
||||||
|
reviewers:
|
||||||
|
users:
|
||||||
|
- aikidave # Dave Shevitz
|
||||||
|
- alan-agius4 # Alan Agius
|
||||||
|
- alxhub # Alex Rickabaugh
|
||||||
|
- AndrewKushnir # Andrew Kushnir
|
||||||
|
- andrewseguin # Andrew Seguin
|
||||||
|
- atscott # Andrew Scott
|
||||||
|
- ayazhafiz # Ayaz Hafiz
|
||||||
|
- clydin # Charles Lyding
|
||||||
|
- crisbeto # Kristiyan Kostadinov
|
||||||
|
- dennispbrown # Denny Brown
|
||||||
|
- devversion # Paul Gschwendtner
|
||||||
|
- dgp1130 # Doug Parker
|
||||||
|
- filipesilva # Filipe Silva
|
||||||
|
- gkalpak # Georgios Kalpakas
|
||||||
|
- gregmagolan # Greg Magolan
|
||||||
|
- IgorMinar # Igor Minar
|
||||||
|
- jbogarthyde # Judy Bogart
|
||||||
|
- jelbourn # Jeremy Elbourn
|
||||||
|
- JiaLiPassion # Jia Li
|
||||||
|
- JoostK # Joost Koehoorn
|
||||||
|
- josephperrott # Joey Perrott
|
||||||
|
- juleskremer # Jules Kremer
|
||||||
|
- kapunahelewong # Kapunahele Wong
|
||||||
|
- kara # Kara Erickson
|
||||||
|
- kyliau # Keen Yee Liau
|
||||||
|
- manughub # Manu Murthy
|
||||||
|
- mgechev # Minko Gechev
|
||||||
|
- mhevery # Miško Hevery
|
||||||
|
- michaelprentice # Michael Prentice
|
||||||
|
- mmalerba # Miles Malerba
|
||||||
|
- petebacondarwin # Pete Bacon Darwin
|
||||||
|
- pkozlowski-opensource # Pawel Kozlowski
|
||||||
|
- StephenFluin # Stephen Fluin
|
||||||
|
|
||||||
# =========================================================
|
# =========================================================
|
||||||
# Global Approvers
|
# Global Approvers
|
||||||
#
|
#
|
||||||
@ -132,57 +199,6 @@ groups:
|
|||||||
required: 1
|
required: 1
|
||||||
reviewed_for: required
|
reviewed_for: required
|
||||||
|
|
||||||
# =========================================================
|
|
||||||
# Require review on all PRs
|
|
||||||
#
|
|
||||||
# All PRs require at least one review. This rule will not
|
|
||||||
# request any reviewers, however will require that at least
|
|
||||||
# one review is provided before the group is satisfied.
|
|
||||||
# =========================================================
|
|
||||||
required-minimum-review:
|
|
||||||
conditions:
|
|
||||||
- *can-be-global-approved
|
|
||||||
- *can-be-global-docs-approved
|
|
||||||
reviews:
|
|
||||||
request: 0 # Do not request any reviews from the reviewer group
|
|
||||||
required: 1 # Require that all PRs have approval from at least one of the users in the group
|
|
||||||
author_value: 0 # The author of the PR cannot provide an approval for themself
|
|
||||||
reviewers:
|
|
||||||
users:
|
|
||||||
- aikidave # Dave Shevitz
|
|
||||||
- alan-agius4 # Alan Agius
|
|
||||||
- alxhub # Alex Rickabaugh
|
|
||||||
- AndrewKushnir # Andrew Kushnir
|
|
||||||
- andrewseguin # Andrew Seguin
|
|
||||||
- atscott # Andrew Scott
|
|
||||||
- ayazhafiz # Ayaz Hafiz
|
|
||||||
- clydin # Charles Lyding
|
|
||||||
- crisbeto # Kristiyan Kostadinov
|
|
||||||
- dennispbrown # Denny Brown
|
|
||||||
- devversion # Paul Gschwendtner
|
|
||||||
- dgp1130 # Doug Parker
|
|
||||||
- filipesilva # Filipe Silva
|
|
||||||
- gkalpak # Georgios Kalpakas
|
|
||||||
- gregmagolan # Greg Magolan
|
|
||||||
- IgorMinar # Igor Minar
|
|
||||||
- jbogarthyde # Judy Bogart
|
|
||||||
- jelbourn # Jeremy Elbourn
|
|
||||||
- JiaLiPassion # Jia Li
|
|
||||||
- JoostK # Joost Koehoorn
|
|
||||||
- josephperrott # Joey Perrott
|
|
||||||
- juleskremer # Jules Kremer
|
|
||||||
- kapunahelewong # Kapunahele Wong
|
|
||||||
- kara # Kara Erickson
|
|
||||||
- kyliau # Keen Yee Liau
|
|
||||||
- manughub # Manu Murthy
|
|
||||||
- mgechev # Minko Gechev
|
|
||||||
- mhevery # Miško Hevery
|
|
||||||
- mmalerba # Miles Malerba
|
|
||||||
- petebacondarwin # Pete Bacon Darwin
|
|
||||||
- pkozlowski-opensource # Pawel Kozlowski
|
|
||||||
- Splaktar # Michael Prentice
|
|
||||||
- StephenFluin # Stephen Fluin
|
|
||||||
|
|
||||||
# =========================================================
|
# =========================================================
|
||||||
# Framework: Animations
|
# Framework: Animations
|
||||||
# =========================================================
|
# =========================================================
|
||||||
@ -316,7 +332,6 @@ groups:
|
|||||||
'aio/content/images/guide/dependency-injection-in-action/**',
|
'aio/content/images/guide/dependency-injection-in-action/**',
|
||||||
'aio/content/guide/dependency-injection-navtree.md',
|
'aio/content/guide/dependency-injection-navtree.md',
|
||||||
'aio/content/guide/dependency-injection-providers.md',
|
'aio/content/guide/dependency-injection-providers.md',
|
||||||
'aio/content/guide/lightweight-injection-tokens.md',
|
|
||||||
'aio/content/guide/displaying-data.md',
|
'aio/content/guide/displaying-data.md',
|
||||||
'aio/content/examples/displaying-data/**',
|
'aio/content/examples/displaying-data/**',
|
||||||
'aio/content/images/guide/displaying-data/**',
|
'aio/content/images/guide/displaying-data/**',
|
||||||
@ -768,21 +783,6 @@ groups:
|
|||||||
- JiaLiPassion
|
- JiaLiPassion
|
||||||
- mhevery
|
- mhevery
|
||||||
|
|
||||||
# =========================================================
|
|
||||||
# in-memory-web-api
|
|
||||||
# =========================================================
|
|
||||||
in-memory-web-api:
|
|
||||||
conditions:
|
|
||||||
- *can-be-global-approved
|
|
||||||
- *can-be-global-docs-approved
|
|
||||||
- >
|
|
||||||
contains_any_globs(files, [
|
|
||||||
'packages/misc/angular-in-memory-web-api/**',
|
|
||||||
])
|
|
||||||
reviewers:
|
|
||||||
users:
|
|
||||||
- IgorMinar
|
|
||||||
- crisbeto
|
|
||||||
|
|
||||||
# =========================================================
|
# =========================================================
|
||||||
# Benchpress
|
# Benchpress
|
||||||
@ -1142,6 +1142,8 @@ groups:
|
|||||||
public-api:
|
public-api:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
conditions:
|
conditions:
|
||||||
|
- *no-groups-above-this-pending
|
||||||
|
- *no-groups-above-this-rejected
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- >
|
- >
|
||||||
contains_any_globs(files, [
|
contains_any_globs(files, [
|
||||||
@ -1155,14 +1157,16 @@ groups:
|
|||||||
])
|
])
|
||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
|
- AndrewKushnir
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
- alxhub
|
- alxhub
|
||||||
|
- atscott
|
||||||
- jelbourn
|
- jelbourn
|
||||||
- petebacondarwin
|
- petebacondarwin
|
||||||
- pkozlowski-opensource
|
- pkozlowski-opensource
|
||||||
reviews:
|
reviews:
|
||||||
request: -1 # request reviews from everyone
|
request: 4 # Request reviews from four people
|
||||||
required: 3 # require at least 3 approvals
|
required: 3 # Require that three people approve
|
||||||
reviewed_for: required
|
reviewed_for: required
|
||||||
|
|
||||||
|
|
||||||
@ -1172,6 +1176,8 @@ groups:
|
|||||||
size-tracking:
|
size-tracking:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
conditions:
|
conditions:
|
||||||
|
- *no-groups-above-this-pending
|
||||||
|
- *no-groups-above-this-rejected
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- >
|
- >
|
||||||
contains_any_globs(files, [
|
contains_any_globs(files, [
|
||||||
@ -1179,14 +1185,16 @@ groups:
|
|||||||
])
|
])
|
||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
|
- AndrewKushnir
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
- alxhub
|
- alxhub
|
||||||
|
- atscott
|
||||||
- jelbourn
|
- jelbourn
|
||||||
- petebacondarwin
|
- petebacondarwin
|
||||||
- pkozlowski-opensource
|
- pkozlowski-opensource
|
||||||
reviews:
|
reviews:
|
||||||
request: -1 # request reviews from everyone
|
request: 4 # Request reviews from four people
|
||||||
required: 2 # require at least 2 approvals
|
required: 2 # Require that two people approve
|
||||||
reviewed_for: required
|
reviewed_for: required
|
||||||
|
|
||||||
|
|
||||||
@ -1196,6 +1204,8 @@ groups:
|
|||||||
circular-dependencies:
|
circular-dependencies:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
conditions:
|
conditions:
|
||||||
|
- *no-groups-above-this-pending
|
||||||
|
- *no-groups-above-this-rejected
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- >
|
- >
|
||||||
contains_any_globs(files, [
|
contains_any_globs(files, [
|
||||||
@ -1203,9 +1213,11 @@ groups:
|
|||||||
])
|
])
|
||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
|
- AndrewKushnir
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
|
- alxhub
|
||||||
|
- atscott
|
||||||
- jelbourn
|
- jelbourn
|
||||||
- josephperrott
|
|
||||||
- petebacondarwin
|
- petebacondarwin
|
||||||
- pkozlowski-opensource
|
- pkozlowski-opensource
|
||||||
|
|
||||||
@ -1227,7 +1239,10 @@ groups:
|
|||||||
])
|
])
|
||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
|
- AndrewKushnir
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
|
- alxhub
|
||||||
|
- atscott
|
||||||
- jelbourn
|
- jelbourn
|
||||||
- josephperrott
|
- josephperrott
|
||||||
- mhevery
|
- mhevery
|
||||||
@ -1257,14 +1272,7 @@ groups:
|
|||||||
# `global-approvers` can still approve PRs that match this `fallback` rule,
|
# `global-approvers` can still approve PRs that match this `fallback` rule,
|
||||||
# but that should be an exception and not an expectation.
|
# but that should be an exception and not an expectation.
|
||||||
conditions:
|
conditions:
|
||||||
# The following groups have no file based conditions and will be initially `active` on all PRs
|
- *no-groups-above-this-active
|
||||||
# - `global-approvers`
|
|
||||||
# - `global-docs-approvers`
|
|
||||||
# - `required-minimum-review`
|
|
||||||
#
|
|
||||||
# By checking the number of active groups when these are excluded, we can determine
|
|
||||||
# if any other groups are matched.
|
|
||||||
- len(groups.active.exclude("required-minimum-review").exclude("global-approvers").exclude("global-docs-approvers")) == 0
|
|
||||||
# When any of the `global-*` groups is approved, they cause other groups to deactivate.
|
# When any of the `global-*` groups is approved, they cause other groups to deactivate.
|
||||||
# In those cases, the condition above would evaluate to `true` while in reality, only a global
|
# In those cases, the condition above would evaluate to `true` while in reality, only a global
|
||||||
# approval has been provided. To ensure we don't activate the fallback group in such cases,
|
# approval has been provided. To ensure we don't activate the fallback group in such cases,
|
||||||
|
@ -20,9 +20,9 @@ filegroup(
|
|||||||
# do not sort
|
# do not sort
|
||||||
srcs = [
|
srcs = [
|
||||||
"@npm//:node_modules/core-js/client/core.js",
|
"@npm//:node_modules/core-js/client/core.js",
|
||||||
"//packages/zone.js/bundles:zone.umd.js",
|
"//packages/zone.js/dist:zone.js",
|
||||||
"//packages/zone.js/bundles:zone-testing.umd.js",
|
"//packages/zone.js/dist:zone-testing.js",
|
||||||
"//packages/zone.js/bundles:task-tracking.umd.js",
|
"//packages/zone.js/dist:task-tracking.js",
|
||||||
"//:test-events.js",
|
"//:test-events.js",
|
||||||
"//:third_party/shims_for_IE.js",
|
"//:third_party/shims_for_IE.js",
|
||||||
# Including systemjs because it defines `__eval`, which produces correct stack traces.
|
# Including systemjs because it defines `__eval`, which produces correct stack traces.
|
||||||
|
249
CHANGELOG.md
249
CHANGELOG.md
@ -1,3 +1,30 @@
|
|||||||
|
<a name="10.0.6"></a>
|
||||||
|
## 10.0.6 (2020-07-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **compiler:** share identical stylesheets between components in the same file ([#38213](https://github.com/angular/angular/issues/38213)) ([264950b](https://github.com/angular/angular/commit/264950b)), closes [#38204](https://github.com/angular/angular/issues/38204)
|
||||||
|
* **compiler-cli:** Add support for string literal class members ([#38226](https://github.com/angular/angular/issues/38226)) ([b1e7775](https://github.com/angular/angular/commit/b1e7775))
|
||||||
|
* **core:** `Attribute` decorator `attributeName` is mandatory ([#38131](https://github.com/angular/angular/issues/38131)) ([1c4fcce](https://github.com/angular/angular/commit/1c4fcce)), closes [#32658](https://github.com/angular/angular/issues/32658)
|
||||||
|
* **core:** unify the signature between ngZone and noopZone ([#37581](https://github.com/angular/angular/issues/37581)) ([d5264f5](https://github.com/angular/angular/commit/d5264f5))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="10.0.5"></a>
|
||||||
|
## 10.0.5 (2020-07-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **compiler:** properly associate source spans for implicitly closed elements ([#38126](https://github.com/angular/angular/issues/38126)) ([e80278c](https://github.com/angular/angular/commit/e80278c)), closes [#36118](https://github.com/angular/angular/issues/36118)
|
||||||
|
* **compiler-cli:** ensure file_system handles mixed Windows drives ([#38030](https://github.com/angular/angular/issues/38030)) ([dba4023](https://github.com/angular/angular/commit/dba4023)), closes [#36777](https://github.com/angular/angular/issues/36777)
|
||||||
|
* **core:** Allow modification of lifecycle hooks any time before bootstrap ([#38119](https://github.com/angular/angular/issues/38119)) ([14b4718](https://github.com/angular/angular/commit/14b4718)), closes [#30497](https://github.com/angular/angular/issues/30497)
|
||||||
|
* **core:** error due to integer overflow when there are too many host bindings ([#38014](https://github.com/angular/angular/issues/38014)) ([7b6e73c](https://github.com/angular/angular/commit/7b6e73c)), closes [#37876](https://github.com/angular/angular/issues/37876) [#37876](https://github.com/angular/angular/issues/37876)
|
||||||
|
* **core:** incorrectly validating properties on ng-content and ng-container ([#37773](https://github.com/angular/angular/issues/37773)) ([17ddab9](https://github.com/angular/angular/commit/17ddab9))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="10.0.4"></a>
|
<a name="10.0.4"></a>
|
||||||
## 10.0.4 (2020-07-15)
|
## 10.0.4 (2020-07-15)
|
||||||
|
|
||||||
@ -18,61 +45,6 @@
|
|||||||
* **bazel:** provide LinkablePackageInfo from ng_module ([#37778](https://github.com/angular/angular/issues/37778)) ([6cd10a1](https://github.com/angular/angular/commit/6cd10a1)), closes [/github.com/bazelbuild/rules_nodejs/blob/9a5de3728b05bf1647bbb87ad99f54e626604705/internal/linker/link_node_modules.bzl#L144-L146](https://github.com//github.com/bazelbuild/rules_nodejs/blob/9a5de3728b05bf1647bbb87ad99f54e626604705/internal/linker/link_node_modules.bzl/issues/L144-L146)
|
* **bazel:** provide LinkablePackageInfo from ng_module ([#37778](https://github.com/angular/angular/issues/37778)) ([6cd10a1](https://github.com/angular/angular/commit/6cd10a1)), closes [/github.com/bazelbuild/rules_nodejs/blob/9a5de3728b05bf1647bbb87ad99f54e626604705/internal/linker/link_node_modules.bzl#L144-L146](https://github.com//github.com/bazelbuild/rules_nodejs/blob/9a5de3728b05bf1647bbb87ad99f54e626604705/internal/linker/link_node_modules.bzl/issues/L144-L146)
|
||||||
|
|
||||||
|
|
||||||
<a name="10.1.0-next.1"></a>
|
|
||||||
# 10.1.0-next.1 (2020-07-15)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **bazel:** ng_module rule does not expose flat module information in Ivy ([#36971](https://github.com/angular/angular/issues/36971)) ([1550663](https://github.com/angular/angular/commit/1550663))
|
|
||||||
* **compiler:** check more cases for pipe usage inside host bindings ([#37883](https://github.com/angular/angular/issues/37883)) ([9322b9a](https://github.com/angular/angular/commit/9322b9a)), closes [#34655](https://github.com/angular/angular/issues/34655) [#37610](https://github.com/angular/angular/issues/37610)
|
|
||||||
* **compiler-cli:** ensure file_system handles mixed Windows drives ([#37959](https://github.com/angular/angular/issues/37959)) ([6b31155](https://github.com/angular/angular/commit/6b31155)), closes [#36777](https://github.com/angular/angular/issues/36777)
|
|
||||||
* **language-service:** remove completion for string ([#37983](https://github.com/angular/angular/issues/37983)) ([10aba15](https://github.com/angular/angular/commit/10aba15))
|
|
||||||
* **ngcc:** report a warning if ngcc tries to use a solution-style tsconfig ([#38003](https://github.com/angular/angular/issues/38003)) ([b358495](https://github.com/angular/angular/commit/b358495)), closes [#36386](https://github.com/angular/angular/issues/36386)
|
|
||||||
* **router:** ensure duplicate popstate/hashchange events are handled correctly ([#37674](https://github.com/angular/angular/issues/37674)) ([9185c6e](https://github.com/angular/angular/commit/9185c6e)), closes [/github.com/angular/angular/issues/16710#issuecomment-646919529](https://github.com//github.com/angular/angular/issues/16710/issues/issuecomment-646919529) [#16710](https://github.com/angular/angular/issues/16710)
|
|
||||||
* **service-worker:** correctly handle relative base href ([#37922](https://github.com/angular/angular/issues/37922)) ([d19ef65](https://github.com/angular/angular/commit/d19ef65)), closes [#25055](https://github.com/angular/angular/issues/25055) [#25055](https://github.com/angular/angular/issues/25055)
|
|
||||||
* **service-worker:** correctly serve `ngsw/state` with a non-root SW scope ([#37922](https://github.com/angular/angular/issues/37922)) ([2156bee](https://github.com/angular/angular/commit/2156bee)), closes [#30505](https://github.com/angular/angular/issues/30505)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="10.1.0-next.0"></a>
|
|
||||||
# 10.1.0-next.0 (2020-07-08)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **common:** date pipe gives wrong week number ([#37632](https://github.com/angular/angular/issues/37632)) ([ef1fb6d](https://github.com/angular/angular/commit/ef1fb6d)), closes [#33961](https://github.com/angular/angular/issues/33961)
|
|
||||||
* **compiler-cli:** ensure source-maps can handle webpack:// protocol ([#32912](https://github.com/angular/angular/issues/32912)) ([decd95e](https://github.com/angular/angular/commit/decd95e))
|
|
||||||
* **compiler-cli:** only read source-map comment from last line ([#32912](https://github.com/angular/angular/issues/32912)) ([07a07e3](https://github.com/angular/angular/commit/07a07e3))
|
|
||||||
* **core:** determine required DOMParser feature availability ([#36578](https://github.com/angular/angular/issues/36578)) ([#36578](https://github.com/angular/angular/issues/36578)) ([c509243](https://github.com/angular/angular/commit/c509243))
|
|
||||||
* **core:** do not trigger CSP alert/report in Firefox and Chrome ([#36578](https://github.com/angular/angular/issues/36578)) ([#36578](https://github.com/angular/angular/issues/36578)) ([b950d46](https://github.com/angular/angular/commit/b950d46)), closes [#25214](https://github.com/angular/angular/issues/25214)
|
|
||||||
* **forms:** handle form groups/arrays own pending async validation ([#22575](https://github.com/angular/angular/issues/22575)) ([77b62a5](https://github.com/angular/angular/commit/77b62a5)), closes [#10064](https://github.com/angular/angular/issues/10064)
|
|
||||||
* **language-service:** non-existent module format in package output ([#37623](https://github.com/angular/angular/issues/37623)) ([413a0fb](https://github.com/angular/angular/commit/413a0fb))
|
|
||||||
* **router:** fix navigation ignoring logic to compare to the browser url ([#37716](https://github.com/angular/angular/issues/37716)) ([a5ffca0](https://github.com/angular/angular/commit/a5ffca0)), closes [#16710](https://github.com/angular/angular/issues/16710) [#13586](https://github.com/angular/angular/issues/13586)
|
|
||||||
* **router:** properly compare array queryParams for equality ([#37709](https://github.com/angular/angular/issues/37709)) ([#37860](https://github.com/angular/angular/issues/37860)) ([1801d0c](https://github.com/angular/angular/commit/1801d0c))
|
|
||||||
* **router:** remove parenthesis for primary outlet segment after removing auxiliary outlet segment ([#24656](https://github.com/angular/angular/issues/24656)) ([#37163](https://github.com/angular/angular/issues/37163)) ([71f008f](https://github.com/angular/angular/commit/71f008f))
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **bazel:** provide LinkablePackageInfo from ng_module ([#37623](https://github.com/angular/angular/issues/37623)) ([6898eab](https://github.com/angular/angular/commit/6898eab))
|
|
||||||
* **compiler-cli:** add `SourceFile.getOriginalLocation()` to sourcemaps package ([#32912](https://github.com/angular/angular/issues/32912)) ([6abb8d0](https://github.com/angular/angular/commit/6abb8d0))
|
|
||||||
* **compiler-cli:** explain why an expression cannot be used in AOT compilations ([#37587](https://github.com/angular/angular/issues/37587)) ([712f1bd](https://github.com/angular/angular/commit/712f1bd))
|
|
||||||
* **core:** support injection token as predicate in queries ([#37506](https://github.com/angular/angular/issues/37506)) ([97dc85b](https://github.com/angular/angular/commit/97dc85b)), closes [#21152](https://github.com/angular/angular/issues/21152) [#36144](https://github.com/angular/angular/issues/36144)
|
|
||||||
* **localize:** expose `canParse()` diagnostics ([#37909](https://github.com/angular/angular/issues/37909)) ([ec32eba](https://github.com/angular/angular/commit/ec32eba)), closes [#37901](https://github.com/angular/angular/issues/37901)
|
|
||||||
* **localize:** implement message extraction tool ([#32912](https://github.com/angular/angular/issues/32912)) ([190561d](https://github.com/angular/angular/commit/190561d))
|
|
||||||
* **platform-browser:** Allow `sms`-URLs ([#31463](https://github.com/angular/angular/issues/31463)) ([fc5c34d](https://github.com/angular/angular/commit/fc5c34d)), closes [#31462](https://github.com/angular/angular/issues/31462)
|
|
||||||
* **platform-server:** add option for absolute URL HTTP support ([#37539](https://github.com/angular/angular/issues/37539)) ([d37049a](https://github.com/angular/angular/commit/d37049a)), closes [#37071](https://github.com/angular/angular/issues/37071)
|
|
||||||
|
|
||||||
|
|
||||||
### Performance Improvements
|
|
||||||
|
|
||||||
* **compiler-cli:** fix regressions in incremental program reuse ([#37641](https://github.com/angular/angular/issues/37641)) ([5103d90](https://github.com/angular/angular/commit/5103d90))
|
|
||||||
* **ngcc:** shortcircuit tokenizing in ESM dependency host ([#37639](https://github.com/angular/angular/issues/37639)) ([bd7f440](https://github.com/angular/angular/commit/bd7f440))
|
|
||||||
* **ngcc:** use `EntryPointManifest` to speed up noop `ProgramBaseEntryPointFinder` ([#37665](https://github.com/angular/angular/issues/37665)) ([9318e23](https://github.com/angular/angular/commit/9318e23))
|
|
||||||
* **router:** apply prioritizedGuardValue operator to optimize CanLoad guards ([#37523](https://github.com/angular/angular/issues/37523)) ([d7dd295](https://github.com/angular/angular/commit/d7dd295))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="10.0.3"></a>
|
<a name="10.0.3"></a>
|
||||||
## 10.0.3 (2020-07-08)
|
## 10.0.3 (2020-07-08)
|
||||||
@ -84,16 +56,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="9.1.12"></a>
|
|
||||||
## [9.1.12](https://github.com/angular/angular/compare/9.1.11...9.1.12) (2020-07-08)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **core:** infinite loop if injectable using inheritance has a custom decorator ([6c1ab47](https://github.com/angular/angular/commit/6c1ab47)), closes [#35733](https://github.com/angular/angular/issues/35733)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="10.0.2"></a>
|
<a name="10.0.2"></a>
|
||||||
## [10.0.2](https://github.com/angular/angular/compare/10.0.1...10.0.2) (2020-06-30)
|
## [10.0.2](https://github.com/angular/angular/compare/10.0.1...10.0.2) (2020-06-30)
|
||||||
|
|
||||||
@ -205,6 +167,7 @@ To learn about the release highlights and our CLI-powered automated update workf
|
|||||||
* **compiler:** avoid undefined expressions in holey array ([#36343](https://github.com/angular/angular/issues/36343)) ([5516802](https://github.com/angular/angular/commit/5516802))
|
* **compiler:** avoid undefined expressions in holey array ([#36343](https://github.com/angular/angular/issues/36343)) ([5516802](https://github.com/angular/angular/commit/5516802))
|
||||||
* **compiler:** handle type references to namespaced symbols correctly ([#36106](https://github.com/angular/angular/issues/36106)) ([4aa4e6f](https://github.com/angular/angular/commit/4aa4e6f)), closes [#36006](https://github.com/angular/angular/issues/36006)
|
* **compiler:** handle type references to namespaced symbols correctly ([#36106](https://github.com/angular/angular/issues/36106)) ([4aa4e6f](https://github.com/angular/angular/commit/4aa4e6f)), closes [#36006](https://github.com/angular/angular/issues/36006)
|
||||||
* **compiler:** normalize line endings in ICU expansions ([#36741](https://github.com/angular/angular/issues/36741)) ([70dd27f](https://github.com/angular/angular/commit/70dd27f)), closes [#36725](https://github.com/angular/angular/issues/36725)
|
* **compiler:** normalize line endings in ICU expansions ([#36741](https://github.com/angular/angular/issues/36741)) ([70dd27f](https://github.com/angular/angular/commit/70dd27f)), closes [#36725](https://github.com/angular/angular/issues/36725)
|
||||||
|
* **compiler:** record correct end of expression ([#34690](https://github.com/angular/angular/issues/34690)) ([df890d7](https://github.com/angular/angular/commit/df890d7)), closes [#33477](https://github.com/angular/angular/issues/33477)
|
||||||
* **compiler:** remove outdated and invalid warning for unresolved DI parameters ([#36985](https://github.com/angular/angular/issues/36985)) ([d0280a0](https://github.com/angular/angular/commit/d0280a0))
|
* **compiler:** remove outdated and invalid warning for unresolved DI parameters ([#36985](https://github.com/angular/angular/issues/36985)) ([d0280a0](https://github.com/angular/angular/commit/d0280a0))
|
||||||
* **compiler:** resolve enum values in binary operations ([#36461](https://github.com/angular/angular/issues/36461)) ([64022f5](https://github.com/angular/angular/commit/64022f5)), closes [#35584](https://github.com/angular/angular/issues/35584)
|
* **compiler:** resolve enum values in binary operations ([#36461](https://github.com/angular/angular/issues/36461)) ([64022f5](https://github.com/angular/angular/commit/64022f5)), closes [#35584](https://github.com/angular/angular/issues/35584)
|
||||||
* **compiler:** switch to 'referencedFiles' for shim generation ([#36211](https://github.com/angular/angular/issues/36211)) ([4213e8d](https://github.com/angular/angular/commit/4213e8d))
|
* **compiler:** switch to 'referencedFiles' for shim generation ([#36211](https://github.com/angular/angular/issues/36211)) ([4213e8d](https://github.com/angular/angular/commit/4213e8d))
|
||||||
@ -461,30 +424,6 @@ subscribe to the observable and call markForCheck as needed.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="9.1.11"></a>
|
|
||||||
## [9.1.11](https://github.com/angular/angular/compare/9.1.10...9.1.11) (2020-06-10)
|
|
||||||
|
|
||||||
### Reverts
|
|
||||||
|
|
||||||
* **elements:** fire custom element output events during component initialization ([dc9da17](https://github.com/angular/angular/commit/dc9da17))
|
|
||||||
|
|
||||||
|
|
||||||
<a name="9.1.10"></a>
|
|
||||||
## [9.1.10](https://github.com/angular/angular/compare/9.1.9...9.1.10) (2020-06-09)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **elements:** fire custom element output events during component initialization ([454e073](https://github.com/angular/angular/commit/454e073)), closes [/github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/create-custom-element.ts#L167-L170](https://github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/create-custom-element.ts/issues/L167-L170) [/github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/create-custom-element.ts#L164](https://github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/create-custom-element.ts/issues/L164) [/github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/component-factory-strategy.ts#L158](https://github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/component-factory-strategy.ts/issues/L158) [#36141](https://github.com/angular/angular/issues/36141)
|
|
||||||
|
|
||||||
|
|
||||||
### Performance Improvements
|
|
||||||
|
|
||||||
* **ngcc:** cache parsed tsconfig between runs ([1aae94a](https://github.com/angular/angular/commit/1aae94a)), closes [#37417](https://github.com/angular/angular/issues/37417) [#36882](https://github.com/angular/angular/issues/36882)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="9.1.9"></a>
|
<a name="9.1.9"></a>
|
||||||
## [9.1.9](https://github.com/angular/angular/compare/9.1.8...9.1.9) (2020-05-20)
|
## [9.1.9](https://github.com/angular/angular/compare/9.1.8...9.1.9) (2020-05-20)
|
||||||
|
|
||||||
@ -526,7 +465,6 @@ This release contains various API docs improvements.
|
|||||||
* **compiler-cli**: Revert "fix(compiler-cli): fix case-sensitivity issues in NgtscCompilerHost (#36968)" (#37003)
|
* **compiler-cli**: Revert "fix(compiler-cli): fix case-sensitivity issues in NgtscCompilerHost (#36968)" (#37003)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="9.1.5"></a>
|
<a name="9.1.5"></a>
|
||||||
## [9.1.5](https://github.com/angular/angular/compare/9.1.4...9.1.5) (2020-05-07)
|
## [9.1.5](https://github.com/angular/angular/compare/9.1.4...9.1.5) (2020-05-07)
|
||||||
|
|
||||||
@ -572,7 +510,6 @@ This release contains various API docs improvements.
|
|||||||
* **ngcc:** recognize enum declarations emitted in JavaScript ([#36550](https://github.com/angular/angular/issues/36550)) ([c440165](https://github.com/angular/angular/commit/c440165)), closes [#35584](https://github.com/angular/angular/issues/35584)
|
* **ngcc:** recognize enum declarations emitted in JavaScript ([#36550](https://github.com/angular/angular/issues/36550)) ([c440165](https://github.com/angular/angular/commit/c440165)), closes [#35584](https://github.com/angular/angular/issues/35584)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="9.1.3"></a>
|
<a name="9.1.3"></a>
|
||||||
## [9.1.3](https://github.com/angular/angular/compare/9.1.2...9.1.3) (2020-04-22)
|
## [9.1.3](https://github.com/angular/angular/compare/9.1.2...9.1.3) (2020-04-22)
|
||||||
|
|
||||||
@ -587,8 +524,8 @@ This release contains various API docs improvements.
|
|||||||
* **core:** prevent unknown property check for AOT-compiled components ([#36072](https://github.com/angular/angular/issues/36072)) ([fe1d9ba](https://github.com/angular/angular/commit/fe1d9ba)), closes [#35945](https://github.com/angular/angular/issues/35945)
|
* **core:** prevent unknown property check for AOT-compiled components ([#36072](https://github.com/angular/angular/issues/36072)) ([fe1d9ba](https://github.com/angular/angular/commit/fe1d9ba)), closes [#35945](https://github.com/angular/angular/issues/35945)
|
||||||
* **core:** properly identify modules affected by overrides in TestBed ([#36649](https://github.com/angular/angular/issues/36649)) ([9724169](https://github.com/angular/angular/commit/9724169)), closes [#36619](https://github.com/angular/angular/issues/36619)
|
* **core:** properly identify modules affected by overrides in TestBed ([#36649](https://github.com/angular/angular/issues/36649)) ([9724169](https://github.com/angular/angular/commit/9724169)), closes [#36619](https://github.com/angular/angular/issues/36619)
|
||||||
* **language-service:** properly evaluate types in comparable expressions ([#36529](https://github.com/angular/angular/issues/36529)) ([5bab498](https://github.com/angular/angular/commit/5bab498))
|
* **language-service:** properly evaluate types in comparable expressions ([#36529](https://github.com/angular/angular/issues/36529)) ([5bab498](https://github.com/angular/angular/commit/5bab498))
|
||||||
* **ngcc:** display unlocker process output in sync mode ([#36637](https://github.com/angular/angular/issues/36637)) ([da159bd](https://github.com/angular/angular/commit/da159bd)), closes [/github.com/nodejs/node/issues/3596#issuecomment-250890218](https://github.com/nodejs/node/issues/3596/issues/issuecomment-250890218)
|
* **ngcc:** display unlocker process output in sync mode ([#36637](https://github.com/angular/angular/issues/36637)) ([da159bd](https://github.com/angular/angular/commit/da159bd)), closes [/github.com/nodejs/node/issues/3596#issuecomment-250890218](https://github.com/nodejs/node/issues/3596#issuecomment-250890218)
|
||||||
* **ngcc:** do not use cached file-system ([#36687](https://github.com/angular/angular/issues/36687)) ([18be33a](https://github.com/angular/angular/commit/18be33a)), closes [/github.com/angular/angular-cli/issues/16860#issuecomment-614694269](https://github.com/angular/angular-cli/issues/16860/issues/issuecomment-614694269)
|
* **ngcc:** do not use cached file-system ([#36687](https://github.com/angular/angular/issues/36687)) ([18be33a](https://github.com/angular/angular/commit/18be33a)), closes [/github.com/angular/angular-cli/issues/16860#issuecomment-614694269](https://github.com/angular/angular-cli/issues/16860#issuecomment-614694269)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -609,7 +546,7 @@ This release contains various API docs improvements.
|
|||||||
* **upgrade:** update $locationShim to handle Location changes before initialization ([#36498](https://github.com/angular/angular/issues/36498)) ([a67afcc](https://github.com/angular/angular/commit/a67afcc)), closes [#36492](https://github.com/angular/angular/issues/36492)
|
* **upgrade:** update $locationShim to handle Location changes before initialization ([#36498](https://github.com/angular/angular/issues/36498)) ([a67afcc](https://github.com/angular/angular/commit/a67afcc)), closes [#36492](https://github.com/angular/angular/issues/36492)
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
* **ngcc:** only load if it is needed ([#36486](https://github.com/angular/angular/issues/36486)) ([e06512b](https://github.com/angular/angular/commit/e06512b)) * **ngcc:** read dependencies from entry-point manifest ([#36486](https://github.com/angular/angular/issues/36486)) ([918e628](https://github.com/angular/angular/commit/918e628)), closes [#issuecomment-608401834](https://github.com/angular/angular/issues/issuecomment-608401834)
|
* **ngcc:** only load if it is needed ([#36486](https://github.com/angular/angular/issues/36486)) ([e06512b](https://github.com/angular/angular/commit/e06512b)) * **ngcc:** read dependencies from entry-point manifest ([#36486](https://github.com/angular/angular/issues/36486)) ([918e628](https://github.com/angular/angular/commit/918e628)), closes [#issuecomment-608401834](https://github.com/angular/angular#issuecomment-608401834)
|
||||||
* **ngcc:** reduce the size of the entry-point manifest file ([#36486](https://github.com/angular/angular/issues/36486)) ([603b094](https://github.com/angular/angular/commit/603b094))
|
* **ngcc:** reduce the size of the entry-point manifest file ([#36486](https://github.com/angular/angular/issues/36486)) ([603b094](https://github.com/angular/angular/commit/603b094))
|
||||||
|
|
||||||
|
|
||||||
@ -629,7 +566,7 @@ This release contains various API docs improvements.
|
|||||||
* **core:** undecorated-classes migration should handle derived abstract classes ([#35339](https://github.com/angular/angular/issues/35339)) ([a631b99](https://github.com/angular/angular/commit/a631b99))
|
* **core:** undecorated-classes migration should handle derived abstract classes ([#35339](https://github.com/angular/angular/issues/35339)) ([a631b99](https://github.com/angular/angular/commit/a631b99))
|
||||||
* **language-service:** infer type of elements of array-like objects ([#36312](https://github.com/angular/angular/issues/36312)) ([ff523c9](https://github.com/angular/angular/commit/ff523c9)), closes [#36191](https://github.com/angular/angular/issues/36191)
|
* **language-service:** infer type of elements of array-like objects ([#36312](https://github.com/angular/angular/issues/36312)) ([ff523c9](https://github.com/angular/angular/commit/ff523c9)), closes [#36191](https://github.com/angular/angular/issues/36191)
|
||||||
* **language-service:** use the `HtmlAst` to get the span of HTML tag ([#36371](https://github.com/angular/angular/issues/36371)) ([ffa4e11](https://github.com/angular/angular/commit/ffa4e11))
|
* **language-service:** use the `HtmlAst` to get the span of HTML tag ([#36371](https://github.com/angular/angular/issues/36371)) ([ffa4e11](https://github.com/angular/angular/commit/ffa4e11))
|
||||||
* **ngcc:** add process title ([#36448](https://github.com/angular/angular/issues/36448)) ([136596d](https://github.com/angular/angular/commit/136596d)), closes [/github.com/angular/angular/issues/36414#issuecomment-609644282](https://github.com/angular/angular/issues/36414/issues/issuecomment-609644282)
|
* **ngcc:** add process title ([#36448](https://github.com/angular/angular/issues/36448)) ([136596d](https://github.com/angular/angular/commit/136596d)), closes [36414#issuecomment-609644282](https://github.com/angular/angular/issues/36414#issuecomment-609644282)
|
||||||
* **ngcc:** allow ngcc configuration to match pre-release versions of packages ([#36370](https://github.com/angular/angular/issues/36370)) ([cb0a2a0](https://github.com/angular/angular/commit/cb0a2a0))
|
* **ngcc:** allow ngcc configuration to match pre-release versions of packages ([#36370](https://github.com/angular/angular/issues/36370)) ([cb0a2a0](https://github.com/angular/angular/commit/cb0a2a0))
|
||||||
* **ngcc:** correctly detect imported TypeScript helpers ([#36284](https://github.com/angular/angular/issues/36284)) ([879457c](https://github.com/angular/angular/commit/879457c)), closes [#36089](https://github.com/angular/angular/issues/36089)
|
* **ngcc:** correctly detect imported TypeScript helpers ([#36284](https://github.com/angular/angular/issues/36284)) ([879457c](https://github.com/angular/angular/commit/879457c)), closes [#36089](https://github.com/angular/angular/issues/36089)
|
||||||
* **ngcc:** correctly identify relative Windows-style import paths ([#36372](https://github.com/angular/angular/issues/36372)) ([0daa488](https://github.com/angular/angular/commit/0daa488))
|
* **ngcc:** correctly identify relative Windows-style import paths ([#36372](https://github.com/angular/angular/issues/36372)) ([0daa488](https://github.com/angular/angular/commit/0daa488))
|
||||||
@ -706,9 +643,12 @@ To learn about the release highlights and our CLI-powered automated update workf
|
|||||||
* **animations:** allow computeStyle to work on elements created in Node ([#35810](https://github.com/angular/angular/issues/35810)) ([17cf04e](https://github.com/angular/angular/commit/17cf04e))
|
* **animations:** allow computeStyle to work on elements created in Node ([#35810](https://github.com/angular/angular/issues/35810)) ([17cf04e](https://github.com/angular/angular/commit/17cf04e))
|
||||||
* **animations:** false positive when detecting Node in Webpack builds ([#35134](https://github.com/angular/angular/issues/35134)) ([dc4ae4b](https://github.com/angular/angular/commit/dc4ae4b)), closes [#35117](https://github.com/angular/angular/issues/35117)
|
* **animations:** false positive when detecting Node in Webpack builds ([#35134](https://github.com/angular/angular/issues/35134)) ([dc4ae4b](https://github.com/angular/angular/commit/dc4ae4b)), closes [#35117](https://github.com/angular/angular/issues/35117)
|
||||||
* **animations:** process shorthand `margin` and `padding` styles correctly ([#35701](https://github.com/angular/angular/issues/35701)) ([35c9f0d](https://github.com/angular/angular/commit/35c9f0d)), closes [#35463](https://github.com/angular/angular/issues/35463)
|
* **animations:** process shorthand `margin` and `padding` styles correctly ([#35701](https://github.com/angular/angular/issues/35701)) ([35c9f0d](https://github.com/angular/angular/commit/35c9f0d)), closes [#35463](https://github.com/angular/angular/issues/35463)
|
||||||
|
* **bazel:** devserver shows blank page in Windows ([#35159](https://github.com/angular/angular/issues/35159)) ([727f92f](https://github.com/angular/angular/commit/727f92f))
|
||||||
* **bazel:** do not use manifest paths for generated imports within compilation unit ([#35841](https://github.com/angular/angular/issues/35841)) ([9581658](https://github.com/angular/angular/commit/9581658))
|
* **bazel:** do not use manifest paths for generated imports within compilation unit ([#35841](https://github.com/angular/angular/issues/35841)) ([9581658](https://github.com/angular/angular/commit/9581658))
|
||||||
* **bazel:** ng_package rule creates incorrect UMD module exports ([#35792](https://github.com/angular/angular/issues/35792)) ([5c2a908](https://github.com/angular/angular/commit/5c2a908)), closes [angular/components#18652](https://github.com/angular/components/issues/18652)
|
* **bazel:** ng_package rule creates incorrect UMD module exports ([#35792](https://github.com/angular/angular/issues/35792)) ([5c2a908](https://github.com/angular/angular/commit/5c2a908)), closes [angular/components#18652](https://github.com/angular/components/issues/18652)
|
||||||
* **bazel:** prod server doesn't serve files in windows ([#35991](https://github.com/angular/angular/issues/35991)) ([96e3449](https://github.com/angular/angular/commit/96e3449))
|
* **bazel:** prod server doesn't serve files in windows ([#35991](https://github.com/angular/angular/issues/35991)) ([96e3449](https://github.com/angular/angular/commit/96e3449))
|
||||||
|
* **bazel:** spawn prod server using port 4200 ([#35160](https://github.com/angular/angular/issues/35160)) ([829f506](https://github.com/angular/angular/commit/829f506))
|
||||||
|
* **bazel:** update ibazel to 0.11.1 ([#35158](https://github.com/angular/angular/issues/35158)) ([4e6d237](https://github.com/angular/angular/commit/4e6d237))
|
||||||
* **bazel:** update several packages for better windows support ([#35991](https://github.com/angular/angular/issues/35991)) ([32f099a](https://github.com/angular/angular/commit/32f099a))
|
* **bazel:** update several packages for better windows support ([#35991](https://github.com/angular/angular/issues/35991)) ([32f099a](https://github.com/angular/angular/commit/32f099a))
|
||||||
* **bazel:** update typescript peer dependency range ([#36013](https://github.com/angular/angular/issues/36013)) ([5e3a898](https://github.com/angular/angular/commit/5e3a898))
|
* **bazel:** update typescript peer dependency range ([#36013](https://github.com/angular/angular/issues/36013)) ([5e3a898](https://github.com/angular/angular/commit/5e3a898))
|
||||||
* **common:** let `KeyValuePipe` accept type unions with `null` ([#36093](https://github.com/angular/angular/issues/36093)) ([407fa42](https://github.com/angular/angular/commit/407fa42)), closes [#35743](https://github.com/angular/angular/issues/35743)
|
* **common:** let `KeyValuePipe` accept type unions with `null` ([#36093](https://github.com/angular/angular/issues/36093)) ([407fa42](https://github.com/angular/angular/commit/407fa42)), closes [#35743](https://github.com/angular/angular/issues/35743)
|
||||||
@ -717,6 +657,7 @@ To learn about the release highlights and our CLI-powered automated update workf
|
|||||||
* **compiler:** Propagate value span of ExpressionBinding to ParsedProperty ([#36133](https://github.com/angular/angular/issues/36133)) ([2ce5fa3](https://github.com/angular/angular/commit/2ce5fa3))
|
* **compiler:** Propagate value span of ExpressionBinding to ParsedProperty ([#36133](https://github.com/angular/angular/issues/36133)) ([2ce5fa3](https://github.com/angular/angular/commit/2ce5fa3))
|
||||||
* **compiler:** do not recurse to find static symbols of same module ([#35262](https://github.com/angular/angular/issues/35262)) ([e179c58](https://github.com/angular/angular/commit/e179c58))
|
* **compiler:** do not recurse to find static symbols of same module ([#35262](https://github.com/angular/angular/issues/35262)) ([e179c58](https://github.com/angular/angular/commit/e179c58))
|
||||||
* **compiler:** record correct end of expression ([#34690](https://github.com/angular/angular/issues/34690)) ([df890d7](https://github.com/angular/angular/commit/df890d7)), closes [#33477](https://github.com/angular/angular/issues/33477)
|
* **compiler:** record correct end of expression ([#34690](https://github.com/angular/angular/issues/34690)) ([df890d7](https://github.com/angular/angular/commit/df890d7)), closes [#33477](https://github.com/angular/angular/issues/33477)
|
||||||
|
* **compiler:** report errors for missing binding names ([#34595](https://github.com/angular/angular/issues/34595)) ([d13cab7](https://github.com/angular/angular/commit/d13cab7))
|
||||||
* **compiler:** support directive inputs with interpolations on `<ng-template>`s ([#35984](https://github.com/angular/angular/issues/35984)) ([79659ee](https://github.com/angular/angular/commit/79659ee)), closes [#35752](https://github.com/angular/angular/issues/35752)
|
* **compiler:** support directive inputs with interpolations on `<ng-template>`s ([#35984](https://github.com/angular/angular/issues/35984)) ([79659ee](https://github.com/angular/angular/commit/79659ee)), closes [#35752](https://github.com/angular/angular/issues/35752)
|
||||||
* **compiler:** support i18n attributes on `<ng-template>` tags ([#35681](https://github.com/angular/angular/issues/35681)) ([40da51f](https://github.com/angular/angular/commit/40da51f))
|
* **compiler:** support i18n attributes on `<ng-template>` tags ([#35681](https://github.com/angular/angular/issues/35681)) ([40da51f](https://github.com/angular/angular/commit/40da51f))
|
||||||
* **compiler:** type-checking error for duplicate variables in templates ([#35674](https://github.com/angular/angular/issues/35674)) ([2c41bb8](https://github.com/angular/angular/commit/2c41bb8)), closes [#35186](https://github.com/angular/angular/issues/35186)
|
* **compiler:** type-checking error for duplicate variables in templates ([#35674](https://github.com/angular/angular/issues/35674)) ([2c41bb8](https://github.com/angular/angular/commit/2c41bb8)), closes [#35186](https://github.com/angular/angular/issues/35186)
|
||||||
@ -754,13 +695,19 @@ To learn about the release highlights and our CLI-powered automated update workf
|
|||||||
* **core:** workaround Terser inlining bug ([#36200](https://github.com/angular/angular/issues/36200)) ([f71d132](https://github.com/angular/angular/commit/f71d132))
|
* **core:** workaround Terser inlining bug ([#36200](https://github.com/angular/angular/issues/36200)) ([f71d132](https://github.com/angular/angular/commit/f71d132))
|
||||||
* **elements:** correctly handle setting inputs to `undefined` ([#36140](https://github.com/angular/angular/issues/36140)) ([e066bdd](https://github.com/angular/angular/commit/e066bdd))
|
* **elements:** correctly handle setting inputs to `undefined` ([#36140](https://github.com/angular/angular/issues/36140)) ([e066bdd](https://github.com/angular/angular/commit/e066bdd))
|
||||||
* **elements:** correctly set `SimpleChange#firstChange` for pre-existing inputs ([#36140](https://github.com/angular/angular/issues/36140)) ([447a600](https://github.com/angular/angular/commit/447a600)), closes [#36130](https://github.com/angular/angular/issues/36130)
|
* **elements:** correctly set `SimpleChange#firstChange` for pre-existing inputs ([#36140](https://github.com/angular/angular/issues/36140)) ([447a600](https://github.com/angular/angular/commit/447a600)), closes [#36130](https://github.com/angular/angular/issues/36130)
|
||||||
|
* **elements:** schematics fail with schema.json not found error ([#35211](https://github.com/angular/angular/issues/35211)) ([94d002b](https://github.com/angular/angular/commit/94d002b)), closes [#35154](https://github.com/angular/angular/issues/35154)
|
||||||
|
* **forms:** change Array.reduce usage to Array.forEach ([#35349](https://github.com/angular/angular/issues/35349)) ([554c2cb](https://github.com/angular/angular/commit/554c2cb))
|
||||||
* **ivy:** `LFrame` needs to release memory on `leaveView()` ([#35156](https://github.com/angular/angular/issues/35156)) ([b9b512f](https://github.com/angular/angular/commit/b9b512f)), closes [#35148](https://github.com/angular/angular/issues/35148)
|
* **ivy:** `LFrame` needs to release memory on `leaveView()` ([#35156](https://github.com/angular/angular/issues/35156)) ([b9b512f](https://github.com/angular/angular/commit/b9b512f)), closes [#35148](https://github.com/angular/angular/issues/35148)
|
||||||
* **ivy:** add attributes and classes to host elements based on selector ([#34481](https://github.com/angular/angular/issues/34481)) ([f95b8ce](https://github.com/angular/angular/commit/f95b8ce))
|
* **ivy:** add attributes and classes to host elements based on selector ([#34481](https://github.com/angular/angular/issues/34481)) ([f95b8ce](https://github.com/angular/angular/commit/f95b8ce))
|
||||||
|
* **ivy:** ensure module imports are instantiated before the module being declared ([#35172](https://github.com/angular/angular/issues/35172)) ([b6a3a73](https://github.com/angular/angular/commit/b6a3a73))
|
||||||
* **ivy:** error if directive with synthetic property binding is on same node as directive that injects ViewContainerRef ([#35343](https://github.com/angular/angular/issues/35343)) ([d6bc63f](https://github.com/angular/angular/commit/d6bc63f)), closes [#35342](https://github.com/angular/angular/issues/35342)
|
* **ivy:** error if directive with synthetic property binding is on same node as directive that injects ViewContainerRef ([#35343](https://github.com/angular/angular/issues/35343)) ([d6bc63f](https://github.com/angular/angular/commit/d6bc63f)), closes [#35342](https://github.com/angular/angular/issues/35342)
|
||||||
* **ivy:** narrow `NgIf` context variables in template type checker ([#35125](https://github.com/angular/angular/issues/35125)) ([40039d8](https://github.com/angular/angular/commit/40039d8)), closes [#34572](https://github.com/angular/angular/issues/34572)
|
* **ivy:** narrow `NgIf` context variables in template type checker ([#35125](https://github.com/angular/angular/issues/35125)) ([40039d8](https://github.com/angular/angular/commit/40039d8)), closes [#34572](https://github.com/angular/angular/issues/34572)
|
||||||
* **ivy:** queries should match elements inside ng-container with the descendants: false option ([#35384](https://github.com/angular/angular/issues/35384)) ([3f4e02b](https://github.com/angular/angular/commit/3f4e02b)), closes [#34768](https://github.com/angular/angular/issues/34768)
|
* **ivy:** queries should match elements inside ng-container with the descendants: false option ([#35384](https://github.com/angular/angular/issues/35384)) ([3f4e02b](https://github.com/angular/angular/commit/3f4e02b)), closes [#34768](https://github.com/angular/angular/issues/34768)
|
||||||
|
* **ivy:** repeat template guards to narrow types in event handlers ([#35193](https://github.com/angular/angular/issues/35193)) ([dea1b96](https://github.com/angular/angular/commit/dea1b96)), closes [#35073](https://github.com/angular/angular/issues/35073)
|
||||||
|
* **ivy:** set namespace for host elements of dynamically created components ([#35136](https://github.com/angular/angular/issues/35136)) ([480a4c3](https://github.com/angular/angular/commit/480a4c3))
|
||||||
* **ivy:** support dynamic query tokens in AOT mode ([#35307](https://github.com/angular/angular/issues/35307)) ([3e3a1ef](https://github.com/angular/angular/commit/3e3a1ef)), closes [#34267](https://github.com/angular/angular/issues/34267)
|
* **ivy:** support dynamic query tokens in AOT mode ([#35307](https://github.com/angular/angular/issues/35307)) ([3e3a1ef](https://github.com/angular/angular/commit/3e3a1ef)), closes [#34267](https://github.com/angular/angular/issues/34267)
|
||||||
* **ivy:** wrong context passed to ngOnDestroy when resolved multiple times ([#35249](https://github.com/angular/angular/issues/35249)) ([5fbfe69](https://github.com/angular/angular/commit/5fbfe69)), closes [#35167](https://github.com/angular/angular/issues/35167)
|
* **ivy:** wrong context passed to ngOnDestroy when resolved multiple times ([#35249](https://github.com/angular/angular/issues/35249)) ([5fbfe69](https://github.com/angular/angular/commit/5fbfe69)), closes [#35167](https://github.com/angular/angular/issues/35167)
|
||||||
|
* **language-service:** Suggest ? and ! operator on nullable receiver ([#35200](https://github.com/angular/angular/issues/35200)) ([3cc24a9](https://github.com/angular/angular/commit/3cc24a9))
|
||||||
* **language-service:** fix calculation of pipe spans ([#35986](https://github.com/angular/angular/issues/35986)) ([406419b](https://github.com/angular/angular/commit/406419b))
|
* **language-service:** fix calculation of pipe spans ([#35986](https://github.com/angular/angular/issues/35986)) ([406419b](https://github.com/angular/angular/commit/406419b))
|
||||||
* **language-service:** get the right 'ElementAst' in the nested HTML tag ([#35317](https://github.com/angular/angular/issues/35317)) ([8e354da](https://github.com/angular/angular/commit/8e354da))
|
* **language-service:** get the right 'ElementAst' in the nested HTML tag ([#35317](https://github.com/angular/angular/issues/35317)) ([8e354da](https://github.com/angular/angular/commit/8e354da))
|
||||||
* **language-service:** infer $implicit value for ngIf template contexts ([#35941](https://github.com/angular/angular/issues/35941)) ([18b1bd4](https://github.com/angular/angular/commit/18b1bd4))
|
* **language-service:** infer $implicit value for ngIf template contexts ([#35941](https://github.com/angular/angular/issues/35941)) ([18b1bd4](https://github.com/angular/angular/commit/18b1bd4))
|
||||||
@ -785,6 +732,7 @@ To learn about the release highlights and our CLI-powered automated update workf
|
|||||||
* **ngcc:** correctly detect outer aliased class identifiers in ES5 ([#35527](https://github.com/angular/angular/issues/35527)) ([fde8915](https://github.com/angular/angular/commit/fde8915)), closes [#35399](https://github.com/angular/angular/issues/35399)
|
* **ngcc:** correctly detect outer aliased class identifiers in ES5 ([#35527](https://github.com/angular/angular/issues/35527)) ([fde8915](https://github.com/angular/angular/commit/fde8915)), closes [#35399](https://github.com/angular/angular/issues/35399)
|
||||||
* **ngcc:** do not crash on entry-point that fails to compile ([#36083](https://github.com/angular/angular/issues/36083)) ([ff665b9](https://github.com/angular/angular/commit/ff665b9))
|
* **ngcc:** do not crash on entry-point that fails to compile ([#36083](https://github.com/angular/angular/issues/36083)) ([ff665b9](https://github.com/angular/angular/commit/ff665b9))
|
||||||
* **ngcc:** do not crash on overlapping entry-points ([#36083](https://github.com/angular/angular/issues/36083)) ([c9f554c](https://github.com/angular/angular/commit/c9f554c))
|
* **ngcc:** do not crash on overlapping entry-points ([#36083](https://github.com/angular/angular/issues/36083)) ([c9f554c](https://github.com/angular/angular/commit/c9f554c))
|
||||||
|
* **ngcc:** ensure that path-mapped secondary entry-points are processed correctly ([#35227](https://github.com/angular/angular/issues/35227)) ([c3c1140](https://github.com/angular/angular/commit/c3c1140)), closes [#35188](https://github.com/angular/angular/issues/35188)
|
||||||
* **ngcc:** handle imports in dts files when processing CommonJS ([#35191](https://github.com/angular/angular/issues/35191)) ([b6e8847](https://github.com/angular/angular/commit/b6e8847)), closes [#34356](https://github.com/angular/angular/issues/34356)
|
* **ngcc:** handle imports in dts files when processing CommonJS ([#35191](https://github.com/angular/angular/issues/35191)) ([b6e8847](https://github.com/angular/angular/commit/b6e8847)), closes [#34356](https://github.com/angular/angular/issues/34356)
|
||||||
* **ngcc:** handle mappings outside the content when flattening source-maps ([#35718](https://github.com/angular/angular/issues/35718)) ([73cf7d5](https://github.com/angular/angular/commit/73cf7d5)), closes [#35709](https://github.com/angular/angular/issues/35709)
|
* **ngcc:** handle mappings outside the content when flattening source-maps ([#35718](https://github.com/angular/angular/issues/35718)) ([73cf7d5](https://github.com/angular/angular/commit/73cf7d5)), closes [#35709](https://github.com/angular/angular/issues/35709)
|
||||||
* **ngcc:** handle missing sources when flattening source-maps ([#35718](https://github.com/angular/angular/issues/35718)) ([72c4fda](https://github.com/angular/angular/commit/72c4fda)), closes [#35709](https://github.com/angular/angular/issues/35709)
|
* **ngcc:** handle missing sources when flattening source-maps ([#35718](https://github.com/angular/angular/issues/35718)) ([72c4fda](https://github.com/angular/angular/commit/72c4fda)), closes [#35709](https://github.com/angular/angular/issues/35709)
|
||||||
@ -1042,7 +990,7 @@ To learn about the release highlights and our CLI-powered automated update workf
|
|||||||
* **compiler-cli:** require node 10 as runtime engine ([#34722](https://github.com/angular/angular/issues/34722)) ([7b77b3d](https://github.com/angular/angular/commit/7b77b3d))
|
* **compiler-cli:** require node 10 as runtime engine ([#34722](https://github.com/angular/angular/issues/34722)) ([7b77b3d](https://github.com/angular/angular/commit/7b77b3d))
|
||||||
* **language-service:** specific suggestions for template context diags ([#34751](https://github.com/angular/angular/issues/34751)) ([cc7fca4](https://github.com/angular/angular/commit/cc7fca4))
|
* **language-service:** specific suggestions for template context diags ([#34751](https://github.com/angular/angular/issues/34751)) ([cc7fca4](https://github.com/angular/angular/commit/cc7fca4))
|
||||||
* **language-service:** support multiple symbol definitions ([#34782](https://github.com/angular/angular/issues/34782)) ([2f2396c](https://github.com/angular/angular/commit/2f2396c))
|
* **language-service:** support multiple symbol definitions ([#34782](https://github.com/angular/angular/issues/34782)) ([2f2396c](https://github.com/angular/angular/commit/2f2396c))
|
||||||
* **ngcc:** lock ngcc when processing ([#34722](https://github.com/angular/angular/issues/34722)) ([6dd51f1](https://github.com/angular/angular/commit/6dd51f1)), closes [/github.com/angular/angular/issues/32431#issuecomment-571825781](https://github.com/angular/angular/issues/32431/issues/issuecomment-571825781)
|
* **ngcc:** lock ngcc when processing ([#34722](https://github.com/angular/angular/issues/34722)) ([6dd51f1](https://github.com/angular/angular/commit/6dd51f1)), closes [32431#issuecomment-571825781](https://github.com/angular/angular/issues/32431#issuecomment-571825781)
|
||||||
* work around 'noImplicityAny' incompatibility due to ts3.7 update ([#34798](https://github.com/angular/angular/issues/34798)) ([251d548](https://github.com/angular/angular/commit/251d548))
|
* work around 'noImplicityAny' incompatibility due to ts3.7 update ([#34798](https://github.com/angular/angular/issues/34798)) ([251d548](https://github.com/angular/angular/commit/251d548))
|
||||||
* **animations:** not waiting for child animations to finish when removing parent in Ivy ([#34702](https://github.com/angular/angular/issues/34702)) ([92c17fe](https://github.com/angular/angular/commit/92c17fe)), closes [#33597](https://github.com/angular/angular/issues/33597)
|
* **animations:** not waiting for child animations to finish when removing parent in Ivy ([#34702](https://github.com/angular/angular/issues/34702)) ([92c17fe](https://github.com/angular/angular/commit/92c17fe)), closes [#33597](https://github.com/angular/angular/issues/33597)
|
||||||
* **common:** ensure diffing in ngStyle/ngClass correctly emits value changes ([#34307](https://github.com/angular/angular/issues/34307)) ([93a035f](https://github.com/angular/angular/commit/93a035f)), closes [#34336](https://github.com/angular/angular/issues/34336) [#34444](https://github.com/angular/angular/issues/34444)
|
* **common:** ensure diffing in ngStyle/ngClass correctly emits value changes ([#34307](https://github.com/angular/angular/issues/34307)) ([93a035f](https://github.com/angular/angular/commit/93a035f)), closes [#34336](https://github.com/angular/angular/issues/34336) [#34444](https://github.com/angular/angular/issues/34444)
|
||||||
@ -1173,7 +1121,7 @@ To learn about the release highlights and our CLI-powered automated update workf
|
|||||||
* **ngcc:** do not output duplicate ɵprov properties ([#34085](https://github.com/angular/angular/issues/34085)) ([5a8d25d](https://github.com/angular/angular/commit/5a8d25d))
|
* **ngcc:** do not output duplicate ɵprov properties ([#34085](https://github.com/angular/angular/issues/34085)) ([5a8d25d](https://github.com/angular/angular/commit/5a8d25d))
|
||||||
* **ngcc:** render localized strings when in ES5 format ([#33857](https://github.com/angular/angular/issues/33857)) ([c6695fa](https://github.com/angular/angular/commit/c6695fa))
|
* **ngcc:** render localized strings when in ES5 format ([#33857](https://github.com/angular/angular/issues/33857)) ([c6695fa](https://github.com/angular/angular/commit/c6695fa))
|
||||||
* **ngcc:** render UMD global imports correctly ([#34012](https://github.com/angular/angular/issues/34012)) ([83989b8](https://github.com/angular/angular/commit/83989b8))
|
* **ngcc:** render UMD global imports correctly ([#34012](https://github.com/angular/angular/issues/34012)) ([83989b8](https://github.com/angular/angular/commit/83989b8))
|
||||||
* **ngcc:** report errors from `analyze` and `resolve` processing ([#33964](https://github.com/angular/angular/issues/33964)) ([ca5d772](https://github.com/angular/angular/commit/ca5d772)), closes [/github.com/angular/angular/issues/33685#issuecomment-557091719](https://github.com/angular/angular/issues/33685/issues/issuecomment-557091719)
|
* **ngcc:** report errors from `analyze` and `resolve` processing ([#33964](https://github.com/angular/angular/issues/33964)) ([ca5d772](https://github.com/angular/angular/commit/ca5d772)), closes [33685#issuecomment-557091719](https://github.com/angular/angular/issues/33685#issuecomment-557091719)
|
||||||
* **router:** make routerLinkActive work with query params which contain arrays ([#22666](https://github.com/angular/angular/issues/22666)) ([f1bf5b2](https://github.com/angular/angular/commit/f1bf5b2)), closes [#22223](https://github.com/angular/angular/issues/22223)
|
* **router:** make routerLinkActive work with query params which contain arrays ([#22666](https://github.com/angular/angular/issues/22666)) ([f1bf5b2](https://github.com/angular/angular/commit/f1bf5b2)), closes [#22223](https://github.com/angular/angular/issues/22223)
|
||||||
* **service-worker:** allow creating post api requests after cache failure ([#33930](https://github.com/angular/angular/issues/33930)) ([63c9123](https://github.com/angular/angular/commit/63c9123)), closes [#33793](https://github.com/angular/angular/issues/33793)
|
* **service-worker:** allow creating post api requests after cache failure ([#33930](https://github.com/angular/angular/issues/33930)) ([63c9123](https://github.com/angular/angular/commit/63c9123)), closes [#33793](https://github.com/angular/angular/issues/33793)
|
||||||
* **service-worker:** throw when using the unsupported `versionedFiles` option in config ([#33903](https://github.com/angular/angular/issues/33903)) ([250e6fd](https://github.com/angular/angular/commit/250e6fd))
|
* **service-worker:** throw when using the unsupported `versionedFiles` option in config ([#33903](https://github.com/angular/angular/issues/33903)) ([250e6fd](https://github.com/angular/angular/commit/250e6fd))
|
||||||
@ -1252,7 +1200,7 @@ To learn about the release highlights and our CLI-powered automated update workf
|
|||||||
* **language-service:** Should not crash if expr ends unexpectedly ([#33524](https://github.com/angular/angular/issues/33524)) ([9ebac71](https://github.com/angular/angular/commit/9ebac71))
|
* **language-service:** Should not crash if expr ends unexpectedly ([#33524](https://github.com/angular/angular/issues/33524)) ([9ebac71](https://github.com/angular/angular/commit/9ebac71))
|
||||||
* **ngcc:** handle new `__spreadArrays` tslib helper ([#33617](https://github.com/angular/angular/issues/33617)) ([d749dd3](https://github.com/angular/angular/commit/d749dd3)), closes [#33614](https://github.com/angular/angular/issues/33614)
|
* **ngcc:** handle new `__spreadArrays` tslib helper ([#33617](https://github.com/angular/angular/issues/33617)) ([d749dd3](https://github.com/angular/angular/commit/d749dd3)), closes [#33614](https://github.com/angular/angular/issues/33614)
|
||||||
* **ngcc:** override `getInternalNameOfClass()` and `getAdjacentNameOfClass()` for ES5 ([#33533](https://github.com/angular/angular/issues/33533)) ([93a23b9](https://github.com/angular/angular/commit/93a23b9))
|
* **ngcc:** override `getInternalNameOfClass()` and `getAdjacentNameOfClass()` for ES5 ([#33533](https://github.com/angular/angular/issues/33533)) ([93a23b9](https://github.com/angular/angular/commit/93a23b9))
|
||||||
* **ngcc:** render adjacent statements after static properties ([#33630](https://github.com/angular/angular/issues/33630)) ([fe12d0d](https://github.com/angular/angular/commit/fe12d0d)), closes [/github.com/angular/angular/pull/33337#issuecomment-545487737](https://github.com/angular/angular/pull/33337/issues/issuecomment-545487737)
|
* **ngcc:** render adjacent statements after static properties ([#33630](https://github.com/angular/angular/issues/33630)) ([fe12d0d](https://github.com/angular/angular/commit/fe12d0d)), closes [/github.com/angular/angular/pull/33337#issuecomment-545487737](https://github.com/angular/angular/pull/33337#issuecomment-545487737)
|
||||||
* **ngcc:** render new definitions using the inner name of the class ([#33533](https://github.com/angular/angular/issues/33533)) ([85298e3](https://github.com/angular/angular/commit/85298e3))
|
* **ngcc:** render new definitions using the inner name of the class ([#33533](https://github.com/angular/angular/issues/33533)) ([85298e3](https://github.com/angular/angular/commit/85298e3))
|
||||||
* **service-worker:** ensure initialization before handling messages ([#32525](https://github.com/angular/angular/issues/32525)) ([72eba77](https://github.com/angular/angular/commit/72eba77)), closes [#25611](https://github.com/angular/angular/issues/25611)
|
* **service-worker:** ensure initialization before handling messages ([#32525](https://github.com/angular/angular/issues/32525)) ([72eba77](https://github.com/angular/angular/commit/72eba77)), closes [#25611](https://github.com/angular/angular/issues/25611)
|
||||||
* **compiler:** i18n - ignore `alt-trans` tags in XLIFF 1.2 ([#33450](https://github.com/angular/angular/issues/33450)) ([936700a](https://github.com/angular/angular/commit/936700a)), closes [#33161](https://github.com/angular/angular/issues/33161)
|
* **compiler:** i18n - ignore `alt-trans` tags in XLIFF 1.2 ([#33450](https://github.com/angular/angular/issues/33450)) ([936700a](https://github.com/angular/angular/commit/936700a)), closes [#33161](https://github.com/angular/angular/issues/33161)
|
||||||
@ -1282,7 +1230,7 @@ To learn about the release highlights and our CLI-powered automated update workf
|
|||||||
* **language-service:** Add directive selectors & banana-in-a-box to completions ([#33311](https://github.com/angular/angular/issues/33311)) ([49eec5d](https://github.com/angular/angular/commit/49eec5d))
|
* **language-service:** Add directive selectors & banana-in-a-box to completions ([#33311](https://github.com/angular/angular/issues/33311)) ([49eec5d](https://github.com/angular/angular/commit/49eec5d))
|
||||||
* **language-service:** Add global symbol for $any() ([#33245](https://github.com/angular/angular/issues/33245)) ([3f257e9](https://github.com/angular/angular/commit/3f257e9))
|
* **language-service:** Add global symbol for $any() ([#33245](https://github.com/angular/angular/issues/33245)) ([3f257e9](https://github.com/angular/angular/commit/3f257e9))
|
||||||
* **language-service:** Preserve CRLF in templates for language-service ([#33241](https://github.com/angular/angular/issues/33241)) ([65a0d2b](https://github.com/angular/angular/commit/65a0d2b))
|
* **language-service:** Preserve CRLF in templates for language-service ([#33241](https://github.com/angular/angular/issues/33241)) ([65a0d2b](https://github.com/angular/angular/commit/65a0d2b))
|
||||||
* **ngcc:** do not fail when multiple workers try to create the same directory ([#33237](https://github.com/angular/angular/issues/33237)) ([8017229](https://github.com/angular/angular/commit/8017229)), closes [/github.com/angular/angular/pull/33049#issuecomment-540485703](https://github.com/angular/angular/pull/33049/issues/issuecomment-540485703)
|
* **ngcc:** do not fail when multiple workers try to create the same directory ([#33237](https://github.com/angular/angular/issues/33237)) ([8017229](https://github.com/angular/angular/commit/8017229)), closes [/github.com/angular/angular/pull/33049#issuecomment-540485703](https://github.com/angular/angular/pull/33049#issuecomment-540485703)
|
||||||
* **bazel:** Remove angular devkit and restore ngc postinstall ([#32946](https://github.com/angular/angular/issues/32946)) ([f036684](https://github.com/angular/angular/commit/f036684))
|
* **bazel:** Remove angular devkit and restore ngc postinstall ([#32946](https://github.com/angular/angular/issues/32946)) ([f036684](https://github.com/angular/angular/commit/f036684))
|
||||||
* **common:** remove deprecated support for intl API ([#29250](https://github.com/angular/angular/issues/29250)) ([9e7668f](https://github.com/angular/angular/commit/9e7668f)), closes [#18284](https://github.com/angular/angular/issues/18284)
|
* **common:** remove deprecated support for intl API ([#29250](https://github.com/angular/angular/issues/29250)) ([9e7668f](https://github.com/angular/angular/commit/9e7668f)), closes [#18284](https://github.com/angular/angular/issues/18284)
|
||||||
* **compiler:** absolute source span for template attribute expressions ([#33189](https://github.com/angular/angular/issues/33189)) ([fd4fed1](https://github.com/angular/angular/commit/fd4fed1))
|
* **compiler:** absolute source span for template attribute expressions ([#33189](https://github.com/angular/angular/issues/33189)) ([fd4fed1](https://github.com/angular/angular/commit/fd4fed1))
|
||||||
@ -1339,7 +1287,7 @@ To learn about the release highlights and our CLI-powered automated update workf
|
|||||||
* **language-service:** Turn on strict mode for test project ([#32783](https://github.com/angular/angular/issues/32783)) ([28358b6](https://github.com/angular/angular/commit/28358b6))
|
* **language-service:** Turn on strict mode for test project ([#32783](https://github.com/angular/angular/issues/32783)) ([28358b6](https://github.com/angular/angular/commit/28358b6))
|
||||||
* **ngcc:** ensure private exports are added for `ModuleWithProviders` ([#32902](https://github.com/angular/angular/issues/32902)) ([002a97d](https://github.com/angular/angular/commit/002a97d))
|
* **ngcc:** ensure private exports are added for `ModuleWithProviders` ([#32902](https://github.com/angular/angular/issues/32902)) ([002a97d](https://github.com/angular/angular/commit/002a97d))
|
||||||
* **ngcc:** handle presence of both `ctorParameters` and `__decorate` ([#32901](https://github.com/angular/angular/issues/32901)) ([747f0cf](https://github.com/angular/angular/commit/747f0cf))
|
* **ngcc:** handle presence of both `ctorParameters` and `__decorate` ([#32901](https://github.com/angular/angular/issues/32901)) ([747f0cf](https://github.com/angular/angular/commit/747f0cf))
|
||||||
* **ngcc:** make the build-marker error more clear ([#32712](https://github.com/angular/angular/issues/32712)) ([0ea4875](https://github.com/angular/angular/commit/0ea4875)), closes [/github.com/angular/angular/issues/31354#issuecomment-532080537](https://github.com/angular/angular/issues/31354/issues/issuecomment-532080537)
|
* **ngcc:** make the build-marker error more clear ([#32712](https://github.com/angular/angular/issues/32712)) ([0ea4875](https://github.com/angular/angular/commit/0ea4875)), closes [31354#issuecomment-532080537](https://github.com/angular/angular/issues/31354#issuecomment-532080537)
|
||||||
* **upgrade:** fix AngularJsUrlCodec to support Safari ([#32959](https://github.com/angular/angular/issues/32959)) ([39e8ceb](https://github.com/angular/angular/commit/39e8ceb))
|
* **upgrade:** fix AngularJsUrlCodec to support Safari ([#32959](https://github.com/angular/angular/issues/32959)) ([39e8ceb](https://github.com/angular/angular/commit/39e8ceb))
|
||||||
* **ivy:** ensure `window.ng.getDebugNode` returns debug info for component elements ([#32780](https://github.com/angular/angular/issues/32780)) ([5651fa3](https://github.com/angular/angular/commit/5651fa3))
|
* **ivy:** ensure `window.ng.getDebugNode` returns debug info for component elements ([#32780](https://github.com/angular/angular/issues/32780)) ([5651fa3](https://github.com/angular/angular/commit/5651fa3))
|
||||||
* **ivy:** ensure multiple map-based bindings do not skip intermediate values ([#32774](https://github.com/angular/angular/issues/32774)) ([86fd571](https://github.com/angular/angular/commit/86fd571))
|
* **ivy:** ensure multiple map-based bindings do not skip intermediate values ([#32774](https://github.com/angular/angular/issues/32774)) ([86fd571](https://github.com/angular/angular/commit/86fd571))
|
||||||
@ -1448,7 +1396,7 @@ To learn about the release highlights and our CLI-powered automated update workf
|
|||||||
* **ivy:** graceful evaluation of unknown or invalid expressions ([#33453](https://github.com/angular/angular/issues/33453)) ([ce30888](https://github.com/angular/angular/commit/ce30888))
|
* **ivy:** graceful evaluation of unknown or invalid expressions ([#33453](https://github.com/angular/angular/issues/33453)) ([ce30888](https://github.com/angular/angular/commit/ce30888))
|
||||||
* **ivy:** implement unknown element detection in jit mode ([#33419](https://github.com/angular/angular/issues/33419)) ([c83f501](https://github.com/angular/angular/commit/c83f501))
|
* **ivy:** implement unknown element detection in jit mode ([#33419](https://github.com/angular/angular/issues/33419)) ([c83f501](https://github.com/angular/angular/commit/c83f501))
|
||||||
* add a flag in bootstrap to enable coalesce event change detection to improve performance ([#30533](https://github.com/angular/angular/issues/30533)) ([44623a1](https://github.com/angular/angular/commit/44623a1))
|
* add a flag in bootstrap to enable coalesce event change detection to improve performance ([#30533](https://github.com/angular/angular/issues/30533)) ([44623a1](https://github.com/angular/angular/commit/44623a1))
|
||||||
* **bazel:** update [@bazel](https://github.com/bazel)/schematics to Bazel 1.0.0 ([#33476](https://github.com/angular/angular/issues/33476)) ([540d104](https://github.com/angular/angular/commit/540d104)), closes [/github.com/angular/angular/pull/33367#issuecomment-547643246](https://github.com/angular/angular/pull/33367/issues/issuecomment-547643246)
|
* **bazel:** update [@bazel](https://github.com/bazel)/schematics to Bazel 1.0.0 ([#33476](https://github.com/angular/angular/issues/33476)) ([540d104](https://github.com/angular/angular/commit/540d104)), closes [/github.com/angular/angular/pull/33367#issuecomment-547643246](https://github.com/angular/angular/pull/33367#issuecomment-547643246)
|
||||||
* **bazel:** update bazel-schematics to use Ivy and new rollup_bundle ([#33435](https://github.com/angular/angular/issues/33435)) ([bf913cc](https://github.com/angular/angular/commit/bf913cc))
|
* **bazel:** update bazel-schematics to use Ivy and new rollup_bundle ([#33435](https://github.com/angular/angular/issues/33435)) ([bf913cc](https://github.com/angular/angular/commit/bf913cc))
|
||||||
* **ivy:** i18n - support inlining of XTB formatted translation files ([#33444](https://github.com/angular/angular/issues/33444)) ([2c623fd](https://github.com/angular/angular/commit/2c623fd))
|
* **ivy:** i18n - support inlining of XTB formatted translation files ([#33444](https://github.com/angular/angular/issues/33444)) ([2c623fd](https://github.com/angular/angular/commit/2c623fd))
|
||||||
* **language-service:** add support for text replacement ([#33091](https://github.com/angular/angular/issues/33091)) ([da4eb91](https://github.com/angular/angular/commit/da4eb91))
|
* **language-service:** add support for text replacement ([#33091](https://github.com/angular/angular/issues/33091)) ([da4eb91](https://github.com/angular/angular/commit/da4eb91))
|
||||||
@ -1490,7 +1438,7 @@ To learn about the release highlights and our CLI-powered automated update workf
|
|||||||
* **ivy:** i18n - implement compile-time inlining ([#32881](https://github.com/angular/angular/issues/32881)) ([2cdb3a0](https://github.com/angular/angular/commit/2cdb3a0))
|
* **ivy:** i18n - implement compile-time inlining ([#32881](https://github.com/angular/angular/issues/32881)) ([2cdb3a0](https://github.com/angular/angular/commit/2cdb3a0))
|
||||||
* **ivy:** i18n - render legacy message ids in `$localize` if requested ([#32937](https://github.com/angular/angular/issues/32937)) ([bcbf3e4](https://github.com/angular/angular/commit/bcbf3e4))
|
* **ivy:** i18n - render legacy message ids in `$localize` if requested ([#32937](https://github.com/angular/angular/issues/32937)) ([bcbf3e4](https://github.com/angular/angular/commit/bcbf3e4))
|
||||||
* **language-service:** module definitions on directive hover ([#32763](https://github.com/angular/angular/issues/32763)) ([0d186dd](https://github.com/angular/angular/commit/0d186dd)), closes [#32565](https://github.com/angular/angular/issues/32565)
|
* **language-service:** module definitions on directive hover ([#32763](https://github.com/angular/angular/issues/32763)) ([0d186dd](https://github.com/angular/angular/commit/0d186dd)), closes [#32565](https://github.com/angular/angular/issues/32565)
|
||||||
* **ngcc:** expose `--create-ivy-entry-points` option on ivy-ngcc ([#33049](https://github.com/angular/angular/issues/33049)) ([b2b917d](https://github.com/angular/angular/commit/b2b917d)), closes [/github.com/angular/angular/pull/32999#issuecomment-539937368](https://github.com/angular/angular/pull/32999/issues/issuecomment-539937368)
|
* **ngcc:** expose `--create-ivy-entry-points` option on ivy-ngcc ([#33049](https://github.com/angular/angular/issues/33049)) ([b2b917d](https://github.com/angular/angular/commit/b2b917d)), closes [/github.com/angular/angular/pull/32999#issuecomment-539937368](https://github.com/angular/angular/pull/32999#issuecomment-539937368)
|
||||||
* update rxjs peerDependencies minimum requirment to 6.5.3 ([#32812](https://github.com/angular/angular/issues/32812)) ([66658c4](https://github.com/angular/angular/commit/66658c4))
|
* update rxjs peerDependencies minimum requirment to 6.5.3 ([#32812](https://github.com/angular/angular/issues/32812)) ([66658c4](https://github.com/angular/angular/commit/66658c4))
|
||||||
* **ivy:** support ng-add in localize package ([#32791](https://github.com/angular/angular/issues/32791)) ([e41cbfb](https://github.com/angular/angular/commit/e41cbfb))
|
* **ivy:** support ng-add in localize package ([#32791](https://github.com/angular/angular/issues/32791)) ([e41cbfb](https://github.com/angular/angular/commit/e41cbfb))
|
||||||
* **language-service:** allow retreiving synchronized analyzed NgModules ([#32779](https://github.com/angular/angular/issues/32779)) ([98feee7](https://github.com/angular/angular/commit/98feee7))
|
* **language-service:** allow retreiving synchronized analyzed NgModules ([#32779](https://github.com/angular/angular/issues/32779)) ([98feee7](https://github.com/angular/angular/commit/98feee7))
|
||||||
@ -1869,6 +1817,7 @@ This release contains various API docs improvements.
|
|||||||
* **language-service:** Eagarly initialize data members ([#31577](https://github.com/angular/angular/issues/31577)) ([0110de2](https://github.com/angular/angular/commit/0110de2))
|
* **language-service:** Eagarly initialize data members ([#31577](https://github.com/angular/angular/issues/31577)) ([0110de2](https://github.com/angular/angular/commit/0110de2))
|
||||||
* **bazel:** revert location of xi18n outputs to bazel-genfiles ([#31410](https://github.com/angular/angular/issues/31410)) ([1d3e227](https://github.com/angular/angular/commit/1d3e227))
|
* **bazel:** revert location of xi18n outputs to bazel-genfiles ([#31410](https://github.com/angular/angular/issues/31410)) ([1d3e227](https://github.com/angular/angular/commit/1d3e227))
|
||||||
* **compiler:** give ASTWithSource its own visit method ([#31347](https://github.com/angular/angular/issues/31347)) ([6aaca21](https://github.com/angular/angular/commit/6aaca21))
|
* **compiler:** give ASTWithSource its own visit method ([#31347](https://github.com/angular/angular/issues/31347)) ([6aaca21](https://github.com/angular/angular/commit/6aaca21))
|
||||||
|
* **core:** handle `undefined` meta in `injectArgs` ([#31333](https://github.com/angular/angular/issues/31333)) ([80ccd6c](https://github.com/angular/angular/commit/80ccd6c)), closes [CLI #14888](https://github.com/angular/angular-cli/issues/14888)
|
||||||
* **service-worker:** cache opaque responses in data groups with `freshness` strategy ([#30977](https://github.com/angular/angular/issues/30977)) ([d7be38f](https://github.com/angular/angular/commit/d7be38f)), closes [#30968](https://github.com/angular/angular/issues/30968)
|
* **service-worker:** cache opaque responses in data groups with `freshness` strategy ([#30977](https://github.com/angular/angular/issues/30977)) ([d7be38f](https://github.com/angular/angular/commit/d7be38f)), closes [#30968](https://github.com/angular/angular/issues/30968)
|
||||||
* **service-worker:** cache opaque responses when requests exceeds timeout threshold ([#30977](https://github.com/angular/angular/issues/30977)) ([93abc35](https://github.com/angular/angular/commit/93abc35))
|
* **service-worker:** cache opaque responses when requests exceeds timeout threshold ([#30977](https://github.com/angular/angular/issues/30977)) ([93abc35](https://github.com/angular/angular/commit/93abc35))
|
||||||
|
|
||||||
@ -1898,6 +1847,7 @@ This release contains various API docs improvements.
|
|||||||
|
|
||||||
* use the correct WTF array to iterate over ([#31208](https://github.com/angular/angular/issues/31208)) ([4aed480](https://github.com/angular/angular/commit/4aed480))
|
* use the correct WTF array to iterate over ([#31208](https://github.com/angular/angular/issues/31208)) ([4aed480](https://github.com/angular/angular/commit/4aed480))
|
||||||
* **compiler-cli:** Return original sourceFile instead of redirected sourceFile from getSourceFile ([#26036](https://github.com/angular/angular/issues/26036)) ([13dbb98](https://github.com/angular/angular/commit/13dbb98)), closes [#22524](https://github.com/angular/angular/issues/22524)
|
* **compiler-cli:** Return original sourceFile instead of redirected sourceFile from getSourceFile ([#26036](https://github.com/angular/angular/issues/26036)) ([13dbb98](https://github.com/angular/angular/commit/13dbb98)), closes [#22524](https://github.com/angular/angular/issues/22524)
|
||||||
|
* **core:** export provider interfaces that are part of the public API types ([#31377](https://github.com/angular/angular/issues/31377)) ([bebf089](https://github.com/angular/angular/commit/bebf089)), closes [/github.com/angular/angular/pull/31377#discussion_r299254408](https://github.com/angular/angular/pull/31377/issues/discussion_r299254408) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L365-L366](https://github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L365-L366) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts#L283-L284](https://github.com/angular/angular/blob/9e34670b2/packages/core/src/di/interface/provider.ts/issues/L283-L284) [/github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts#L23](https://github.com/angular/angular/blob/9e34670b2/packages/core/src/di/index.ts/issues/L23)
|
||||||
|
|
||||||
|
|
||||||
<a name="8.1.1"></a>
|
<a name="8.1.1"></a>
|
||||||
@ -2075,6 +2025,7 @@ To learn about the release highlights and our CLI-powered automated update workf
|
|||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add support for TypeScript 3.4 (and drop older versions) ([#29372](https://github.com/angular/angular/issues/29372)) ([ef85336](https://github.com/angular/angular/commit/ef85336))
|
* add support for TypeScript 3.4 (and drop older versions) ([#29372](https://github.com/angular/angular/issues/29372)) ([ef85336](https://github.com/angular/angular/commit/ef85336))
|
||||||
|
* **common:** add ability to watch for AngularJS URL updates through `onUrlChange` hook ([#30466](https://github.com/angular/angular/issues/30466)) ([8022d36](https://github.com/angular/angular/commit/8022d36))
|
||||||
* **common:** stricter types for `SlicePipe` ([#30156](https://github.com/angular/angular/issues/30156)) ([722b2fa](https://github.com/angular/angular/commit/722b2fa))
|
* **common:** stricter types for `SlicePipe` ([#30156](https://github.com/angular/angular/issues/30156)) ([722b2fa](https://github.com/angular/angular/commit/722b2fa))
|
||||||
* **bazel:** use `rbe_autoconfig()` and new container ([#29336](https://github.com/angular/angular/issues/29336)) ([e562acc](https://github.com/angular/angular/commit/e562acc))
|
* **bazel:** use `rbe_autoconfig()` and new container ([#29336](https://github.com/angular/angular/issues/29336)) ([e562acc](https://github.com/angular/angular/commit/e562acc))
|
||||||
* **common:** add @angular/common/upgrade package for `$location`-related APIs ([#30055](https://github.com/angular/angular/issues/30055)) ([152d99e](https://github.com/angular/angular/commit/152d99e))
|
* **common:** add @angular/common/upgrade package for `$location`-related APIs ([#30055](https://github.com/angular/angular/issues/30055)) ([152d99e](https://github.com/angular/angular/commit/152d99e))
|
||||||
@ -2191,6 +2142,8 @@ To learn about the release highlights and our CLI-powered automated update workf
|
|||||||
* **bazel:** use `//:tsconfig.json` as the default for `ng_module` ([#29670](https://github.com/angular/angular/issues/29670)) ([b14537a](https://github.com/angular/angular/commit/b14537a))
|
* **bazel:** use `//:tsconfig.json` as the default for `ng_module` ([#29670](https://github.com/angular/angular/issues/29670)) ([b14537a](https://github.com/angular/angular/commit/b14537a))
|
||||||
* **compiler-cli:** ngcc - cope with processing entry-points multiple times ([#29657](https://github.com/angular/angular/issues/29657)) ([6b39c9c](https://github.com/angular/angular/commit/6b39c9c))
|
* **compiler-cli:** ngcc - cope with processing entry-points multiple times ([#29657](https://github.com/angular/angular/issues/29657)) ([6b39c9c](https://github.com/angular/angular/commit/6b39c9c))
|
||||||
* **core:** static-query schematic should detect static queries in getters. ([#29609](https://github.com/angular/angular/issues/29609)) ([33016b8](https://github.com/angular/angular/commit/33016b8))
|
* **core:** static-query schematic should detect static queries in getters. ([#29609](https://github.com/angular/angular/issues/29609)) ([33016b8](https://github.com/angular/angular/commit/33016b8))
|
||||||
|
* **common:** escape query selector used when anchor scrolling ([#29577](https://github.com/angular/angular/issues/29577)) ([7671c73](https://github.com/angular/angular/commit/7671c73)), closes [#28193](https://github.com/angular/angular/issues/28193)
|
||||||
|
* **router:** adjust setting navigationTransition when a new navigation cancels an existing one ([#29636](https://github.com/angular/angular/issues/29636)) ([e884c0c](https://github.com/angular/angular/commit/e884c0c)), closes [#29389](https://github.com/angular/angular/issues/29389) [#29590](https://github.com/angular/angular/issues/29590)
|
||||||
* **bazel:** allow `ng_module` users to set `createExternalSymbolFactoryReexports` ([#29459](https://github.com/angular/angular/issues/29459)) ([21be0fb](https://github.com/angular/angular/commit/21be0fb))
|
* **bazel:** allow `ng_module` users to set `createExternalSymbolFactoryReexports` ([#29459](https://github.com/angular/angular/issues/29459)) ([21be0fb](https://github.com/angular/angular/commit/21be0fb))
|
||||||
* **bazel:** workaround problem reading summary files from node_modules ([#29459](https://github.com/angular/angular/issues/29459)) ([769d960](https://github.com/angular/angular/commit/769d960))
|
* **bazel:** workaround problem reading summary files from node_modules ([#29459](https://github.com/angular/angular/issues/29459)) ([769d960](https://github.com/angular/angular/commit/769d960))
|
||||||
* **compiler:** inherit param types when class has a constructor which takes no declared parameters and delegates up ([#29232](https://github.com/angular/angular/issues/29232)) ([0007564](https://github.com/angular/angular/commit/0007564))
|
* **compiler:** inherit param types when class has a constructor which takes no declared parameters and delegates up ([#29232](https://github.com/angular/angular/issues/29232)) ([0007564](https://github.com/angular/angular/commit/0007564))
|
||||||
@ -2217,7 +2170,7 @@ To learn about the release highlights and our CLI-powered automated update workf
|
|||||||
* **platform-server:** update minimum domino version to latest released ([#28893](https://github.com/angular/angular/issues/28893)) ([79e2ca0](https://github.com/angular/angular/commit/79e2ca0))
|
* **platform-server:** update minimum domino version to latest released ([#28893](https://github.com/angular/angular/issues/28893)) ([79e2ca0](https://github.com/angular/angular/commit/79e2ca0))
|
||||||
* **router:** removed obsolete TODO comment ([#29085](https://github.com/angular/angular/issues/29085)) ([72ecc45](https://github.com/angular/angular/commit/72ecc45))
|
* **router:** removed obsolete TODO comment ([#29085](https://github.com/angular/angular/issues/29085)) ([72ecc45](https://github.com/angular/angular/commit/72ecc45))
|
||||||
* **service-worker:** detect new version even if files are identical to an old one ([#26006](https://github.com/angular/angular/issues/26006)) ([586234b](https://github.com/angular/angular/commit/586234b)), closes [#24338](https://github.com/angular/angular/issues/24338)
|
* **service-worker:** detect new version even if files are identical to an old one ([#26006](https://github.com/angular/angular/issues/26006)) ([586234b](https://github.com/angular/angular/commit/586234b)), closes [#24338](https://github.com/angular/angular/issues/24338)
|
||||||
* **service-worker:** ignore passive mixed content requests ([#25994](https://github.com/angular/angular/issues/25994)) ([48214e2](https://github.com/angular/angular/commit/48214e2)), closes [/github.com/angular/angular/issues/23012#issuecomment-376430187](https://github.com/angular/angular/issues/23012/issues/issuecomment-376430187) [#23012](https://github.com/angular/angular/issues/23012)
|
* **service-worker:** ignore passive mixed content requests ([#25994](https://github.com/angular/angular/issues/25994)) ([48214e2](https://github.com/angular/angular/commit/48214e2)), closes [23012#issuecomment-376430187](https://github.com/angular/angular/issues/23012#issuecomment-376430187) [#23012](https://github.com/angular/angular/issues/23012)
|
||||||
* **bazel:** Pin browsers for schematics ([#28913](https://github.com/angular/angular/issues/28913)) ([1145bdb](https://github.com/angular/angular/commit/1145bdb))
|
* **bazel:** Pin browsers for schematics ([#28913](https://github.com/angular/angular/issues/28913)) ([1145bdb](https://github.com/angular/angular/commit/1145bdb))
|
||||||
* **bazel:** rxjs_umd_modules should always be present ([#28881](https://github.com/angular/angular/issues/28881)) ([9ae14db](https://github.com/angular/angular/commit/9ae14db))
|
* **bazel:** rxjs_umd_modules should always be present ([#28881](https://github.com/angular/angular/issues/28881)) ([9ae14db](https://github.com/angular/angular/commit/9ae14db))
|
||||||
* **compiler:** use correct variable in invalid function ([#28656](https://github.com/angular/angular/issues/28656)) ([f75acbd](https://github.com/angular/angular/commit/f75acbd))
|
* **compiler:** use correct variable in invalid function ([#28656](https://github.com/angular/angular/issues/28656)) ([f75acbd](https://github.com/angular/angular/commit/f75acbd))
|
||||||
@ -2279,6 +2232,7 @@ To learn about the release highlights and our CLI-powered automated update workf
|
|||||||
|
|
||||||
* **core:** deprecate integration with the Web Tracing Framework (WTF) ([#30642](https://github.com/angular/angular/issues/30642)) ([b408445](https://github.com/angular/angular/commit/b408445))
|
* **core:** deprecate integration with the Web Tracing Framework (WTF) ([#30642](https://github.com/angular/angular/issues/30642)) ([b408445](https://github.com/angular/angular/commit/b408445))
|
||||||
* **platform-webworker:** deprecate platform-webworker ([#30642](https://github.com/angular/angular/issues/30642)) ([361f181](https://github.com/angular/angular/commit/361f181))
|
* **platform-webworker:** deprecate platform-webworker ([#30642](https://github.com/angular/angular/issues/30642)) ([361f181](https://github.com/angular/angular/commit/361f181))
|
||||||
|
* `TestBed.get()` has two signatures, one which is typed and another which accepts and returns `any`. The signature for `any` is deprecated; all usage of `TestBed.get()` should go through the typed API. This mainly affects string tokens
|
||||||
(which aren't supported) and abstract class tokens.
|
(which aren't supported) and abstract class tokens.
|
||||||
|
|
||||||
Before:
|
Before:
|
||||||
@ -2431,7 +2385,7 @@ This release contains various API docs improvements.
|
|||||||
* **animations:** ensure `position` and `display` styles are handled outside of keyframes/web-animations ([#28911](https://github.com/angular/angular/issues/28911)) ([86981b3](https://github.com/angular/angular/commit/86981b3)), closes [#24923](https://github.com/angular/angular/issues/24923) [#25635](https://github.com/angular/angular/issues/25635)
|
* **animations:** ensure `position` and `display` styles are handled outside of keyframes/web-animations ([#28911](https://github.com/angular/angular/issues/28911)) ([86981b3](https://github.com/angular/angular/commit/86981b3)), closes [#24923](https://github.com/angular/angular/issues/24923) [#25635](https://github.com/angular/angular/issues/25635)
|
||||||
* **router:** removed obsolete TODO comment ([#29085](https://github.com/angular/angular/issues/29085)) ([2a25ac2](https://github.com/angular/angular/commit/2a25ac2))
|
* **router:** removed obsolete TODO comment ([#29085](https://github.com/angular/angular/issues/29085)) ([2a25ac2](https://github.com/angular/angular/commit/2a25ac2))
|
||||||
* **service-worker:** detect new version even if files are identical to an old one ([#26006](https://github.com/angular/angular/issues/26006)) ([5669333](https://github.com/angular/angular/commit/5669333)), closes [#24338](https://github.com/angular/angular/issues/24338)
|
* **service-worker:** detect new version even if files are identical to an old one ([#26006](https://github.com/angular/angular/issues/26006)) ([5669333](https://github.com/angular/angular/commit/5669333)), closes [#24338](https://github.com/angular/angular/issues/24338)
|
||||||
* **service-worker:** ignore passive mixed content requests ([#25994](https://github.com/angular/angular/issues/25994)) ([b598e88](https://github.com/angular/angular/commit/b598e88)), closes [/github.com/angular/angular/issues/23012#issuecomment-376430187](https://github.com/angular/angular/issues/23012/issues/issuecomment-376430187) [#23012](https://github.com/angular/angular/issues/23012)
|
* **service-worker:** ignore passive mixed content requests ([#25994](https://github.com/angular/angular/issues/25994)) ([b598e88](https://github.com/angular/angular/commit/b598e88)), closes [23012#issuecomment-376430187](https://github.com/angular/angular/issues/23012#issuecomment-376430187) [#23012](https://github.com/angular/angular/issues/23012)
|
||||||
|
|
||||||
|
|
||||||
<a name="7.2.7"></a>
|
<a name="7.2.7"></a>
|
||||||
@ -2527,6 +2481,14 @@ This release contains various API docs improvements.
|
|||||||
# [8.0.0-beta.0](https://github.com/angular/angular/compare/7.2.0...8.0.0-beta.0) (2019-01-16)
|
# [8.0.0-beta.0](https://github.com/angular/angular/compare/7.2.0...8.0.0-beta.0) (2019-01-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|
||||||
|
|
||||||
@ -2674,9 +2636,42 @@ This release contains various API docs improvements.
|
|||||||
# [7.1.0](https://github.com/angular/angular/compare/7.1.0-rc.0...7.1.0) (2018-11-21)
|
# [7.1.0](https://github.com/angular/angular/compare/7.1.0-rc.0...7.1.0) (2018-11-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **core:** allow null value for renderer setElement(…) ([#17065](https://github.com/angular/angular/issues/17065)) ([ff15043](https://github.com/angular/angular/commit/ff15043)), closes [#13686](https://github.com/angular/angular/issues/13686)
|
||||||
|
* **router:** fix regression where navigateByUrl promise didn't resolve on CanLoad failure ([#26455](https://github.com/angular/angular/issues/26455)) ([1c9b065](https://github.com/angular/angular/commit/1c9b065)), closes [#26284](https://github.com/angular/angular/issues/26284)
|
||||||
|
* **service-worker:** clean up caches from old SW versions ([#26319](https://github.com/angular/angular/issues/26319)) ([2326b9c](https://github.com/angular/angular/commit/2326b9c))
|
||||||
|
* **upgrade:** properly destroy upgraded component elements and descendants ([#26209](https://github.com/angular/angular/issues/26209)) ([071934e](https://github.com/angular/angular/commit/071934e)), closes [#26208](https://github.com/angular/angular/issues/26208)
|
||||||
|
* **compiler:** generate inputs with aliases properly ([#26774](https://github.com/angular/angular/issues/26774)) ([19fcfc3](https://github.com/angular/angular/commit/19fcfc3))
|
||||||
|
* **compiler:** generate relative paths only in summary file errors ([#26759](https://github.com/angular/angular/issues/26759)) ([56f44be](https://github.com/angular/angular/commit/56f44be))
|
||||||
|
* **core:** ignore comment nodes under unsafe elements ([#25879](https://github.com/angular/angular/issues/25879)) ([d5cbcef](https://github.com/angular/angular/commit/d5cbcef))
|
||||||
|
* **core:** Remove static dependency from @angular/core to @angular/compiler ([#26734](https://github.com/angular/angular/issues/26734)) ([d042c4a](https://github.com/angular/angular/commit/d042c4a))
|
||||||
|
* **core:** support computed base class in metadata inheritance ([#24014](https://github.com/angular/angular/issues/24014)) ([95743e3](https://github.com/angular/angular/commit/95743e3))
|
||||||
|
* **bazel:** unknown replay compiler error in windows ([#26711](https://github.com/angular/angular/issues/26711)) ([aed95fd](https://github.com/angular/angular/commit/aed95fd))
|
||||||
|
* **core:** ensure that `ɵdefineNgModule` is available in flat-file formats ([#26403](https://github.com/angular/angular/issues/26403)) ([a64859b](https://github.com/angular/angular/commit/a64859b))
|
||||||
|
* **router:** remove type bludgeoning of context and outlet when running CanDeactivate ([#26496](https://github.com/angular/angular/issues/26496)) ([496372d](https://github.com/angular/angular/commit/496372d)), closes [#18253](https://github.com/angular/angular/issues/18253)
|
||||||
|
* **service-worker:** add typing to public api guard and fix lint errors ([#25860](https://github.com/angular/angular/issues/25860)) ([1061875](https://github.com/angular/angular/commit/1061875))
|
||||||
|
* **upgrade:** improve downgrading-related error messages ([#26217](https://github.com/angular/angular/issues/26217)) ([7dbc103](https://github.com/angular/angular/commit/7dbc103))
|
||||||
|
* **upgrade:** make typings compatible with older AngularJS typings ([#26880](https://github.com/angular/angular/issues/26880)) ([64647af](https://github.com/angular/angular/commit/64647af)), closes [#26420](https://github.com/angular/angular/issues/26420)
|
||||||
|
* **compiler-cli:** add missing tslib dependency ([#27063](https://github.com/angular/angular/issues/27063)) ([c31e78f](https://github.com/angular/angular/commit/c31e78f))
|
||||||
|
* **compiler-cli:** only pass canonical genfile paths to compiler host ([#27062](https://github.com/angular/angular/issues/27062)) ([0ada23a](https://github.com/angular/angular/commit/0ada23a))
|
||||||
|
* **router:** add `relativeLinkResolution` to `recognize` operator ([#26990](https://github.com/angular/angular/issues/26990)) ([a752971](https://github.com/angular/angular/commit/a752971)), closes [#26983](https://github.com/angular/angular/issues/26983)
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* **bazel:** Bazel workspace schematics ([#26971](https://github.com/angular/angular/issues/26971)) ([b07bd30](https://github.com/angular/angular/commit/b07bd30))
|
* **bazel:** Bazel workspace schematics ([#26971](https://github.com/angular/angular/issues/26971)) ([b07bd30](https://github.com/angular/angular/commit/b07bd30))
|
||||||
|
* **router:** add prioritizedGuardValue operator optimization and allowing UrlTree return from guard ([#26478](https://github.com/angular/angular/issues/26478)) ([fdfedce](https://github.com/angular/angular/commit/fdfedce))
|
||||||
|
* **compiler:** ability to mark an InvokeFunctionExpr as pure ([#26860](https://github.com/angular/angular/issues/26860)) ([4dfa71f](https://github.com/angular/angular/commit/4dfa71f))
|
||||||
|
* **forms:** add updateOn option to FormBuilder ([#24599](https://github.com/angular/angular/issues/24599)) ([e9e804f](https://github.com/angular/angular/commit/e9e804f))
|
||||||
|
* **router:** allow guards to return UrlTree as well as boolean ([#26521](https://github.com/angular/angular/issues/26521)) ([081f95c](https://github.com/angular/angular/commit/081f95c))
|
||||||
|
* **router:** allow redirect from guards by returning UrlTree ([#26521](https://github.com/angular/angular/issues/26521)) ([152ca66](https://github.com/angular/angular/commit/152ca66))
|
||||||
|
* **router:** guard returning UrlTree cancels current navigation and redirects ([#26521](https://github.com/angular/angular/issues/26521)) ([4e9f2e5](https://github.com/angular/angular/commit/4e9f2e5)), closes [#24618](https://github.com/angular/angular/issues/24618)
|
||||||
|
* **service-worker:** add typing for messagesClicked in SwPush service ([#25860](https://github.com/angular/angular/issues/25860)) ([c78c221](https://github.com/angular/angular/commit/c78c221))
|
||||||
|
* **service-worker:** close notifications and focus window on click ([#25860](https://github.com/angular/angular/issues/25860)) ([f5d5a3d](https://github.com/angular/angular/commit/f5d5a3d))
|
||||||
|
* **service-worker:** handle 'notificationclick' events ([#25860](https://github.com/angular/angular/issues/25860)) ([cf6ea28](https://github.com/angular/angular/commit/cf6ea28)), closes [#20956](https://github.com/angular/angular/issues/20956) [#22311](https://github.com/angular/angular/issues/22311)
|
||||||
|
* **upgrade:** support downgrading multiple modules ([#26217](https://github.com/angular/angular/issues/26217)) ([93837e9](https://github.com/angular/angular/commit/93837e9)), closes [#26062](https://github.com/angular/angular/issues/26062)
|
||||||
|
* **router:** add pathParamsChange mode for runGuardsAndResolvers ([#26861](https://github.com/angular/angular/issues/26861)) ([bf6ac6c](https://github.com/angular/angular/commit/bf6ac6c)), closes [#18253](https://github.com/angular/angular/issues/18253)
|
||||||
|
|
||||||
|
|
||||||
<a name="7.1.0-rc.0"></a>
|
<a name="7.1.0-rc.0"></a>
|
||||||
@ -2779,7 +2774,10 @@ This release contains various API docs improvements.
|
|||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
* **core:** allow null value for renderer setElement(…) ([#17065](https://github.com/angular/angular/issues/17065)) ([ff15043](https://github.com/angular/angular/commit/ff15043)), closes [#13686](https://github.com/angular/angular/issues/13686)
|
||||||
|
* **router:** fix regression where navigateByUrl promise didn't resolve on CanLoad failure ([#26455](https://github.com/angular/angular/issues/26455)) ([1c9b065](https://github.com/angular/angular/commit/1c9b065)), closes [#26284](https://github.com/angular/angular/issues/26284)
|
||||||
* **service-worker:** clean up caches from old SW versions ([#26319](https://github.com/angular/angular/issues/26319)) ([2326b9c](https://github.com/angular/angular/commit/2326b9c))
|
* **service-worker:** clean up caches from old SW versions ([#26319](https://github.com/angular/angular/issues/26319)) ([2326b9c](https://github.com/angular/angular/commit/2326b9c))
|
||||||
|
* **upgrade:** properly destroy upgraded component elements and descendants ([#26209](https://github.com/angular/angular/issues/26209)) ([071934e](https://github.com/angular/angular/commit/071934e)), closes [#26208](https://github.com/angular/angular/issues/26208)
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
@ -2951,6 +2949,7 @@ Note: the 6.1.5 release on npm accidentally glitched-out midway, so we cut 6.1.6
|
|||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **animations:** always render end-state styles for orphaned DOM nodes ([#24236](https://github.com/angular/angular/issues/24236)) ([dc4a3d0](https://github.com/angular/angular/commit/dc4a3d0))
|
* **animations:** always render end-state styles for orphaned DOM nodes ([#24236](https://github.com/angular/angular/issues/24236)) ([dc4a3d0](https://github.com/angular/angular/commit/dc4a3d0))
|
||||||
|
* **animations:** set animations styles properly on platform-server ([#24624](https://github.com/angular/angular/issues/24624)) ([0b356d4](https://github.com/angular/angular/commit/0b356d4))
|
||||||
* **animations:** do not throw errors when a destroyed component is animated ([#23836](https://github.com/angular/angular/issues/23836)) ([d2a8687](https://github.com/angular/angular/commit/d2a8687))
|
* **animations:** do not throw errors when a destroyed component is animated ([#23836](https://github.com/angular/angular/issues/23836)) ([d2a8687](https://github.com/angular/angular/commit/d2a8687))
|
||||||
* **animations:** Fix browser detection logic ([#24188](https://github.com/angular/angular/issues/24188)) ([b492b9e](https://github.com/angular/angular/commit/b492b9e))
|
* **animations:** Fix browser detection logic ([#24188](https://github.com/angular/angular/issues/24188)) ([b492b9e](https://github.com/angular/angular/commit/b492b9e))
|
||||||
* **animations:** properly clean up queried element styles in safari/edge ([#23633](https://github.com/angular/angular/issues/23633)) ([da9ff25](https://github.com/angular/angular/commit/da9ff25))
|
* **animations:** properly clean up queried element styles in safari/edge ([#23633](https://github.com/angular/angular/issues/23633)) ([da9ff25](https://github.com/angular/angular/commit/da9ff25))
|
||||||
@ -2962,6 +2961,7 @@ Note: the 6.1.5 release on npm accidentally glitched-out midway, so we cut 6.1.6
|
|||||||
* **common:** format fractional seconds ([#24844](https://github.com/angular/angular/issues/24844)) ([0b4d85e](https://github.com/angular/angular/commit/0b4d85e)), closes [#24831](https://github.com/angular/angular/issues/24831)
|
* **common:** format fractional seconds ([#24844](https://github.com/angular/angular/issues/24844)) ([0b4d85e](https://github.com/angular/angular/commit/0b4d85e)), closes [#24831](https://github.com/angular/angular/issues/24831)
|
||||||
* **common:** properly update collection reference in NgForOf ([#24684](https://github.com/angular/angular/issues/24684)) ([ff84c5c](https://github.com/angular/angular/commit/ff84c5c)), closes [#24155](https://github.com/angular/angular/issues/24155)
|
* **common:** properly update collection reference in NgForOf ([#24684](https://github.com/angular/angular/issues/24684)) ([ff84c5c](https://github.com/angular/angular/commit/ff84c5c)), closes [#24155](https://github.com/angular/angular/issues/24155)
|
||||||
* **common:** use correct currency format for locale de-AT ([#24658](https://github.com/angular/angular/issues/24658)) ([dcabb05](https://github.com/angular/angular/commit/dcabb05)), closes [#24609](https://github.com/angular/angular/issues/24609)
|
* **common:** use correct currency format for locale de-AT ([#24658](https://github.com/angular/angular/issues/24658)) ([dcabb05](https://github.com/angular/angular/commit/dcabb05)), closes [#24609](https://github.com/angular/angular/issues/24609)
|
||||||
|
* **common:** use correct ICU plural for locale mk ([#24659](https://github.com/angular/angular/issues/24659)) ([64a8584](https://github.com/angular/angular/commit/64a8584))
|
||||||
* **compiler:** fix a few non-tree-shakeable code patterns ([#24677](https://github.com/angular/angular/issues/24677)) ([50d4a4f](https://github.com/angular/angular/commit/50d4a4f))
|
* **compiler:** fix a few non-tree-shakeable code patterns ([#24677](https://github.com/angular/angular/issues/24677)) ([50d4a4f](https://github.com/angular/angular/commit/50d4a4f))
|
||||||
* **compiler:** i18n_extractor now outputs the correct source file name ([#24885](https://github.com/angular/angular/issues/24885)) ([c8ad965](https://github.com/angular/angular/commit/c8ad965)), closes [#24884](https://github.com/angular/angular/issues/24884)
|
* **compiler:** i18n_extractor now outputs the correct source file name ([#24885](https://github.com/angular/angular/issues/24885)) ([c8ad965](https://github.com/angular/angular/commit/c8ad965)), closes [#24884](https://github.com/angular/angular/issues/24884)
|
||||||
* **compiler:** support `.` in import statements. ([#20634](https://github.com/angular/angular/issues/20634)) ([d8f7b29](https://github.com/angular/angular/commit/d8f7b29)), closes [#20363](https://github.com/angular/angular/issues/20363)
|
* **compiler:** support `.` in import statements. ([#20634](https://github.com/angular/angular/issues/20634)) ([d8f7b29](https://github.com/angular/angular/commit/d8f7b29)), closes [#20363](https://github.com/angular/angular/issues/20363)
|
||||||
@ -2997,6 +2997,7 @@ Note: the 6.1.5 release on npm accidentally glitched-out midway, so we cut 6.1.6
|
|||||||
* **service-worker:** don't include sourceMappingURL in ngsw-worker ([#24877](https://github.com/angular/angular/issues/24877)) ([8620373](https://github.com/angular/angular/commit/8620373)), closes [#23596](https://github.com/angular/angular/issues/23596)
|
* **service-worker:** don't include sourceMappingURL in ngsw-worker ([#24877](https://github.com/angular/angular/issues/24877)) ([8620373](https://github.com/angular/angular/commit/8620373)), closes [#23596](https://github.com/angular/angular/issues/23596)
|
||||||
* **service-worker:** avoid network requests when looking up hashed resources in cache ([#24127](https://github.com/angular/angular/issues/24127)) ([52d43a9](https://github.com/angular/angular/commit/52d43a9))
|
* **service-worker:** avoid network requests when looking up hashed resources in cache ([#24127](https://github.com/angular/angular/issues/24127)) ([52d43a9](https://github.com/angular/angular/commit/52d43a9))
|
||||||
* **service-worker:** fix `SwPush.unsubscribe()` ([#24162](https://github.com/angular/angular/issues/24162)) ([3ed2d75](https://github.com/angular/angular/commit/3ed2d75)), closes [#24095](https://github.com/angular/angular/issues/24095)
|
* **service-worker:** fix `SwPush.unsubscribe()` ([#24162](https://github.com/angular/angular/issues/24162)) ([3ed2d75](https://github.com/angular/angular/commit/3ed2d75)), closes [#24095](https://github.com/angular/angular/issues/24095)
|
||||||
|
* **service-worker:** add badge to NOTIFICATION_OPTION_NAMES ([#23241](https://github.com/angular/angular/issues/23241)) ([fb59b2d](https://github.com/angular/angular/commit/fb59b2d)), closes [#23196](https://github.com/angular/angular/issues/23196)
|
||||||
* **service-worker:** check platformBrowser before accessing navigator.serviceWorker ([#21231](https://github.com/angular/angular/issues/21231)) ([0bdd30e](https://github.com/angular/angular/commit/0bdd30e))
|
* **service-worker:** check platformBrowser before accessing navigator.serviceWorker ([#21231](https://github.com/angular/angular/issues/21231)) ([0bdd30e](https://github.com/angular/angular/commit/0bdd30e))
|
||||||
* **service-worker:** correctly handle requests with empty `clientId` ([#23625](https://github.com/angular/angular/issues/23625)) ([e0ed59e](https://github.com/angular/angular/commit/e0ed59e)), closes [#23526](https://github.com/angular/angular/issues/23526)
|
* **service-worker:** correctly handle requests with empty `clientId` ([#23625](https://github.com/angular/angular/issues/23625)) ([e0ed59e](https://github.com/angular/angular/commit/e0ed59e)), closes [#23526](https://github.com/angular/angular/issues/23526)
|
||||||
* **service-worker:** deprecate `versionedFiles` in asset-group resources ([#23584](https://github.com/angular/angular/issues/23584)) ([1d378e2](https://github.com/angular/angular/commit/1d378e2))
|
* **service-worker:** deprecate `versionedFiles` in asset-group resources ([#23584](https://github.com/angular/angular/issues/23584)) ([1d378e2](https://github.com/angular/angular/commit/1d378e2))
|
||||||
@ -3197,6 +3198,8 @@ To learn about the release highlights and our new CLI-powered update workflow fo
|
|||||||
* **forms:** multiple validators for array method ([#20766](https://github.com/angular/angular/issues/20766)) ([941e88f](https://github.com/angular/angular/commit/941e88f)), closes [#20665](https://github.com/angular/angular/issues/20665)
|
* **forms:** multiple validators for array method ([#20766](https://github.com/angular/angular/issues/20766)) ([941e88f](https://github.com/angular/angular/commit/941e88f)), closes [#20665](https://github.com/angular/angular/issues/20665)
|
||||||
* **forms:** allow markAsPending to emit events ([#20212](https://github.com/angular/angular/issues/20212)) ([e86b64b](https://github.com/angular/angular/commit/e86b64b)), closes [#17958](https://github.com/angular/angular/issues/17958)
|
* **forms:** allow markAsPending to emit events ([#20212](https://github.com/angular/angular/issues/20212)) ([e86b64b](https://github.com/angular/angular/commit/e86b64b)), closes [#17958](https://github.com/angular/angular/issues/17958)
|
||||||
* **platform-browser:** add token marking which the type of animation module nearest in the injector tree ([#23075](https://github.com/angular/angular/issues/23075)) ([b551f84](https://github.com/angular/angular/commit/b551f84))
|
* **platform-browser:** add token marking which the type of animation module nearest in the injector tree ([#23075](https://github.com/angular/angular/issues/23075)) ([b551f84](https://github.com/angular/angular/commit/b551f84))
|
||||||
|
* **platform-browser:** do not throw error when Hammer.js not loaded ([#22257](https://github.com/angular/angular/issues/22257)) ([991300b](https://github.com/angular/angular/commit/991300b)), closes [#16992](https://github.com/angular/angular/issues/16992)
|
||||||
|
* **platform-browser:** fix [#19604](https://github.com/angular/angular/issues/19604), can config hammerOptions ([#21979](https://github.com/angular/angular/issues/21979)) ([1d571b2](https://github.com/angular/angular/commit/1d571b2))
|
||||||
* **platform-server:** bump Domino to v2.0 ([#22411](https://github.com/angular/angular/issues/22411)) ([d3827a0](https://github.com/angular/angular/commit/d3827a0))
|
* **platform-server:** bump Domino to v2.0 ([#22411](https://github.com/angular/angular/issues/22411)) ([d3827a0](https://github.com/angular/angular/commit/d3827a0))
|
||||||
* **router:** add navigationSource and restoredState to NavigationStart event ([#21728](https://github.com/angular/angular/issues/21728)) ([c40ae7f](https://github.com/angular/angular/commit/c40ae7f))
|
* **router:** add navigationSource and restoredState to NavigationStart event ([#21728](https://github.com/angular/angular/issues/21728)) ([c40ae7f](https://github.com/angular/angular/commit/c40ae7f))
|
||||||
* **service-worker:** add support for configuring navigations URLs ([#23339](https://github.com/angular/angular/issues/23339)) ([08325aa](https://github.com/angular/angular/commit/08325aa)), closes [#20404](https://github.com/angular/angular/issues/20404)
|
* **service-worker:** add support for configuring navigations URLs ([#23339](https://github.com/angular/angular/issues/23339)) ([08325aa](https://github.com/angular/angular/commit/08325aa)), closes [#20404](https://github.com/angular/angular/issues/20404)
|
||||||
@ -3415,7 +3418,12 @@ To learn about the release highlights and our new CLI-powered update workflow fo
|
|||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **platform-server:** generate correct stylings for camel case names ([#22263](https://github.com/angular/angular/issues/22263)) ([de02a7a](https://github.com/angular/angular/commit/de02a7a)), closes [#19235](https://github.com/angular/angular/issues/19235)
|
||||||
|
* **router:** don't mutate route configs ([#22358](https://github.com/angular/angular/issues/22358)) ([8f0a064](https://github.com/angular/angular/commit/8f0a064)), closes [#22203](https://github.com/angular/angular/issues/22203)
|
||||||
* **router:** fix URL serialization so special characters are only encoded where needed ([#22337](https://github.com/angular/angular/issues/22337)) ([789a47e](https://github.com/angular/angular/commit/789a47e)), closes [#10280](https://github.com/angular/angular/issues/10280)
|
* **router:** fix URL serialization so special characters are only encoded where needed ([#22337](https://github.com/angular/angular/issues/22337)) ([789a47e](https://github.com/angular/angular/commit/789a47e)), closes [#10280](https://github.com/angular/angular/issues/10280)
|
||||||
|
* **upgrade:** correctly destroy nested downgraded component ([#22400](https://github.com/angular/angular/issues/22400)) ([4aef9de](https://github.com/angular/angular/commit/4aef9de)), closes [#22392](https://github.com/angular/angular/issues/22392)
|
||||||
|
* **upgrade:** correctly handle `=` bindings in `@angular/upgrade` ([#22167](https://github.com/angular/angular/issues/22167)) ([6638390](https://github.com/angular/angular/commit/6638390))
|
||||||
|
* **upgrade:** fix empty transclusion content with AngularJS@>=1.5.8 ([#22167](https://github.com/angular/angular/issues/22167)) ([a9a0e27](https://github.com/angular/angular/commit/a9a0e27)), closes [#22175](https://github.com/angular/angular/issues/22175)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -3810,6 +3818,15 @@ Note: Due to an animation fix back in 5.1.1 ([c2b3792](https://github.com/angula
|
|||||||
<a name="5.1.0-beta.0"></a>
|
<a name="5.1.0-beta.0"></a>
|
||||||
# [5.1.0-beta.0](https://github.com/angular/angular/compare/5.0.0-rc.4...5.1.0-beta.0) (2017-11-08)
|
# [5.1.0-beta.0](https://github.com/angular/angular/compare/5.0.0-rc.4...5.1.0-beta.0) (2017-11-08)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **compiler:** don't overwrite missingTranslation's value in JIT ([#19952](https://github.com/angular/angular/issues/19952)) ([799cbb9](https://github.com/angular/angular/commit/799cbb9))
|
||||||
|
* **compiler:** report a reasonable error with invalid metadata ([#20062](https://github.com/angular/angular/issues/20062)) ([da22c48](https://github.com/angular/angular/commit/da22c48))
|
||||||
|
* **compiler-cli:** don't report emit diagnostics when `--noEmitOnError` is off ([#20063](https://github.com/angular/angular/issues/20063)) ([8639995](https://github.com/angular/angular/commit/8639995))
|
||||||
|
* **core:** `__symbol__` should return `__zone_symbol__` without zone.js loaded ([#19541](https://github.com/angular/angular/issues/19541)) ([678d1cf](https://github.com/angular/angular/commit/678d1cf))
|
||||||
|
* **core:** should support event.stopImmediatePropagation ([#19222](https://github.com/angular/angular/issues/19222)) ([7083791](https://github.com/angular/angular/commit/7083791))
|
||||||
|
* **platform-browser:** support Symbols in custom `jasmineToString()` method ([#19794](https://github.com/angular/angular/issues/19794)) ([5a6efa7](https://github.com/angular/angular/commit/5a6efa7))
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* **compiler:** introduce `TestBed.overrideTemplateUsingTestingModule` ([a460066](https://github.com/angular/angular/commit/a460066)), closes [#19815](https://github.com/angular/angular/issues/19815)
|
* **compiler:** introduce `TestBed.overrideTemplateUsingTestingModule` ([a460066](https://github.com/angular/angular/commit/a460066)), closes [#19815](https://github.com/angular/angular/issues/19815)
|
||||||
@ -3845,12 +3862,14 @@ Note: Due to an animation fix back in 5.1.1 ([c2b3792](https://github.com/angula
|
|||||||
* **compiler-cli:** add watch mode to `ngc` ([#18818](https://github.com/angular/angular/issues/18818)) ([06d01b2](https://github.com/angular/angular/commit/06d01b2))
|
* **compiler-cli:** add watch mode to `ngc` ([#18818](https://github.com/angular/angular/issues/18818)) ([06d01b2](https://github.com/angular/angular/commit/06d01b2))
|
||||||
* **compiler-cli:** lower metadata `useValue` and `data` literal fields ([#18905](https://github.com/angular/angular/issues/18905)) ([0e64261](https://github.com/angular/angular/commit/0e64261))
|
* **compiler-cli:** lower metadata `useValue` and `data` literal fields ([#18905](https://github.com/angular/angular/issues/18905)) ([0e64261](https://github.com/angular/angular/commit/0e64261))
|
||||||
* **compiler:** add representation of placeholders to xliff & xmb ([b3085e9](https://github.com/angular/angular/commit/b3085e9)), closes [#17345](https://github.com/angular/angular/issues/17345)
|
* **compiler:** add representation of placeholders to xliff & xmb ([b3085e9](https://github.com/angular/angular/commit/b3085e9)), closes [#17345](https://github.com/angular/angular/issues/17345)
|
||||||
|
* **compiler:** allow multiple exportAs names ([#18723](https://github.com/angular/angular/issues/18723)) ([7ec28fe](https://github.com/angular/angular/commit/7ec28fe))
|
||||||
* **compiler:** enabled strict checking of parameters to an `@Injectable` ([#19412](https://github.com/angular/angular/issues/19412)) ([dfb8d21](https://github.com/angular/angular/commit/dfb8d21))
|
* **compiler:** enabled strict checking of parameters to an `@Injectable` ([#19412](https://github.com/angular/angular/issues/19412)) ([dfb8d21](https://github.com/angular/angular/commit/dfb8d21))
|
||||||
* **compiler:** make `.ngsummary.json` files portable ([2572bf5](https://github.com/angular/angular/commit/2572bf5))
|
* **compiler:** make `.ngsummary.json` files portable ([2572bf5](https://github.com/angular/angular/commit/2572bf5))
|
||||||
* **compiler:** reuse the TypeScript typecheck for template typechecking. ([#19152](https://github.com/angular/angular/issues/19152)) ([996c7c2](https://github.com/angular/angular/commit/996c7c2))
|
* **compiler:** reuse the TypeScript typecheck for template typechecking. ([#19152](https://github.com/angular/angular/issues/19152)) ([996c7c2](https://github.com/angular/angular/commit/996c7c2))
|
||||||
* **compiler:** set `enableLegacyTemplate` to false by default ([#18756](https://github.com/angular/angular/issues/18756)) ([56238fe](https://github.com/angular/angular/commit/56238fe))
|
* **compiler:** set `enableLegacyTemplate` to false by default ([#18756](https://github.com/angular/angular/issues/18756)) ([56238fe](https://github.com/angular/angular/commit/56238fe))
|
||||||
* **compiler:** use typescript for resolving resource paths ([43226cb](https://github.com/angular/angular/commit/43226cb))
|
* **compiler:** use typescript for resolving resource paths ([43226cb](https://github.com/angular/angular/commit/43226cb))
|
||||||
* **core:** Create StaticInjector which does not depend on Reflect polyfill. ([d9d00bd](https://github.com/angular/angular/commit/d9d00bd))
|
* **core:** Create StaticInjector which does not depend on Reflect polyfill. ([d9d00bd](https://github.com/angular/angular/commit/d9d00bd))
|
||||||
|
* **core:** add option to remove blank text nodes from compiled templates ([#18823](https://github.com/angular/angular/issues/18823)) ([b8b551c](https://github.com/angular/angular/commit/b8b551c))
|
||||||
* **core:** support for bootstrap with custom zone ([#17672](https://github.com/angular/angular/issues/17672)) ([344a5ca](https://github.com/angular/angular/commit/344a5ca))
|
* **core:** support for bootstrap with custom zone ([#17672](https://github.com/angular/angular/issues/17672)) ([344a5ca](https://github.com/angular/angular/commit/344a5ca))
|
||||||
* **forms:** add default updateOn values for groups and arrays ([#18536](https://github.com/angular/angular/issues/18536)) ([ff5c58b](https://github.com/angular/angular/commit/ff5c58b))
|
* **forms:** add default updateOn values for groups and arrays ([#18536](https://github.com/angular/angular/issues/18536)) ([ff5c58b](https://github.com/angular/angular/commit/ff5c58b))
|
||||||
* **forms:** add options arg to abstract controls ([ebef5e6](https://github.com/angular/angular/commit/ebef5e6))
|
* **forms:** add options arg to abstract controls ([ebef5e6](https://github.com/angular/angular/commit/ebef5e6))
|
||||||
@ -4209,6 +4228,7 @@ Note: the 4.4.0 release on npm accidentally glitched-out midway, so we cut 4.4.1
|
|||||||
* **animations:** properly collect :enter nodes that exist within multi-level DOM trees ([40f77cb](https://github.com/angular/angular/commit/40f77cb)), closes [#17632](https://github.com/angular/angular/issues/17632)
|
* **animations:** properly collect :enter nodes that exist within multi-level DOM trees ([40f77cb](https://github.com/angular/angular/commit/40f77cb)), closes [#17632](https://github.com/angular/angular/issues/17632)
|
||||||
* **animations:** compute removal node height correctly ([185075d](https://github.com/angular/angular/commit/185075d))
|
* **animations:** compute removal node height correctly ([185075d](https://github.com/angular/angular/commit/185075d))
|
||||||
* **animations:** do not treat a `0` animation state as `void` ([451257a](https://github.com/angular/angular/commit/451257a))
|
* **animations:** do not treat a `0` animation state as `void` ([451257a](https://github.com/angular/angular/commit/451257a))
|
||||||
|
* **animations:** properly collect :enter nodes in a partially updated collection ([6ca4692](https://github.com/angular/angular/commit/6ca4692)), closes [#17440](https://github.com/angular/angular/issues/17440)
|
||||||
* **animations:** remove duplicate license header ([e096a85](https://github.com/angular/angular/commit/e096a85))
|
* **animations:** remove duplicate license header ([e096a85](https://github.com/angular/angular/commit/e096a85))
|
||||||
* **common/http:** document HttpClient, fixing a few other issues ([1855989](https://github.com/angular/angular/commit/1855989))
|
* **common/http:** document HttpClient, fixing a few other issues ([1855989](https://github.com/angular/angular/commit/1855989))
|
||||||
* **common/http:** don't guess Content-Type for FormData bodies ([#18104](https://github.com/angular/angular/issues/18104)) ([4f1e4ff](https://github.com/angular/angular/commit/4f1e4ff)), closes [#18096](https://github.com/angular/angular/issues/18096)
|
* **common/http:** don't guess Content-Type for FormData bodies ([#18104](https://github.com/angular/angular/issues/18104)) ([4f1e4ff](https://github.com/angular/angular/commit/4f1e4ff)), closes [#18096](https://github.com/angular/angular/issues/18096)
|
||||||
@ -4317,6 +4337,7 @@ Note: the 4.4.0 release on npm accidentally glitched-out midway, so we cut 4.4.1
|
|||||||
|
|
||||||
* **animations:** compute removal node height correctly ([185075d](https://github.com/angular/angular/commit/185075d))
|
* **animations:** compute removal node height correctly ([185075d](https://github.com/angular/angular/commit/185075d))
|
||||||
* **animations:** do not treat a `0` animation state as `void` ([451257a](https://github.com/angular/angular/commit/451257a))
|
* **animations:** do not treat a `0` animation state as `void` ([451257a](https://github.com/angular/angular/commit/451257a))
|
||||||
|
* **animations:** properly collect :enter nodes in a partially updated collection ([6ca4692](https://github.com/angular/angular/commit/6ca4692)), closes [#17440](https://github.com/angular/angular/issues/17440)
|
||||||
* **animations:** remove duplicate license header ([b192dd5](https://github.com/angular/angular/commit/b192dd5))
|
* **animations:** remove duplicate license header ([b192dd5](https://github.com/angular/angular/commit/b192dd5))
|
||||||
* **forms:** temp roll back breaking change with min/max directives ([b8c39cd](https://github.com/angular/angular/commit/b8c39cd)), closes [#17491](https://github.com/angular/angular/issues/17491)
|
* **forms:** temp roll back breaking change with min/max directives ([b8c39cd](https://github.com/angular/angular/commit/b8c39cd)), closes [#17491](https://github.com/angular/angular/issues/17491)
|
||||||
|
|
||||||
@ -4552,6 +4573,7 @@ Note: the 4.4.0 release on npm accidentally glitched-out midway, so we cut 4.4.1
|
|||||||
* **benchpress:** Update types for TypeScript nullability support ([14669f2](https://github.com/angular/angular/commit/14669f2))
|
* **benchpress:** Update types for TypeScript nullability support ([14669f2](https://github.com/angular/angular/commit/14669f2))
|
||||||
* **common:** Update types for TypeScript nullability support ([d8b73e4](https://github.com/angular/angular/commit/d8b73e4))
|
* **common:** Update types for TypeScript nullability support ([d8b73e4](https://github.com/angular/angular/commit/d8b73e4))
|
||||||
* **compiler:** fix build error in xliff2 ([bd704c9](https://github.com/angular/angular/commit/bd704c9))
|
* **compiler:** fix build error in xliff2 ([bd704c9](https://github.com/angular/angular/commit/bd704c9))
|
||||||
|
* **compiler:** fix inheritance for AOT with summaries ([#15583](https://github.com/angular/angular/issues/15583)) ([8ef621a](https://github.com/angular/angular/commit/8ef621a))
|
||||||
* **compiler:** ignore calls to unresolved symbols in metadata ([38a7e0d](https://github.com/angular/angular/commit/38a7e0d)), closes [#15969](https://github.com/angular/angular/issues/15969)
|
* **compiler:** ignore calls to unresolved symbols in metadata ([38a7e0d](https://github.com/angular/angular/commit/38a7e0d)), closes [#15969](https://github.com/angular/angular/issues/15969)
|
||||||
* **compiler:** ignore calls to unresolved symbols in metadata ([#15970](https://github.com/angular/angular/issues/15970)) ([ce47d33](https://github.com/angular/angular/commit/ce47d33)), closes [#15969](https://github.com/angular/angular/issues/15969)
|
* **compiler:** ignore calls to unresolved symbols in metadata ([#15970](https://github.com/angular/angular/issues/15970)) ([ce47d33](https://github.com/angular/angular/commit/ce47d33)), closes [#15969](https://github.com/angular/angular/issues/15969)
|
||||||
* **compiler:** Inform user where Quoted error was thrown ([a77b126](https://github.com/angular/angular/commit/a77b126))
|
* **compiler:** Inform user where Quoted error was thrown ([a77b126](https://github.com/angular/angular/commit/a77b126))
|
||||||
@ -4568,8 +4590,10 @@ Note: the 4.4.0 release on npm accidentally glitched-out midway, so we cut 4.4.1
|
|||||||
* **http:** Update types for TypeScript nullability support ([c36ec9b](https://github.com/angular/angular/commit/c36ec9b))
|
* **http:** Update types for TypeScript nullability support ([c36ec9b](https://github.com/angular/angular/commit/c36ec9b))
|
||||||
* **http:** Update types for TypeScript nullability support ([ec028b8](https://github.com/angular/angular/commit/ec028b8))
|
* **http:** Update types for TypeScript nullability support ([ec028b8](https://github.com/angular/angular/commit/ec028b8))
|
||||||
* **language-service:** avoid throwing exceptions when reporting metadata errors ([7764c5c](https://github.com/angular/angular/commit/7764c5c))
|
* **language-service:** avoid throwing exceptions when reporting metadata errors ([7764c5c](https://github.com/angular/angular/commit/7764c5c))
|
||||||
|
* **language-service:** detect when there isn't a tsconfig.json ([258d539](https://github.com/angular/angular/commit/258d539)), closes [#15874](https://github.com/angular/angular/issues/15874)
|
||||||
* **language-service:** improve resilience to incomplete information ([71a8627](https://github.com/angular/angular/commit/71a8627))
|
* **language-service:** improve resilience to incomplete information ([71a8627](https://github.com/angular/angular/commit/71a8627))
|
||||||
* **language-service:** infer correct type of `?.` expressions ([0a3a9af](https://github.com/angular/angular/commit/0a3a9af)), closes [#15885](https://github.com/angular/angular/issues/15885)
|
* **language-service:** infer correct type of `?.` expressions ([0a3a9af](https://github.com/angular/angular/commit/0a3a9af)), closes [#15885](https://github.com/angular/angular/issues/15885)
|
||||||
|
* **language-service:** initialize static reflector correctly ([fe0d02f](https://github.com/angular/angular/commit/fe0d02f)), closes [#15768](https://github.com/angular/angular/issues/15768)
|
||||||
* **language-service:** look for type constructors on canonical symbol ([2ddf3bc](https://github.com/angular/angular/commit/2ddf3bc))
|
* **language-service:** look for type constructors on canonical symbol ([2ddf3bc](https://github.com/angular/angular/commit/2ddf3bc))
|
||||||
* **language-service:** only use canonical symbols ([5a88d2f](https://github.com/angular/angular/commit/5a88d2f))
|
* **language-service:** only use canonical symbols ([5a88d2f](https://github.com/angular/angular/commit/5a88d2f))
|
||||||
* **language-service:** parse extended i18n forms ([bde9771](https://github.com/angular/angular/commit/bde9771))
|
* **language-service:** parse extended i18n forms ([bde9771](https://github.com/angular/angular/commit/bde9771))
|
||||||
@ -4594,6 +4618,7 @@ Note: the 4.4.0 release on npm accidentally glitched-out midway, so we cut 4.4.1
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
|
* **animations:** Update types for TypeScript nullability support ([38d75d4](https://github.com/angular/angular/commit/38d75d4)), closes [#15870](https://github.com/angular/angular/issues/15870)
|
||||||
* **compiler:** add source files to xmb/xliff translations ([#14705](https://github.com/angular/angular/issues/14705)) ([4054055](https://github.com/angular/angular/commit/4054055)), closes [#14190](https://github.com/angular/angular/issues/14190)
|
* **compiler:** add source files to xmb/xliff translations ([#14705](https://github.com/angular/angular/issues/14705)) ([4054055](https://github.com/angular/angular/commit/4054055)), closes [#14190](https://github.com/angular/angular/issues/14190)
|
||||||
* **compiler:** Implement i18n XLIFF 2.0 serializer ([#14185](https://github.com/angular/angular/issues/14185)) ([09c4cb2](https://github.com/angular/angular/commit/09c4cb2)), closes [#11735](https://github.com/angular/angular/issues/11735)
|
* **compiler:** Implement i18n XLIFF 2.0 serializer ([#14185](https://github.com/angular/angular/issues/14185)) ([09c4cb2](https://github.com/angular/angular/commit/09c4cb2)), closes [#11735](https://github.com/angular/angular/issues/11735)
|
||||||
* **upgrade:** allow setting the angularjs lib at runtime ([#15168](https://github.com/angular/angular/issues/15168)) ([e927aea](https://github.com/angular/angular/commit/e927aea))
|
* **upgrade:** allow setting the angularjs lib at runtime ([#15168](https://github.com/angular/angular/issues/15168)) ([e927aea](https://github.com/angular/angular/commit/e927aea))
|
||||||
@ -5331,18 +5356,27 @@ returned value being an array.
|
|||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **animations:** fix internal jscompiler issue and AOT quoting ([#13798](https://github.com/angular/angular/issues/13798)) ([c2aa981](https://github.com/angular/angular/commit/c2aa981))
|
||||||
|
* **common:** support numeric value as discrete cases for NgPlural ([#13876](https://github.com/angular/angular/issues/13876)) ([f364557](https://github.com/angular/angular/commit/f364557))
|
||||||
* **compiler:** [i18n] XMB/XTB placeholder names can contain only A-Z, 0-9, _n ([d02eab4](https://github.com/angular/angular/commit/d02eab4))
|
* **compiler:** [i18n] XMB/XTB placeholder names can contain only A-Z, 0-9, _n ([d02eab4](https://github.com/angular/angular/commit/d02eab4))
|
||||||
* **compiler:** fix regexp to support firefox 31 ([#14082](https://github.com/angular/angular/issues/14082)) ([b2f9d56](https://github.com/angular/angular/commit/b2f9d56)), closes [#14029](https://github.com/angular/angular/issues/14029) [#13900](https://github.com/angular/angular/issues/13900)
|
* **compiler:** fix regexp to support firefox 31 ([#14082](https://github.com/angular/angular/issues/14082)) ([b2f9d56](https://github.com/angular/angular/commit/b2f9d56)), closes [#14029](https://github.com/angular/angular/issues/14029) [#13900](https://github.com/angular/angular/issues/13900)
|
||||||
* **core:** export animation classes required for Renderer impl ([#14002](https://github.com/angular/angular/issues/14002)) ([83361d8](https://github.com/angular/angular/commit/83361d8)), closes [#14001](https://github.com/angular/angular/issues/14001)
|
* **core:** export animation classes required for Renderer impl ([#14002](https://github.com/angular/angular/issues/14002)) ([83361d8](https://github.com/angular/angular/commit/83361d8)), closes [#14001](https://github.com/angular/angular/issues/14001)
|
||||||
* **core:** fix not declared variable in view engine ([#14045](https://github.com/angular/angular/issues/14045)) ([d3a3a8e](https://github.com/angular/angular/commit/d3a3a8e))
|
* **core:** fix not declared variable in view engine ([#14045](https://github.com/angular/angular/issues/14045)) ([d3a3a8e](https://github.com/angular/angular/commit/d3a3a8e))
|
||||||
|
* **http:** don't create a blob out of ArrayBuffer when type is application/octet-stream ([#13992](https://github.com/angular/angular/issues/13992)) ([1200cf2](https://github.com/angular/angular/commit/1200cf2)), closes [#13973](https://github.com/angular/angular/issues/13973)
|
||||||
|
* **router:** enable loadChildren with function in aot ([#13909](https://github.com/angular/angular/issues/13909)) ([635bf02](https://github.com/angular/angular/commit/635bf02)), closes [#11075](https://github.com/angular/angular/issues/11075)
|
||||||
|
* **router:** routerLinkActive should not throw when not initialized ([#13273](https://github.com/angular/angular/issues/13273)) ([e8ea741](https://github.com/angular/angular/commit/e8ea741)), closes [#13270](https://github.com/angular/angular/issues/13270)
|
||||||
|
* **upgrade:** detect async downgrade component changes ([#13812](https://github.com/angular/angular/issues/13812)) ([d6382bf](https://github.com/angular/angular/commit/d6382bf)), closes [#6385](https://github.com/angular/angular/issues/6385) [#6385](https://github.com/angular/angular/issues/6385) [#10660](https://github.com/angular/angular/issues/10660) [#12318](https://github.com/angular/angular/issues/12318) [#12034](https://github.com/angular/angular/issues/12034)
|
||||||
* **upgrade/static:** ensure upgraded injector is initialized early enough ([#14065](https://github.com/angular/angular/issues/14065)) ([6152eb2](https://github.com/angular/angular/commit/6152eb2)), closes [#13811](https://github.com/angular/angular/issues/13811)
|
* **upgrade/static:** ensure upgraded injector is initialized early enough ([#14065](https://github.com/angular/angular/issues/14065)) ([6152eb2](https://github.com/angular/angular/commit/6152eb2)), closes [#13811](https://github.com/angular/angular/issues/13811)
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
|
* **build:** optionally build an ES2015 distro ([#13471](https://github.com/angular/angular/issues/13471)) ([be6c95a](https://github.com/angular/angular/commit/be6c95a))
|
||||||
* **core:** add event support to view engine ([0adb97b](https://github.com/angular/angular/commit/0adb97b))
|
* **core:** add event support to view engine ([0adb97b](https://github.com/angular/angular/commit/0adb97b))
|
||||||
* **core:** add initial view engine ([#14014](https://github.com/angular/angular/issues/14014)) ([2f87eb5](https://github.com/angular/angular/commit/2f87eb5))
|
* **core:** add initial view engine ([#14014](https://github.com/angular/angular/issues/14014)) ([2f87eb5](https://github.com/angular/angular/commit/2f87eb5))
|
||||||
* **core:** add pure expression support to view engine ([6541737](https://github.com/angular/angular/commit/6541737))
|
* **core:** add pure expression support to view engine ([6541737](https://github.com/angular/angular/commit/6541737))
|
||||||
|
* **core:** Add type information to injector.get() ([#13785](https://github.com/angular/angular/issues/13785)) ([d169c24](https://github.com/angular/angular/commit/d169c24))
|
||||||
|
* **security:** allow calc and gradient functions. ([#13943](https://github.com/angular/angular/issues/13943)) ([e19bf70](https://github.com/angular/angular/commit/e19bf70))
|
||||||
* **tsc-wrapped:** Support of vinyl like config file was added ([#13987](https://github.com/angular/angular/issues/13987)) ([0c7726d](https://github.com/angular/angular/commit/0c7726d))
|
* **tsc-wrapped:** Support of vinyl like config file was added ([#13987](https://github.com/angular/angular/issues/13987)) ([0c7726d](https://github.com/angular/angular/commit/0c7726d))
|
||||||
* **upgrade:** Support ng-model in downgraded components ([#10578](https://github.com/angular/angular/issues/10578)) ([e21e9c5](https://github.com/angular/angular/commit/e21e9c5))
|
* **upgrade:** Support ng-model in downgraded components ([#10578](https://github.com/angular/angular/issues/10578)) ([e21e9c5](https://github.com/angular/angular/commit/e21e9c5))
|
||||||
|
|
||||||
@ -5870,12 +5904,19 @@ Note: The 2.3.0-beta.0 release also contains all the changes present in the 2.2.
|
|||||||
|
|
||||||
### Features (summary of all features from 2.2.0-beta.0 - 2.2.0-rc.0 releases)
|
### Features (summary of all features from 2.2.0-beta.0 - 2.2.0-rc.0 releases)
|
||||||
|
|
||||||
|
* **common:** support narrow forms for month and weekdays in DatePipe ([#12297](https://github.com/angular/angular/issues/12297)) ([f77ab6a](https://github.com/angular/angular/commit/f77ab6a)), closes [#12294](https://github.com/angular/angular/issues/12294)
|
||||||
* **core:** map 'for' attribute to 'htmlFor' property ([#10546](https://github.com/angular/angular/issues/10546)) ([634b3bb](https://github.com/angular/angular/commit/634b3bb)), closes [#7516](https://github.com/angular/angular/issues/7516)
|
* **core:** map 'for' attribute to 'htmlFor' property ([#10546](https://github.com/angular/angular/issues/10546)) ([634b3bb](https://github.com/angular/angular/commit/634b3bb)), closes [#7516](https://github.com/angular/angular/issues/7516)
|
||||||
* **core:** add the find method to QueryList ([7c16ef9](https://github.com/angular/angular/commit/7c16ef9))
|
* **core:** add the find method to QueryList ([7c16ef9](https://github.com/angular/angular/commit/7c16ef9))
|
||||||
|
* **forms:** add hasError and getError to AbstractControlDirective ([#11985](https://github.com/angular/angular/issues/11985)) ([592f40a](https://github.com/angular/angular/commit/592f40a)), closes [#7255](https://github.com/angular/angular/issues/7255)
|
||||||
|
* **forms:** add ng-pending CSS class during async validation ([#11243](https://github.com/angular/angular/issues/11243)) ([97bc971](https://github.com/angular/angular/commit/97bc971)), closes [#10336](https://github.com/angular/angular/issues/10336)
|
||||||
* **forms:** add emitEvent to AbstractControl methods ([#11949](https://github.com/angular/angular/issues/11949)) ([b9fc090](https://github.com/angular/angular/commit/b9fc090))
|
* **forms:** add emitEvent to AbstractControl methods ([#11949](https://github.com/angular/angular/issues/11949)) ([b9fc090](https://github.com/angular/angular/commit/b9fc090))
|
||||||
|
* **forms:** make 'parent' a public property of 'AbstractControl' ([#11855](https://github.com/angular/angular/issues/11855)) ([445e592](https://github.com/angular/angular/commit/445e592))
|
||||||
|
* **forms:** Validator.pattern accepts a RegExp ([#12323](https://github.com/angular/angular/issues/12323)) ([bf60418](https://github.com/angular/angular/commit/bf60418))
|
||||||
* **router:** add a provider making angular1/angular2 integration easier ([#12769](https://github.com/angular/angular/issues/12769)) ([6e35d13](https://github.com/angular/angular/commit/6e35d13))
|
* **router:** add a provider making angular1/angular2 integration easier ([#12769](https://github.com/angular/angular/issues/12769)) ([6e35d13](https://github.com/angular/angular/commit/6e35d13))
|
||||||
* **router:** add support for custom url matchers ([7340735](https://github.com/angular/angular/commit/7340735)), closes [#12442](https://github.com/angular/angular/issues/12442) [#12772](https://github.com/angular/angular/issues/12772)
|
* **router:** add support for custom url matchers ([7340735](https://github.com/angular/angular/commit/7340735)), closes [#12442](https://github.com/angular/angular/issues/12442) [#12772](https://github.com/angular/angular/issues/12772)
|
||||||
* **router:** export routerLinkActive w/ isActive property ([c9f58cf](https://github.com/angular/angular/commit/c9f58cf))
|
* **router:** export routerLinkActive w/ isActive property ([c9f58cf](https://github.com/angular/angular/commit/c9f58cf))
|
||||||
|
* **router:** add support for ng1/ng2 migration ([#12160](https://github.com/angular/angular/issues/12160)) ([8b9ab44](https://github.com/angular/angular/commit/8b9ab44))
|
||||||
|
* **upgrade:** add support for AoT compiled upgrade applications ([d6791ff](https://github.com/angular/angular/commit/d6791ff)), closes [#12239](https://github.com/angular/angular/issues/12239)
|
||||||
* **upgrade:** add support for `require` in UpgradeComponent ([fe1d0e2](https://github.com/angular/angular/commit/fe1d0e2))
|
* **upgrade:** add support for `require` in UpgradeComponent ([fe1d0e2](https://github.com/angular/angular/commit/fe1d0e2))
|
||||||
* **upgrade:** add/improve support for lifecycle hooks in UpgradeComponent ([469010e](https://github.com/angular/angular/commit/469010e))
|
* **upgrade:** add/improve support for lifecycle hooks in UpgradeComponent ([469010e](https://github.com/angular/angular/commit/469010e))
|
||||||
|
|
||||||
|
21
README.md
21
README.md
@ -5,21 +5,22 @@
|
|||||||
|
|
||||||
# Angular
|
# Angular
|
||||||
|
|
||||||
Angular es una plataforma de desarrollo para construir aplicaciones web y móviles que usa TypeScript/JavaScript y otros lenguajes de programación.
|
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages.
|
||||||
|
|
||||||
## Guía rápida
|
## Quickstart
|
||||||
|
|
||||||
[Comienza a usarlo en 5 minutos][quickstart].
|
[Get started in 5 minutes][quickstart].
|
||||||
|
|
||||||
## Registro de cambios (Changelog)
|
## Changelog
|
||||||
|
|
||||||
[Últimas mejoras realizadas][changelog].
|
[Learn about the latest improvements][changelog].
|
||||||
|
|
||||||
## ¿Quieres ayudar?
|
## Want to help?
|
||||||
|
|
||||||
¿Quieres encontrar fallos, colaborar con código, o mejorar la documentación? ¡Excelente! Lee nuestras
|
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our
|
||||||
pautas para [colaborar][contributing] y luego revisa algunos de nuestras incidencias (issues) en [ayuda comunitaria](https://github.com/angular-hispano/angular/labels/ayuda%20comunitaria).
|
guidelines for [contributing][contributing] and then check out one of our issues in the [hotlist: community-help](https://github.com/angular/angular/labels/hotlist%3A%20community-help).
|
||||||
|
|
||||||
[contributing]: https://github.com/angular-hispano/angular/blob/master/CONTRIBUTING.md
|
[contributing]: https://github.com/angular/angular/blob/master/CONTRIBUTING.md
|
||||||
[quickstart]: https://docs.angular.lat/start
|
[quickstart]: https://angular.io/start
|
||||||
[changelog]: https://github.com/angular/angular/blob/master/CHANGELOG.md
|
[changelog]: https://github.com/angular/angular/blob/master/CHANGELOG.md
|
||||||
|
[ng]: https://angular.io
|
||||||
|
1
aio/content/examples/.gitignore
vendored
1
aio/content/examples/.gitignore
vendored
@ -18,6 +18,7 @@
|
|||||||
**/src/karma.conf.js
|
**/src/karma.conf.js
|
||||||
**/.angular-cli.json
|
**/.angular-cli.json
|
||||||
**/.editorconfig
|
**/.editorconfig
|
||||||
|
**/.gitignore
|
||||||
**/angular.json
|
**/angular.json
|
||||||
**/tsconfig.json
|
**/tsconfig.json
|
||||||
**/bs-config.e2e.json
|
**/bs-config.e2e.json
|
||||||
|
@ -16,5 +16,12 @@
|
|||||||
"@angular/core": "^7.2.0"
|
"@angular/core": "^7.2.0"
|
||||||
},
|
},
|
||||||
// #docregion collection
|
// #docregion collection
|
||||||
"schematics": "./schematics/collection.json"
|
"schematics": "./schematics/collection.json",
|
||||||
}
|
// #enddocregion collection
|
||||||
|
// #docregion ng-add
|
||||||
|
"ng-add": {
|
||||||
|
"save": "devDependencies"
|
||||||
|
}
|
||||||
|
// #enddocregion ng-add
|
||||||
|
// #docregion collection
|
||||||
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<!-- Polyfills -->
|
<!-- Polyfills -->
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||||
|
|
||||||
<script src="node_modules/zone.js/bundles/zone.umd.js"></script>
|
<script src="node_modules/zone.js/dist/zone.js"></script>
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||||
<script src="systemjs.config.js"></script>
|
<script src="systemjs.config.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<!-- Polyfills -->
|
<!-- Polyfills -->
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||||
|
|
||||||
<script src="node_modules/zone.js/bundles/zone.umd.js"></script>
|
<script src="node_modules/zone.js/dist/zone.js"></script>
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||||
|
|
||||||
<script src="systemjs.config.1.js"></script>
|
<script src="systemjs.config.1.js"></script>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<!-- Polyfills -->
|
<!-- Polyfills -->
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||||
|
|
||||||
<script src="node_modules/zone.js/bundles/zone.umd.js"></script>
|
<script src="node_modules/zone.js/dist/zone.js"></script>
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||||
|
|
||||||
<script src="systemjs.config.1.js"></script>
|
<script src="systemjs.config.1.js"></script>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<!-- Polyfills -->
|
<!-- Polyfills -->
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||||
|
|
||||||
<script src="node_modules/zone.js/bundles/zone.umd.js"></script>
|
<script src="node_modules/zone.js/dist/zone.js"></script>
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||||
|
|
||||||
<script src="systemjs.config.1.js"></script>
|
<script src="systemjs.config.1.js"></script>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<!-- Polyfills -->
|
<!-- Polyfills -->
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||||
|
|
||||||
<script src="node_modules/zone.js/bundles/zone.umd.js"></script>
|
<script src="node_modules/zone.js/dist/zone.js"></script>
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||||
|
|
||||||
<script src="systemjs.config.1.js"></script>
|
<script src="systemjs.config.1.js"></script>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<!-- Polyfills -->
|
<!-- Polyfills -->
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||||
|
|
||||||
<script src="node_modules/zone.js/bundles/zone.umd.js"></script>
|
<script src="node_modules/zone.js/dist/zone.js"></script>
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||||
|
|
||||||
<script src="systemjs.config.1.js"></script>
|
<script src="systemjs.config.1.js"></script>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<!-- Polyfills -->
|
<!-- Polyfills -->
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||||
|
|
||||||
<script src="node_modules/zone.js/bundles/zone.umd.js"></script>
|
<script src="node_modules/zone.js/dist/zone.js"></script>
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||||
|
|
||||||
<script src="systemjs.config.1.js"></script>
|
<script src="systemjs.config.1.js"></script>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<!-- Polyfills -->
|
<!-- Polyfills -->
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||||
|
|
||||||
<script src="node_modules/zone.js/bundles/zone.umd.js"></script>
|
<script src="node_modules/zone.js/dist/zone.js"></script>
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||||
|
|
||||||
<script src="systemjs.config.1.js"></script>
|
<script src="systemjs.config.1.js"></script>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<!-- Polyfills -->
|
<!-- Polyfills -->
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||||
|
|
||||||
<script src="node_modules/zone.js/bundles/zone.umd.js"></script>
|
<script src="node_modules/zone.js/dist/zone.js"></script>
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||||
|
|
||||||
<script src="systemjs.config.1.js"></script>
|
<script src="systemjs.config.1.js"></script>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<!-- Polyfills -->
|
<!-- Polyfills -->
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||||
|
|
||||||
<script src="node_modules/zone.js/bundles/zone.umd.js"></script>
|
<script src="node_modules/zone.js/dist/zone.js"></script>
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||||
|
|
||||||
<script src="systemjs.config.1.js"></script>
|
<script src="systemjs.config.1.js"></script>
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<script src="phone-detail/phone-detail.module.js"></script>
|
<script src="phone-detail/phone-detail.module.js"></script>
|
||||||
|
|
||||||
<script src="/node_modules/core-js/client/shim.min.js"></script>
|
<script src="/node_modules/core-js/client/shim.min.js"></script>
|
||||||
<script src="/node_modules/zone.js/bundles/zone.umd.min.js"></script>
|
<script src="/node_modules/zone.js/dist/zone.min.js"></script>
|
||||||
|
|
||||||
<script>window.module = 'aot';</script>
|
<script>window.module = 'aot';</script>
|
||||||
</head>
|
</head>
|
||||||
|
@ -3,7 +3,7 @@ var fsExtra = require('fs-extra');
|
|||||||
var resources = [
|
var resources = [
|
||||||
// polyfills
|
// polyfills
|
||||||
'node_modules/core-js/client/shim.min.js',
|
'node_modules/core-js/client/shim.min.js',
|
||||||
'node_modules/zone.js/bundles/zone.umd.min.js',
|
'node_modules/zone.js/dist/zone.min.js',
|
||||||
// css
|
// css
|
||||||
'app/app.css',
|
'app/app.css',
|
||||||
'app/app.animations.css',
|
'app/app.animations.css',
|
||||||
@ -20,7 +20,6 @@ var resources = [
|
|||||||
'app/phone-detail/phone-detail.module.js'
|
'app/phone-detail/phone-detail.module.js'
|
||||||
];
|
];
|
||||||
resources.map(function(sourcePath) {
|
resources.map(function(sourcePath) {
|
||||||
// Need to rename zone.umd.min.js to zone.min.js
|
var destPath = `aot/${sourcePath}`;
|
||||||
var destPath = `aot/${sourcePath}`.replace('.umd.min.js', '.min.js');
|
|
||||||
fsExtra.copySync(sourcePath, destPath);
|
fsExtra.copySync(sourcePath, destPath);
|
||||||
});
|
});
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
<!-- #docregion angular -->
|
<!-- #docregion angular -->
|
||||||
<script src="/node_modules/core-js/client/shim.min.js"></script>
|
<script src="/node_modules/core-js/client/shim.min.js"></script>
|
||||||
<script src="/node_modules/zone.js/bundles/zone.umd.js"></script>
|
<script src="/node_modules/zone.js/dist/zone.js"></script>
|
||||||
<script src="/node_modules/systemjs/dist/system.src.js"></script>
|
<script src="/node_modules/systemjs/dist/system.src.js"></script>
|
||||||
<!-- #enddocregion angular -->
|
<!-- #enddocregion angular -->
|
||||||
<script src="/systemjs.config.1.js"></script>
|
<script src="/systemjs.config.1.js"></script>
|
||||||
|
@ -21,8 +21,8 @@ module.exports = function(config) {
|
|||||||
'node_modules/core-js/client/shim.js',
|
'node_modules/core-js/client/shim.js',
|
||||||
|
|
||||||
// zone.js
|
// zone.js
|
||||||
'node_modules/zone.js/bundles/zone.umd.js',
|
'node_modules/zone.js/dist/zone.js',
|
||||||
'node_modules/zone.js/bundles/zone-testing.umd.js',
|
'node_modules/zone.js/dist/zone-testing.js',
|
||||||
|
|
||||||
// RxJs.
|
// RxJs.
|
||||||
{ pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false },
|
{ pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false },
|
||||||
|
@ -31,8 +31,8 @@ module.exports = function(config) {
|
|||||||
'node_modules/core-js/client/shim.js',
|
'node_modules/core-js/client/shim.js',
|
||||||
|
|
||||||
// zone.js
|
// zone.js
|
||||||
'node_modules/zone.js/bundles/zone.umd.js',
|
'node_modules/zone.js/dist/zone.js',
|
||||||
'node_modules/zone.js/bundles/zone-testing.umd.js',
|
'node_modules/zone.js/dist/zone-testing.js',
|
||||||
|
|
||||||
// RxJs
|
// RxJs
|
||||||
{ pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false },
|
{ pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false },
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<link rel="stylesheet" href="app.css" />
|
<link rel="stylesheet" href="app.css" />
|
||||||
|
|
||||||
<script src="/node_modules/core-js/client/shim.min.js"></script>
|
<script src="/node_modules/core-js/client/shim.min.js"></script>
|
||||||
<script src="/node_modules/zone.js/bundles/zone.umd.js"></script>
|
<script src="/node_modules/zone.js/dist/zone.js"></script>
|
||||||
<script src="/node_modules/systemjs/dist/system.src.js"></script>
|
<script src="/node_modules/systemjs/dist/system.src.js"></script>
|
||||||
<!-- #enddocregion full -->
|
<!-- #enddocregion full -->
|
||||||
<script src="/systemjs.config.1.js"></script>
|
<script src="/systemjs.config.1.js"></script>
|
||||||
|
@ -31,8 +31,8 @@ module.exports = function(config) {
|
|||||||
'node_modules/core-js/client/shim.js',
|
'node_modules/core-js/client/shim.js',
|
||||||
|
|
||||||
// zone.js
|
// zone.js
|
||||||
'node_modules/zone.js/bundles/zone.umd.js',
|
'node_modules/zone.js/dist/zone.js',
|
||||||
'node_modules/zone.js/bundles/zone-testing.umd.js',
|
'node_modules/zone.js/dist/zone-testing.js',
|
||||||
|
|
||||||
// RxJs
|
// RxJs
|
||||||
{ pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false },
|
{ pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false },
|
||||||
|
@ -1,32 +1,32 @@
|
|||||||
# App shell
|
# App shell
|
||||||
|
|
||||||
App shell es una manera de renderizar una porción de tu aplicación a través de una ruta en tiempo de compilación (build time).
|
App shell is a way to render a portion of your application via a route at build time.
|
||||||
Puede mejorar la experiencia de usuario lanzando rápidamente una página estática renderizada (un esqueleto común a todas las páginas) mientras el navegador descarga la versión completa del cliente y la muestra automáticamente al finalizar su carga.
|
It can improve the user experience by quickly launching a static rendered page (a skeleton common to all pages) while the browser downloads the full client version and switches to it automatically after the code loads.
|
||||||
|
|
||||||
Esto da a los usuarios una primera visualización significativa de su aplicación que aparece rápidamente porque el navegador simplemente puede renderizar HTML y CSS sin la necesidad de inicializar JavaScript.
|
This gives users a meaningful first paint of your application that appears quickly because the browser can simply render the HTML and CSS without the need to initialize any JavaScript.
|
||||||
|
|
||||||
Obténga más información en [El modelo de aplicación Shell](https://developers.google.com/web/fundamentals/architecture/app-shell).
|
Learn more in [The App Shell Model](https://developers.google.com/web/fundamentals/architecture/app-shell).
|
||||||
|
|
||||||
## Paso 1: Prepara la aplicación
|
## Step 1: Prepare the application
|
||||||
|
|
||||||
Puedes hacer esto con el siguiente comando CLI:
|
You can do this with the following CLI command:
|
||||||
<code-example language="bash">
|
<code-example language="bash">
|
||||||
ng new my-app --routing
|
ng new my-app --routing
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
Para una aplicación existente, debes agregar manualmente el `RouterModule` y definir un` <router-outlet> `dentro de tu aplicación.
|
For an existing application, you have to manually add the `RouterModule` and defining a `<router-outlet>` within your application.
|
||||||
|
|
||||||
## Paso 2: Crea el shell de la aplicación
|
## Step 2: Create the app shell
|
||||||
|
|
||||||
Usa la CLI para crear automáticamente el shell de la aplicación.
|
Use the CLI to automatically create the app shell.
|
||||||
|
|
||||||
<code-example language="bash">
|
<code-example language="bash">
|
||||||
ng generate app-shell
|
ng generate app-shell
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
* `client-project` toma el nombre de tu aplicación cliente.
|
* `client-project` takes the name of your client application.
|
||||||
|
|
||||||
Después de ejecutar este comando, notará que el archivo de configuración `angular.json` se ha actualizado para agregar dos nuevos targets, con algunos otros cambios.
|
After running this command you will notice that the `angular.json` configuration file has been updated to add two new targets, with a few other changes.
|
||||||
|
|
||||||
<code-example language="json">
|
<code-example language="json">
|
||||||
"server": {
|
"server": {
|
||||||
@ -53,18 +53,20 @@ Después de ejecutar este comando, notará que el archivo de configuración `ang
|
|||||||
}
|
}
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
## Paso 3: Verifica que la aplicación está construida con el contenido del shell
|
## Step 3: Verify the app is built with the shell content
|
||||||
|
|
||||||
Usa la CLI para construir el `app-shell` target.
|
Use the CLI to build the `app-shell` target.
|
||||||
|
|
||||||
<code-example language="bash">
|
<code-example language="bash">
|
||||||
ng run my-app:app-shell
|
ng run my-app:app-shell
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
O usa la configuración de producción.
|
Or to use the production configuration.
|
||||||
|
|
||||||
<code-example language="bash">
|
<code-example language="bash">
|
||||||
ng run my-app:app-shell:production
|
ng run my-app:app-shell:production
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
Para verificar el resultado de la compilación, abre `dist/my-app/index.html`. Busca el texto por defecto `app-shell works!` para mostrar que la ruta del shell de la aplicación se ha renderizado como parte de la carpeta de distribución.
|
To verify the build output, open `dist/my-app/index.html`. Look for default text `app-shell works!` to show that the app shell route was rendered as part of the output.
|
||||||
|
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ For example:
|
|||||||
// __Zone_enable_cross_context_check = true;
|
// __Zone_enable_cross_context_check = true;
|
||||||
</script>
|
</script>
|
||||||
<!-- zone.js required by Angular -->
|
<!-- zone.js required by Angular -->
|
||||||
<script src="node_modules/zone.js/bundles/zone.umd.js"></script>
|
<script src="node_modules/zone.js/dist/zone.js"></script>
|
||||||
|
|
||||||
<!-- application polyfills -->
|
<!-- application polyfills -->
|
||||||
</code-example>
|
</code-example>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code><b>platformBrowserDynamic().bootstrapModule</b>(AppModule);</code></td>
|
<td><code><b>platformBrowserDynamic().bootstrapModule</b>(AppModule);</code></td>
|
||||||
<td><p>Carga la app, usando el componente raíz del <code>NgModule</code> especificado.</p>
|
<td><p>Bootstraps the app, using the root component from the specified <code>NgModule</code>. </p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
@ -24,372 +24,370 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>@<b>NgModule</b>({ declarations: ..., imports: ...,<br> exports: ..., providers: ..., bootstrap: ...})<br>class MyModule {}</code></td>
|
<td><code>@<b>NgModule</b>({ declarations: ..., imports: ...,<br> exports: ..., providers: ..., bootstrap: ...})<br>class MyModule {}</code></td>
|
||||||
<td><p>Define un módulo que contiene componentes, directivas, pipes y proveedores.</p>
|
<td><p>Defines a module that contains components, directives, pipes, and providers.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>declarations:</b> [MyRedComponent, MyBlueComponent, MyDatePipe]</code></td>
|
<td><code><b>declarations:</b> [MyRedComponent, MyBlueComponent, MyDatePipe]</code></td>
|
||||||
<td><p>Lista de componentes, directivas y pipes que pertenecen a este módulo.</p>
|
<td><p>List of components, directives, and pipes that belong to this module.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>imports:</b> [BrowserModule, SomeOtherModule]</code></td>
|
<td><code><b>imports:</b> [BrowserModule, SomeOtherModule]</code></td>
|
||||||
<td><p>Lista de módulos para importar en este módulo. Todo, desde los módulos importados,
|
<td><p>List of modules to import into this module. Everything from the imported modules
|
||||||
está disponible para las declaraciones (<code>declarations</code>) de este módulo.
|
is available to <code>declarations</code> of this module.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>exports:</b> [MyRedComponent, MyDatePipe]</code></td>
|
<td><code><b>exports:</b> [MyRedComponent, MyDatePipe]</code></td>
|
||||||
<td><p>Lista de componentes, directivas y pipes visibles a los módulos que importan este módulo.</p>
|
<td><p>List of components, directives, and pipes visible to modules that import this module.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>providers:</b> [MyService, { provide: ... }]</code></td>
|
<td><code><b>providers:</b> [MyService, { provide: ... }]</code></td>
|
||||||
<td><p>Lista de proveedores de inyección de dependencias visibles tanto para los contenidos de este módulo como para los importadores de este módulo.</p>
|
<td><p>List of dependency injection providers visible both to the contents of this module and to importers of this module.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>entryComponents:</b> [SomeComponent, OtherComponent]</code></td>
|
<td><code><b>entryComponents:</b> [SomeComponent, OtherComponent]</code></td>
|
||||||
<td><p>Lista de componentes no referenciados en cualquier plantilla accesible, por ejemplo, creada dinámicamente a partir de código.</p></td>
|
<td><p>List of components not referenced in any reachable template, for example dynamically created from code.</p></td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>bootstrap:</b> [MyAppComponent]</code></td>
|
<td><code><b>bootstrap:</b> [MyAppComponent]</code></td>
|
||||||
<td><p>Lista de componentes a empaquetar cuando este módulo se inicia.</p>
|
<td><p>List of components to bootstrap when this module is bootstrapped.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
|
|
||||||
<table class="is-full-width is-fixed-layout">
|
<table class="is-full-width is-fixed-layout">
|
||||||
<tbody><tr>
|
<tbody><tr>
|
||||||
<th>Sintaxis de plantilla</th>
|
<th>Template syntax</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code><input <b>[value]</b>="firstName"></code></td>
|
<td><code><input <b>[value]</b>="firstName"></code></td>
|
||||||
<td><p>Vincula la propiedad <code>value</code> al resultado de la expresión <code>firstName</code>.</p>
|
<td><p>Binds property <code>value</code> to the result of expression <code>firstName</code>.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><div <b>[attr.role]</b>="myAriaRole"></code></td>
|
<td><code><div <b>[attr.role]</b>="myAriaRole"></code></td>
|
||||||
<td><p>Vincula el atributo <code>role</code> al resultado de la expresión <code>myAriaRole</code>.</p>
|
<td><p>Binds attribute <code>role</code> to the result of expression <code>myAriaRole</code>.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><div <b>[class.extra-sparkle]</b>="isDelightful"></code></td>
|
<td><code><div <b>[class.extra-sparkle]</b>="isDelightful"></code></td>
|
||||||
<td><p>Vincula la presencia de la clase CSS <code>extra-sparkle</code> sobre el elemento a la veracidad de la expresión <code>isDelightful</code>.</p>
|
<td><p>Binds the presence of the CSS class <code>extra-sparkle</code> on the element to the truthiness of the expression <code>isDelightful</code>.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><div <b>[style.width.px]</b>="mySize"></code></td>
|
<td><code><div <b>[style.width.px]</b>="mySize"></code></td>
|
||||||
<td><p>Vincula la propiedad de estilo <code>width</code> al resultado de la expresión <code>mySize</code> en píxeles. La unidad de medida es opcional.</p>
|
<td><p>Binds style property <code>width</code> to the result of expression <code>mySize</code> in pixels. Units are optional.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><button <b>(click)</b>="readRainbow($event)"></code></td>
|
<td><code><button <b>(click)</b>="readRainbow($event)"></code></td>
|
||||||
<td><p>Llama al método <code>readRainbow</code> cuando se lanza un evento click en este elemento botón (o sus hijos) y pasa por argumento el objeto evento.</p>
|
<td><p>Calls method <code>readRainbow</code> when a click event is triggered on this button element (or its children) and passes in the event object.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><div title="Hola <b>{{ponyName}}</b>"></code></td>
|
<td><code><div title="Hello <b>{{ponyName}}</b>"></code></td>
|
||||||
<td><p>Vincula una propiedad a una cadena interpolada, por ejemplo, "Hola Seabiscuit". Equivalente a:
|
|
||||||
<td><p>Binds a property to an interpolated string, for example, "Hello Seabiscuit". Equivalent to:
|
<td><p>Binds a property to an interpolated string, for example, "Hello Seabiscuit". Equivalent to:
|
||||||
<code><div [title]="'Hola ' + ponyName"></code></p>
|
<code><div [title]="'Hello ' + ponyName"></code></p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><p>Hola <b>{{ponyName}}</b></p></code></td>
|
<td><code><p>Hello <b>{{ponyName}}</b></p></code></td>
|
||||||
<td><p>Vincula el contenido de texto a una cadena interpolada, por ejemplo, "Hola Seabiscuit".</p>
|
<td><p>Binds text content to an interpolated string, for example, "Hello Seabiscuit".</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><my-cmp <b>[(title)]</b>="name"></code></td>
|
<td><code><my-cmp <b>[(title)]</b>="name"></code></td>
|
||||||
<td><p>Establece el two-way data binding. Equivalente a: <code><my-cmp [title]="name" (titleChange)="name=$event"></code></p>
|
<td><p>Sets up two-way data binding. Equivalent to: <code><my-cmp [title]="name" (titleChange)="name=$event"></code></p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><video <b>#movieplayer</b> ...><br> <button <b>(click)</b>="movieplayer.play()"><br></video></code></td>
|
<td><code><video <b>#movieplayer</b> ...><br> <button <b>(click)</b>="movieplayer.play()"><br></video></code></td>
|
||||||
<td><p>Crea una variable local <code>movieplayer</code> que provee acceso a la instancia del elemento <code>video</code> en las expresiones de data-binding y event-binding de la actual plantilla.</p>
|
<td><p>Creates a local variable <code>movieplayer</code> that provides access to the <code>video</code> element instance in data-binding and event-binding expressions in the current template.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><p <b>*myUnless</b>="myExpression">...</p></code></td>
|
<td><code><p <b>*myUnless</b>="myExpression">...</p></code></td>
|
||||||
<td><p>El símbolo <code>*</code> convierte el elemento actual en una plantilla incrustada. Equivalente a:
|
<td><p>The <code>*</code> symbol turns the current element into an embedded template. Equivalent to:
|
||||||
<code><ng-template [myUnless]="myExpression"><p>...</p></ng-template></code></p>
|
<code><ng-template [myUnless]="myExpression"><p>...</p></ng-template></code></p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><p>Card No.: <b>{{cardNumber | myCardNumberFormatter}}</b></p></code></td>
|
<td><code><p>Card No.: <b>{{cardNumber | myCardNumberFormatter}}</b></p></code></td>
|
||||||
<td><p>Transforma el valor actual de la expresión <code>cardNumber</code> a través de la pipe <code>myCardNumberFormatter</code>.</p>
|
<td><p>Transforms the current value of expression <code>cardNumber</code> via the pipe called <code>myCardNumberFormatter</code>.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><p>Employer: <b>{{employer?.companyName}}</b></p></code></td>
|
<td><code><p>Employer: <b>{{employer?.companyName}}</b></p></code></td>
|
||||||
<td><p>El operador de navegación seguro (<code>?</code>) significa que el campo <code>employer</code> es opcional y que si es <code>undefined</code>, el resto de la expresión debería ser ignorado.</p>
|
<td><p>The safe navigation operator (<code>?</code>) means that the <code>employer</code> field is optional and if <code>undefined</code>, the rest of the expression should be ignored.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><<b>svg:</b>rect x="0" y="0" width="100" height="100"/></code></td>
|
<td><code><<b>svg:</b>rect x="0" y="0" width="100" height="100"/></code></td>
|
||||||
<td><p>Una plantilla de fragmento SVG necesita un prefijo <code>svg:</code> en su elemento raíz para distinguir el elemento SVG de un componente HTML.</p>
|
<td><p>An SVG snippet template needs an <code>svg:</code> prefix on its root element to disambiguate the SVG element from an HTML component.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><<b>svg</b>><br> <rect x="0" y="0" width="100" height="100"/><br></<b>svg</b>></code></td>
|
<td><code><<b>svg</b>><br> <rect x="0" y="0" width="100" height="100"/><br></<b>svg</b>></code></td>
|
||||||
<td><p>Un elemento raíz <code><svg></code> es detectado como un elemento SVG automáticamente, sin el prefijo.</p>
|
<td><p>An <code><svg></code> root element is detected as an SVG element automatically, without the prefix.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
|
|
||||||
<table class="is-full-width is-fixed-layout">
|
<table class="is-full-width is-fixed-layout">
|
||||||
<tbody><tr>
|
<tbody><tr>
|
||||||
<th>Directivas incorporadas</th>
|
<th>Built-in directives</th>
|
||||||
<th><p><code>import { CommonModule } from '@angular/common';</code>
|
<th><p><code>import { CommonModule } from '@angular/common';</code>
|
||||||
</p>
|
</p>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code><section <b>*ngIf</b>="showSection"></code></td>
|
<td><code><section <b>*ngIf</b>="showSection"></code></td>
|
||||||
<td><p>Elimina o recrea una parte del árbol DOM basado en la expresión <code>showSection</code>.</p>
|
<td><p>Removes or recreates a portion of the DOM tree based on the <code>showSection</code> expression.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><li <b>*ngFor</b>="let item of list"></code></td>
|
<td><code><li <b>*ngFor</b>="let item of list"></code></td>
|
||||||
<td><p>Convierte el elemento li y su contenido en una plantilla, y lo utiliza para crear una vista por cada elemento de la lista.</p>
|
<td><p>Turns the li element and its contents into a template, and uses that to instantiate a view for each item in list.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><div <b>[ngSwitch]</b>="conditionExpression"><br> <ng-template <b>[<b>ngSwitchCase</b>]</b>="case1Exp">...</ng-template><br> <ng-template <b>ngSwitchCase</b>="case2LiteralString">...</ng-template><br> <ng-template <b>ngSwitchDefault</b>>...</ng-template><br></div></code></td>
|
<td><code><div <b>[ngSwitch]</b>="conditionExpression"><br> <ng-template <b>[<b>ngSwitchCase</b>]</b>="case1Exp">...</ng-template><br> <ng-template <b>ngSwitchCase</b>="case2LiteralString">...</ng-template><br> <ng-template <b>ngSwitchDefault</b>>...</ng-template><br></div></code></td>
|
||||||
<td><p>Intercambia condicionalmente el contenido del div seleccionando una de las plantillas incrustadas en función del valor actual de <code>conditionExpression</code>.</p>
|
<td><p>Conditionally swaps the contents of the div by selecting one of the embedded templates based on the current value of <code>conditionExpression</code>.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><div <b>[ngClass]</b>="{'active': isActive, 'disabled': isDisabled}"></code></td>
|
<td><code><div <b>[ngClass]</b>="{'active': isActive, 'disabled': isDisabled}"></code></td>
|
||||||
<td><p>Vincula la presencia de clases CSS en el elemento a la veracidad de los valores de mapa asociados. La expresión de la derecha debería devolver el mapa {class-name: true/false}.</p>
|
<td><p>Binds the presence of CSS classes on the element to the truthiness of the associated map values. The right-hand expression should return {class-name: true/false} map.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code><div <b>[ngStyle]</b>="{'property': 'value'}"></code><br><code><div <b>[ngStyle]</b>="dynamicStyles()"></code></td>
|
<td><code><div <b>[ngStyle]</b>="{'property': 'value'}"></code><br><code><div <b>[ngStyle]</b>="dynamicStyles()"></code></td>
|
||||||
<p>Te permite asignar estilos a un elemento HTML usando CSS. Puedes usar CSS directamente, como en el primer ejemplo, o puedes llamar a un método desde el componente.</p>
|
<td><p>Allows you to assign styles to an HTML element using CSS. You can use CSS directly, as in the first example, or you can call a method from the component.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
|
|
||||||
<table class="is-full-width is-fixed-layout">
|
<table class="is-full-width is-fixed-layout">
|
||||||
<tbody><tr>
|
<tbody><tr>
|
||||||
<th>Formularios</th>
|
<th>Forms</th>
|
||||||
<th><p><code>import { FormsModule } from '@angular/forms';</code>
|
<th><p><code>import { FormsModule } from '@angular/forms';</code>
|
||||||
</p>
|
</p>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code><input <b>[(ngModel)]</b>="userName"></code></td>
|
<td><code><input <b>[(ngModel)]</b>="userName"></code></td>
|
||||||
<td><p>Provee two-way data-binding, conversión y validación para controles de formulario.</p>
|
<td><p>Provides two-way data-binding, parsing, and validation for form controls.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
|
|
||||||
<table class="is-full-width is-fixed-layout">
|
<table class="is-full-width is-fixed-layout">
|
||||||
<tbody><tr>
|
<tbody><tr>
|
||||||
<th>Decoradores de clases</th>
|
<th>Class decorators</th>
|
||||||
<th><p><code>import { Directive, ... } from '@angular/core';</code>
|
<th><p><code>import { Directive, ... } from '@angular/core';</code>
|
||||||
</p>
|
</p>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code><b>@Component({...})</b><br>class MyComponent() {}</code></td>
|
<td><code><b>@Component({...})</b><br>class MyComponent() {}</code></td>
|
||||||
<td><p>Declara que una clase es un componente y proporciona metadatos sobre el componente.</p>
|
<td><p>Declares that a class is a component and provides metadata about the component.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>@Directive({...})</b><br>class MyDirective() {}</code></td>
|
<td><code><b>@Directive({...})</b><br>class MyDirective() {}</code></td>
|
||||||
<td><p>Declara que una clase es una directiva y proporciona metadatos sobre la directiva.</p>
|
<td><p>Declares that a class is a directive and provides metadata about the directive.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>@Pipe({...})</b><br>class MyPipe() {}</code></td>
|
<td><code><b>@Pipe({...})</b><br>class MyPipe() {}</code></td>
|
||||||
<td><p>Declara que una clase es una pipe y proporciona metadatos sobre la pipe.</p>
|
<td><p>Declares that a class is a pipe and provides metadata about the pipe.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>@Injectable()</b><br>class MyService() {}</code></td>
|
<td><code><b>@Injectable()</b><br>class MyService() {}</code></td>
|
||||||
<td><p>Declara que una clase puede ser proporcionada e inyectada por otras clases. Sin este decorador, el compilador no generará suficientes metadatos para permitir que la clase se cree correctamente cuando se inyecta en alguna parte.</p>
|
<td><p>Declares that a class can be provided and injected by other classes. Without this decorator, the compiler won't generate enough metadata to allow the class to be created properly when it's injected somewhere.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
|
|
||||||
<table class="is-full-width is-fixed-layout">
|
<table class="is-full-width is-fixed-layout">
|
||||||
<tbody><tr>
|
<tbody><tr>
|
||||||
<th>Configuración de Directiva</th>
|
<th>Directive configuration</th>
|
||||||
<th><p><code>@Directive({ property1: value1, ... })</code>
|
<th><p><code>@Directive({ property1: value1, ... })</code>
|
||||||
</p>
|
</p>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code><b>selector:</b> '.cool-button:not(a)'</code></td>
|
<td><code><b>selector:</b> '.cool-button:not(a)'</code></td>
|
||||||
<td><p>Especifica un selector CSS que identifica esta directiva dentro de una plantilla. Los selectores compatibles incluyen <code>element</code>,
|
<td><p>Specifies a CSS selector that identifies this directive within a template. Supported selectors include <code>element</code>,
|
||||||
<code>[attribute]</code>, <code>.class</code>, and <code>:not()</code>.</p>
|
<code>[attribute]</code>, <code>.class</code>, and <code>:not()</code>.</p>
|
||||||
<p>No soporta selectores de relación padre-hijo.</p>
|
<p>Does not support parent-child relationship selectors.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>providers:</b> [MyService, { provide: ... }]</code></td>
|
<td><code><b>providers:</b> [MyService, { provide: ... }]</code></td>
|
||||||
<td><p>Lista de proveedores de inyección de dependencia para esta directiva y sus hijos.</p>
|
<td><p>List of dependency injection providers for this directive and its children.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
|
|
||||||
<table class="is-full-width is-fixed-layout">
|
<table class="is-full-width is-fixed-layout">
|
||||||
<tbody><tr>
|
<tbody><tr>
|
||||||
<th>Configuración de Componente</th>
|
<th>Component configuration</th>
|
||||||
<th><p>
|
<th><p>
|
||||||
<code>@Component</code> extiende <code>@Directive</code>,
|
<code>@Component</code> extends <code>@Directive</code>,
|
||||||
entonces la configuración de <code>@Directive</code> se aplica también a los componentes</p>
|
so the <code>@Directive</code> configuration applies to components as well</p>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code><b>moduleId:</b> module.id</code></td>
|
<td><code><b>moduleId:</b> module.id</code></td>
|
||||||
<td><p>Si está presente, el <code>templateUrl</code> y <code>styleUrl</code> se resuelven en relación con el componente.</p>
|
<td><p>If set, the <code>templateUrl</code> and <code>styleUrl</code> are resolved relative to the component.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>viewProviders:</b> [MyService, { provide: ... }]</code></td>
|
<td><code><b>viewProviders:</b> [MyService, { provide: ... }]</code></td>
|
||||||
<td><p>Lista de proveedores de inyección de dependencias en la vista de este componente.</p>
|
<td><p>List of dependency injection providers scoped to this component's view.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>template:</b> 'Hola {{name}}'<br><b>templateUrl:</b> 'my-component.html'</code></td>
|
<td><code><b>template:</b> 'Hello {{name}}'<br><b>templateUrl:</b> 'my-component.html'</code></td>
|
||||||
<td><p>Plantilla en línea o URL de plantilla externa de la vista del componente.</p>
|
<td><p>Inline template or external template URL of the component's view.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>styles:</b> ['.primary {color: red}']<br><b>styleUrls:</b> ['my-component.css']</code></td>
|
<td><code><b>styles:</b> ['.primary {color: red}']<br><b>styleUrls:</b> ['my-component.css']</code></td>
|
||||||
<td><p>Lista de estilos CSS en línea o URL de hojas de estilo externas para estilar la vista del componente.</p>
|
<td><p>List of inline CSS styles or external stylesheet URLs for styling the component’s view.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
|
|
||||||
<table class="is-full-width is-fixed-layout">
|
<table class="is-full-width is-fixed-layout">
|
||||||
<tbody><tr>
|
<tbody><tr>
|
||||||
<th>Decoradores para los campos de la clase para directivas y componentes.</th>
|
<th>Class field decorators for directives and components</th>
|
||||||
<th><p><code>import { Input, ... } from '@angular/core';</code>
|
<th><p><code>import { Input, ... } from '@angular/core';</code>
|
||||||
</p>
|
</p>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code><b>@Input()</b> myProperty;</code></td>
|
<td><code><b>@Input()</b> myProperty;</code></td>
|
||||||
<td><p>Declara una propiedad de entrada (input) que puede actualizar mediante el enlace de propiedad (property binding) (ejemplo:
|
<td><p>Declares an input property that you can update via property binding (example:
|
||||||
<code><my-cmp [myProperty]="someExpression"></code>).</p>
|
<code><my-cmp [myProperty]="someExpression"></code>).</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>@Output()</b> myEvent = new EventEmitter();</code></td>
|
<td><code><b>@Output()</b> myEvent = new EventEmitter();</code></td>
|
||||||
<td><p>Declara una propiedad de salida (output) que dispara eventos a los que puedes suscribirse con un enlace de evento (event binding) (ejemplo: <code><my-cmp (myEvent)="doSomething()"></code>).</p>
|
<td><p>Declares an output property that fires events that you can subscribe to with an event binding (example: <code><my-cmp (myEvent)="doSomething()"></code>).</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>@HostBinding('class.valid')</b> isValid;</code></td>
|
<td><code><b>@HostBinding('class.valid')</b> isValid;</code></td>
|
||||||
<td><p>Vincula una propiedad del elemento anfitrión (aquí, la clase CSS <code>valid</code>) a una propiedad de directiva/componente (<code>isValid</code>).</p>
|
<td><p>Binds a host element property (here, the CSS class <code>valid</code>) to a directive/component property (<code>isValid</code>).</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>@HostListener('click', ['$event'])</b> onClick(e) {...}</code></td>
|
<td><code><b>@HostListener('click', ['$event'])</b> onClick(e) {...}</code></td>
|
||||||
<td><p>Se suscribe a un evento del elemento anfitrión (<code>click</code>) con un método de directiva/componente (<code>onClick</code>), opcionalmente, pasando un argumento (<code>$event</code>).</p>
|
<td><p>Subscribes to a host element event (<code>click</code>) with a directive/component method (<code>onClick</code>), optionally passing an argument (<code>$event</code>).</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>@ContentChild(myPredicate)</b> myChildComponent;</code></td>
|
<td><code><b>@ContentChild(myPredicate)</b> myChildComponent;</code></td>
|
||||||
<td><p>Vincula el primer resultado de la consulta de contenido del componente (<code>myPredicate</code>) a una propiedad (<code>myChildComponent</code>) de la clase.</p>
|
<td><p>Binds the first result of the component content query (<code>myPredicate</code>) to a property (<code>myChildComponent</code>) of the class.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>@ContentChildren(myPredicate)</b> myChildComponents;</code></td>
|
<td><code><b>@ContentChildren(myPredicate)</b> myChildComponents;</code></td>
|
||||||
<td><p>Vincula los resultados de la consulta de contenido del componente (<code>myPredicate</code>) a una propiedad (<code>myChildComponents</code>) de la clase.</p>
|
<td><p>Binds the results of the component content query (<code>myPredicate</code>) to a property (<code>myChildComponents</code>) of the class.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>@ViewChild(myPredicate)</b> myChildComponent;</code></td>
|
<td><code><b>@ViewChild(myPredicate)</b> myChildComponent;</code></td>
|
||||||
<td><p>Vincula el primer resultado de la consulta de vista del componente (<code>myPredicate</code>) a una propiedad (<code>myChildComponent</code>) de la clase. No disponible para directivas.</p>
|
<td><p>Binds the first result of the component view query (<code>myPredicate</code>) to a property (<code>myChildComponent</code>) of the class. Not available for directives.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>@ViewChildren(myPredicate)</b> myChildComponents;</code></td>
|
<td><code><b>@ViewChildren(myPredicate)</b> myChildComponents;</code></td>
|
||||||
<td><p>Vincula los resultados de la consulta de vista del componente (<code>myPredicate</code>) a una propiedad (<code>myChildComponents</code>) de la clase. No disponible para directivas.</p>
|
<td><p>Binds the results of the component view query (<code>myPredicate</code>) to a property (<code>myChildComponents</code>) of the class. Not available for directives.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
|
|
||||||
<table class="is-full-width is-fixed-layout">
|
<table class="is-full-width is-fixed-layout">
|
||||||
<tbody><tr>
|
<tbody><tr>
|
||||||
|
<th>Directive and component change detection and lifecycle hooks</th>
|
||||||
<th>Detección de cambios (change detection) y ciclos de vida (lifecycle hooks) en directivas y componentes</th>
|
<th><p>(implemented as class methods)
|
||||||
<th><p>(implementado como métodos de clase)
|
|
||||||
</p>
|
</p>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code><b>constructor(myService: MyService, ...)</b> { ... }</code></td>
|
<td><code><b>constructor(myService: MyService, ...)</b> { ... }</code></td>
|
||||||
<td><p>Se llama antes que cualquier ciclo de vida. Úselo para inyectar dependencias, pero evite cualquier trabajo serio aquí.</p>
|
<td><p>Called before any other lifecycle hook. Use it to inject dependencies, but avoid any serious work here.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>ngOnChanges(changeRecord)</b> { ... }</code></td>
|
<td><code><b>ngOnChanges(changeRecord)</b> { ... }</code></td>
|
||||||
<td><p>Se llama después de cada cambio en las propiedades de entrada (input) y antes de procesar contenido o vistas de hijos.</p>
|
<td><p>Called after every change to input properties and before processing content or child views.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>ngOnInit()</b> { ... }</code></td>
|
<td><code><b>ngOnInit()</b> { ... }</code></td>
|
||||||
<td><p>Se llama después del constructor, inicializando propiedades de entrada (input), y la primera llamada a <code>ngOnChanges</code>.</p>
|
<td><p>Called after the constructor, initializing input properties, and the first call to <code>ngOnChanges</code>.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>ngDoCheck()</b> { ... }</code></td>
|
<td><code><b>ngDoCheck()</b> { ... }</code></td>
|
||||||
<td><p>Se llama cada vez que se verifican las propiedades de entrada (input) de un componente o una directiva. Úselo para extender la detección de cambios (change detection) realizando una verificación personalizada.</p>
|
<td><p>Called every time that the input properties of a component or a directive are checked. Use it to extend change detection by performing a custom check.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>ngAfterContentInit()</b> { ... }</code></td>
|
<td><code><b>ngAfterContentInit()</b> { ... }</code></td>
|
||||||
<td><p>Se llama después de <code>ngOnInit</code> cuando el contenido del componente o directiva ha sido inicializado.</p>
|
<td><p>Called after <code>ngOnInit</code> when the component's or directive's content has been initialized.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>ngAfterContentChecked()</b> { ... }</code></td>
|
<td><code><b>ngAfterContentChecked()</b> { ... }</code></td>
|
||||||
<td><p>Se llama después de cada verificación del contenido del componente o directiva.</p>
|
<td><p>Called after every check of the component's or directive's content.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>ngAfterViewInit()</b> { ... }</code></td>
|
<td><code><b>ngAfterViewInit()</b> { ... }</code></td>
|
||||||
<td><p>Se llama después de <code>ngAfterContentInit</code> cuando las vistas del componente y las vistas hijas / la vista en la que se encuentra una directiva ha sido inicializado.</p>
|
<td><p>Called after <code>ngAfterContentInit</code> when the component's views and child views / the view that a directive is in has been initialized.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>ngAfterViewChecked()</b> { ... }</code></td>
|
<td><code><b>ngAfterViewChecked()</b> { ... }</code></td>
|
||||||
<td><p>Se llama después de cada verificación de las vistas del componentes y las vistas hijas / la vista en la que se encuentra una directiva.</p>
|
<td><p>Called after every check of the component's views and child views / the view that a directive is in.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>ngOnDestroy()</b> { ... }</code></td>
|
<td><code><b>ngOnDestroy()</b> { ... }</code></td>
|
||||||
<td><p>Se llama una vez, antes de que la instancia se destruya.</p>
|
<td><p>Called once, before the instance is destroyed.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
|
|
||||||
<table class="is-full-width is-fixed-layout">
|
<table class="is-full-width is-fixed-layout">
|
||||||
<tbody><tr>
|
<tbody><tr>
|
||||||
<th>Configuración de inyección de dependencia</th>
|
<th>Dependency injection configuration</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>{ <b>provide</b>: MyService, <b>useClass</b>: MyMockService }</code></td>
|
<td><code>{ <b>provide</b>: MyService, <b>useClass</b>: MyMockService }</code></td>
|
||||||
<td><p>Establece o sobre-escribe el proveedor para <code>MyService</code> en la clase <code>MyMockService</code>.</p>
|
<td><p>Sets or overrides the provider for <code>MyService</code> to the <code>MyMockService</code> class.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code>{ <b>provide</b>: MyService, <b>useFactory</b>: myFactory }</code></td>
|
<td><code>{ <b>provide</b>: MyService, <b>useFactory</b>: myFactory }</code></td>
|
||||||
<td><p>Establece o sobre-escribe el proveedor para <code>MyService</code> en la factoría de función <code>myFactory</code>.</p>
|
<td><p>Sets or overrides the provider for <code>MyService</code> to the <code>myFactory</code> factory function.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code>{ <b>provide</b>: MyValue, <b>useValue</b>: 41 }</code></td>
|
<td><code>{ <b>provide</b>: MyValue, <b>useValue</b>: 41 }</code></td>
|
||||||
<td><p>Establece o sobre-escribe el proveedor para <code>MyValue</code> al valor <code>41</code>.</p>
|
<td><p>Sets or overrides the provider for <code>MyValue</code> to the value <code>41</code>.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
|
|
||||||
<table class="is-full-width is-fixed-layout">
|
<table class="is-full-width is-fixed-layout">
|
||||||
<tbody><tr>
|
<tbody><tr>
|
||||||
<th>Enrutamiento y navegación</th>
|
<th>Routing and navigation</th>
|
||||||
<th><p><code>import { Routes, RouterModule, ... } from '@angular/router';</code>
|
<th><p><code>import { Routes, RouterModule, ... } from '@angular/router';</code>
|
||||||
</p>
|
</p>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>const routes: <b>Routes</b> = [<br> { path: '', component: HomeComponent },<br> { path: 'path/:routeParam', component: MyComponent },<br> { path: 'staticPath', component: ... },<br> { path: '**', component: ... },<br> { path: 'oldPath', redirectTo: '/staticPath' },<br> { path: ..., component: ..., data: { message: 'Custom' } }<br>]);<br><br>const routing = RouterModule.forRoot(routes);</code></td>
|
<td><code>const routes: <b>Routes</b> = [<br> { path: '', component: HomeComponent },<br> { path: 'path/:routeParam', component: MyComponent },<br> { path: 'staticPath', component: ... },<br> { path: '**', component: ... },<br> { path: 'oldPath', redirectTo: '/staticPath' },<br> { path: ..., component: ..., data: { message: 'Custom' } }<br>]);<br><br>const routing = RouterModule.forRoot(routes);</code></td>
|
||||||
<td><p>Configura rutas para la aplicación. Soporta rutas estáticas, parametrizadas, de redireccionamiento y comodines. También soporta datos de ruta personalizados y los resuelve.</p>
|
<td><p>Configures routes for the application. Supports static, parameterized, redirect, and wildcard routes. Also supports custom route data and resolve.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><br><<b>router-outlet</b>></<b>router-outlet</b>><br><<b>router-outlet</b> name="aux"></<b>router-outlet</b>><br></code></td>
|
<td><code><br><<b>router-outlet</b>></<b>router-outlet</b>><br><<b>router-outlet</b> name="aux"></<b>router-outlet</b>><br></code></td>
|
||||||
<td><p>Marca la ubicación para cargar el componente de la ruta activa.</p>
|
<td><p>Marks the location to load the component of the active route.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><br><a routerLink="/path"><br><a <b>[routerLink]</b>="[ '/path', routeParam ]"><br><a <b>[routerLink]</b>="[ '/path', { matrixParam: 'value' } ]"><br><a <b>[routerLink]</b>="[ '/path' ]" [queryParams]="{ page: 1 }"><br><a <b>[routerLink]</b>="[ '/path' ]" fragment="anchor"><br></code></td>
|
<td><code><br><a routerLink="/path"><br><a <b>[routerLink]</b>="[ '/path', routeParam ]"><br><a <b>[routerLink]</b>="[ '/path', { matrixParam: 'value' } ]"><br><a <b>[routerLink]</b>="[ '/path' ]" [queryParams]="{ page: 1 }"><br><a <b>[routerLink]</b>="[ '/path' ]" fragment="anchor"><br></code></td>
|
||||||
<td><p>Crea un enlace a una vista diferente basada en una instrucción de ruta que consta de un camino de de ruta, parámetros obligatorios y opcionales, parámetros de consulta y un fragmento. Para navegar a un camino de ruta, usa el prefijo <code>/</code>; para una ruta hija, usa el prefijo <code>./</code>; para un padre o hermano, usa el prefijo <code>../</code>.</p>
|
<td><p>Creates a link to a different view based on a route instruction consisting of a route path, required and optional parameters, query parameters, and a fragment. To navigate to a root route, use the <code>/</code> prefix; for a child route, use the <code>./</code>prefix; for a sibling or parent, use the <code>../</code> prefix.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><a [routerLink]="[ '/path' ]" routerLinkActive="active"></code></td>
|
<td><code><a [routerLink]="[ '/path' ]" routerLinkActive="active"></code></td>
|
||||||
<td><p>Las clases proporcionadas se agregan al elemento cuando el <code>routerLink</code> se convierte en la ruta activa actual.</p>
|
<td><p>The provided classes are added to the element when the <code>routerLink</code> becomes the current active route.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code>class <b>CanActivate</b>Guard implements <b>CanActivate</b> {<br> canActivate(<br> route: ActivatedRouteSnapshot,<br> state: RouterStateSnapshot<br> ): Observable<boolean|UrlTree>|Promise<boolean|UrlTree>|boolean|UrlTree { ... }<br>}<br><br>{ path: ..., canActivate: [<b>CanActivate</b>Guard] }</code></td>
|
<td><code>class <b>CanActivate</b>Guard implements <b>CanActivate</b> {<br> canActivate(<br> route: ActivatedRouteSnapshot,<br> state: RouterStateSnapshot<br> ): Observable<boolean|UrlTree>|Promise<boolean|UrlTree>|boolean|UrlTree { ... }<br>}<br><br>{ path: ..., canActivate: [<b>CanActivate</b>Guard] }</code></td>
|
||||||
<td><p>Una interfaz para definir una clase que el enrutador debe llamar primero para determinar si debe activar este componente. Debe devolver un boolean|UrlTree o un Observable/Promise que se resuelba en un boolean|UrlTree.</p>
|
<td><p>An interface for defining a class that the router should call first to determine if it should activate this component. Should return a boolean|UrlTree or an Observable/Promise that resolves to a boolean|UrlTree.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code>class <b>CanDeactivate</b>Guard implements <b>CanDeactivate</b><T> {<br> canDeactivate(<br> component: T,<br> route: ActivatedRouteSnapshot,<br> state: RouterStateSnapshot<br> ): Observable<boolean|UrlTree>|Promise<boolean|UrlTree>|boolean|UrlTree { ... }<br>}<br><br>{ path: ..., canDeactivate: [<b>CanDeactivate</b>Guard] }</code></td>
|
<td><code>class <b>CanDeactivate</b>Guard implements <b>CanDeactivate</b><T> {<br> canDeactivate(<br> component: T,<br> route: ActivatedRouteSnapshot,<br> state: RouterStateSnapshot<br> ): Observable<boolean|UrlTree>|Promise<boolean|UrlTree>|boolean|UrlTree { ... }<br>}<br><br>{ path: ..., canDeactivate: [<b>CanDeactivate</b>Guard] }</code></td>
|
||||||
<td><p>Una interfaz para definir una clase que el enrutador debería llamar primero para determinar si debería desactivar este componente después de una navegación. Debe devolver un boolean|UrlTree o un Observable/Promise que se resuelva a boolean|UrlTree.</p>
|
<td><p>An interface for defining a class that the router should call first to determine if it should deactivate this component after a navigation. Should return a boolean|UrlTree or an Observable/Promise that resolves to a boolean|UrlTree.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code>class <b>CanActivateChild</b>Guard implements <b>CanActivateChild</b> {<br> canActivateChild(<br> route: ActivatedRouteSnapshot,<br> state: RouterStateSnapshot<br> ): Observable<boolean|UrlTree>|Promise<boolean|UrlTree>|boolean|UrlTree { ... }<br>}<br><br>{ path: ..., canActivateChild: [CanActivateGuard],<br> children: ... }</code></td>
|
<td><code>class <b>CanActivateChild</b>Guard implements <b>CanActivateChild</b> {<br> canActivateChild(<br> route: ActivatedRouteSnapshot,<br> state: RouterStateSnapshot<br> ): Observable<boolean|UrlTree>|Promise<boolean|UrlTree>|boolean|UrlTree { ... }<br>}<br><br>{ path: ..., canActivateChild: [CanActivateGuard],<br> children: ... }</code></td>
|
||||||
<td><p>Una interfaz para definir una clase que el enrutador debe llamar primero para determinar si debe activar la ruta hija. Debe devolver un boolean|UrlTree o un Observable/Promise que se resuelva en un boolean|UrlTree.</p>
|
<td><p>An interface for defining a class that the router should call first to determine if it should activate the child route. Should return a boolean|UrlTree or an Observable/Promise that resolves to a boolean|UrlTree.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code>class <b>Resolve</b>Guard implements <b>Resolve</b><T> {<br> resolve(<br> route: ActivatedRouteSnapshot,<br> state: RouterStateSnapshot<br> ): Observable<any>|Promise<any>|any { ... }<br>}<br><br>{ path: ..., resolve: [<b>Resolve</b>Guard] }</code></td>
|
<td><code>class <b>Resolve</b>Guard implements <b>Resolve</b><T> {<br> resolve(<br> route: ActivatedRouteSnapshot,<br> state: RouterStateSnapshot<br> ): Observable<any>|Promise<any>|any { ... }<br>}<br><br>{ path: ..., resolve: [<b>Resolve</b>Guard] }</code></td>
|
||||||
<td><p>Una interfaz para definir una clase que el enrutador debe llamar primero para resolver los datos de la ruta antes de representar la ruta. Debe devolver un valor o un Observable/Promise que se resuelva en un valor.</p>
|
<td><p>An interface for defining a class that the router should call first to resolve route data before rendering the route. Should return a value or an Observable/Promise that resolves to a value.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code>class <b>CanLoad</b>Guard implements <b>CanLoad</b> {<br> canLoad(<br> route: Route<br> ): Observable<boolean|UrlTree>|Promise<boolean|UrlTree>|boolean|UrlTree { ... }<br>}<br><br>{ path: ..., canLoad: [<b>CanLoad</b>Guard], loadChildren: ... }</code></td>
|
<td><code>class <b>CanLoad</b>Guard implements <b>CanLoad</b> {<br> canLoad(<br> route: Route<br> ): Observable<boolean|UrlTree>|Promise<boolean|UrlTree>|boolean|UrlTree { ... }<br>}<br><br>{ path: ..., canLoad: [<b>CanLoad</b>Guard], loadChildren: ... }</code></td>
|
||||||
<td><p>Una interfaz para definir una clase a la que el enrutador debe llamar primero para verificar si el módulo perezoso cargado (lazy loaded module) debe cargarse. Debe devolver un boolean|UrlTree o un Observable/Promise que se resuelva en un boolean|UrlTree.</p>
|
<td><p>An interface for defining a class that the router should call first to check if the lazy loaded module should be loaded. Should return a boolean|UrlTree or an Observable/Promise that resolves to a boolean|UrlTree.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
|
@ -1,247 +0,0 @@
|
|||||||
# Creando librerías
|
|
||||||
|
|
||||||
Está pagina provee una vista conceptual de como puedes crear y publicar nuevas librerías para extender las funcionalidades de Angular.
|
|
||||||
|
|
||||||
Si necesitas resolver el mismo problema en mas de una aplicación (o quiere compartir tu solución con otros desarrolladores), tienes un candidato para una librería.
|
|
||||||
Un ejemplo simple puede ser un botón que envía a los usuarios hacia el sitio web de tu empresa, que sería incluido en todas las aplicaciones que tu empresa crea.
|
|
||||||
|
|
||||||
## Empezando
|
|
||||||
|
|
||||||
Usa el Angular CLI para generar un nuevo esqueleto de librería, en nuevo espacio de trabajo con los siguiente comandos.
|
|
||||||
|
|
||||||
<code-example language="bash">
|
|
||||||
ng new my-workspace --create-application=false
|
|
||||||
cd my-workspace
|
|
||||||
ng generate library my-lib
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
El comando `ng generate` crea la carpeta `projects/my-lib` en el espacio de trabajo, que contiene un componente y un servicio dentro de un NgModule.
|
|
||||||
|
|
||||||
<div class="alert is-helpful">
|
|
||||||
|
|
||||||
Para más detalles sobre como una librería es estructurada, refiérase a los [Archivos de Librería](guide/file-structure#library-project-files) en la sección de [Guía de estructura de archivos](guide/file-structure).
|
|
||||||
|
|
||||||
Puedes usar un modelo de monorepo para usar el mismo espacio de trabajo con multiples proyectos. Véase [Configuración para espacio de trabajo multiproyecto](guide/file-structure#multiple-projects).
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
Cuando se genera una nueva librería, el archivo de configuración del espacio de trabajo, `angular.json`, es actualizado con un proyecto de tipo 'library'.
|
|
||||||
|
|
||||||
<code-example format="json">
|
|
||||||
"projects": {
|
|
||||||
...
|
|
||||||
"my-lib": {
|
|
||||||
"root": "projects/my-lib",
|
|
||||||
"sourceRoot": "projects/my-lib/src",
|
|
||||||
"projectType": "library",
|
|
||||||
"prefix": "lib",
|
|
||||||
"architect": {
|
|
||||||
"build": {
|
|
||||||
"builder": "@angular-devkit/build-ng-packagr:build",
|
|
||||||
...
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
Puedes crear, probar y comprobar con los comandos de CLI:
|
|
||||||
|
|
||||||
<code-example language="bash">
|
|
||||||
ng build my-lib
|
|
||||||
ng test my-lib
|
|
||||||
ng lint my-lib
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
Puedes notar que el constructor configurado para el proyecto es diferente que el constructor por defecto para proyectos.
|
|
||||||
El constructor, entre otras cosas, asegura que la librería siempre este construida con el [compilador AOT](guide/aot-compiler), sin la necesidad de especificar la bandera `--prod`.
|
|
||||||
|
|
||||||
Para hacer el código de la librería reusable debes definir una API pública para ella. Esta "capa de usuario" define que esta disponible para los consumidores de tu librería. Un usuario de tu librería debería ser capaz de acceder a la funcionalidad publica (como NgModules, servicios, proveedores y en general funciones de utilidad) mediante una sola ruta.
|
|
||||||
|
|
||||||
La API pública para tu librería es mantenida en el archivo `public-api.ts` en tu carpeta de librería.
|
|
||||||
Cualquier cosa exportada desde este archivo se hace publica cuando tu librería es importada dentro de una aplicación.
|
|
||||||
Usa un NgModule para exponer los servicios y componentes.
|
|
||||||
|
|
||||||
Tu libería debería suministrar documentatión (típicamente en el archivo README) para la instalación y mantenimiento.
|
|
||||||
|
|
||||||
## Refactorizando partes de una app dentro de un librería
|
|
||||||
|
|
||||||
Para hacer tu solución reusable, necesitas ajustarla para que no dependa del código específico de la aplicación.
|
|
||||||
Aquí algunas cosas para considerar al migrar la funcionalidad de la aplicación a una librería.
|
|
||||||
|
|
||||||
* Declaraciones tales como componentes y pipes deberían ser diseñados como 'stateless' (sin estado), lo que significa que no dependen ni alteran variables externas. Si tu dependes del estado, necesitas evaluar cada caso y decidir el estado de la aplicación o el estado que la aplicación administraría.
|
|
||||||
|
|
||||||
* Cualquier observable al cual los componentes se suscriban internamente deberían ser limpiados y desechados durante el ciclo de vida de esos componentes.
|
|
||||||
|
|
||||||
* Los componentes deberían exponer sus interacciones a través de 'inputs' para proporcionar contexto y 'outputs' para comunicar los eventos hacia otros componentes.
|
|
||||||
|
|
||||||
* Verifique todas las dependencias internas.
|
|
||||||
* Para clases personalizadas o interfaces usadas en componentes o servicios, verifique si dependen en clases adicionales o interfaces que también necesiten ser migradas.
|
|
||||||
* Del mismo modo, si tu código de librería depende de un servicio, este servicio necesita ser migrado.
|
|
||||||
* Si tu código de librería o sus plantillas dependen de otras librerías (como Angular Material), debes configurar tu librería con esas dependencias.
|
|
||||||
|
|
||||||
* Considere como proporcionar servicios a las aplicaciones cliente.
|
|
||||||
|
|
||||||
* Los servicios deberían declarar sus propios proveedores (en lugar de declarar los proveedores en el NgModule o en un componente). Esto le permite al compilador dejar los servicios fuera del 'bundle' si este nunca fue inyectado dentro de la aplicación que importa la librería, véase [proveedores Tree-shakable](guide/dependency-injection-providers#tree-shakable-providers)
|
|
||||||
* Si registras proveedores globales o compartes proveedores a través de múltiples NgModules, usa el [`forRoot()` y `forChild()` como patrones de diseño](guide/singleton-services) proporcionados por el [RouterModule](api/router/RouterModule).
|
|
||||||
* Si tu librería proporciona servicios opcionales que podrían no ser usados por todos las aplicaciones cliente, soporte apropiadamente el 'tree-shaking' para esos casos usando el [patrón de diseño de token ligero](guide/lightweight-injection-tokens).
|
|
||||||
|
|
||||||
{@a integrating-with-the-cli}
|
|
||||||
|
|
||||||
## Integración con el CLI usando generación de código con los schematics.
|
|
||||||
|
|
||||||
Comúnmente una librería incluye *código reusable* que define componentes, servicios y otros Artefactos de Angular (pipes, directivas y etc.) que tu simplemente importas a un proyecto.
|
|
||||||
Una librería es empaquetada dentro de un paquete npm para publicar y compartir.
|
|
||||||
|
|
||||||
Este paquete también puede incluir [schematics](guide/glossary#schematic) que proporciona instrucciones para generar o transformar código directamente un tu proyecto, de la misma forma que el CLI crea un nuevo componente genérico con `ng generate component`.
|
|
||||||
|
|
||||||
Un 'schematic' empaquetado con una librería puede por ejemplo proporcionar al Angular CLI la información que necesita para generar un componente que configura y usa una particular característica o conjunto de características, definido en la librería.
|
|
||||||
|
|
||||||
Un ejemplo de esto es el 'schematic' de navegación de Angular Material el cual configura los CDK's `BreakpointObserver` y lo usa con los componentes `MatSideNav` y `MatToolbar` de Angular Material.
|
|
||||||
|
|
||||||
Puedes crear e incluir los siguientes tipos de 'schematics'.
|
|
||||||
|
|
||||||
* Incluye un 'schematic' de instalación para que con `ng add` puedas agregar tu libería a un proyecto.
|
|
||||||
|
|
||||||
* Incluye un 'schematic' de generación en tu librería para que con `ng generate` puedas hacer scaffolding de sus artefactos (componentes, servicios, pruebas y etc) en un proyecto.
|
|
||||||
|
|
||||||
* Incluye un 'schematic' de actualización para que con `ng update` puedas actualizar las dependencias de tu librería y proporcionar migraciones para cambios importantes en un nuevo release.
|
|
||||||
|
|
||||||
Lo que incluya tu librería depende de tu tarea.
|
|
||||||
Por ejemplo, podrías definir un 'schematic' para crear un desplegable (dropdown) que esta pre-poblado con datos para mostrar como agregarlo a una aplicación.
|
|
||||||
Si quieres un desplegable (dropdown) que contendrá valores diferentes cada vez, tu librería podría definir un 'schematic' para crearlo con una configuración dada. Los desarrolladores podrán entonces usar `ng generate` para configurar una instancia para sus propias aplicaciones.
|
|
||||||
|
|
||||||
Supón que quieres leer un archivo de configuración y entonces generar una formulario con base a la configuración.
|
|
||||||
Si este formulario necesita personalización adicional por parte del desarrollador que esta usando tu librería, esto podría trabajar mejor como un 'schematic'.
|
|
||||||
Sin embargo, si el formulario siempre será el mismo y no necesita de mucha personalización por parte de los desarrolladores, entonces podría crear un componente dinámico que tome la configuración y genere el formulario.
|
|
||||||
En general, entre más compleja sea personalización, la más util será en enfoque de un 'schematic'.
|
|
||||||
|
|
||||||
Para aprender más, véase [Vista general de Schematics](guide/schematics)
|
|
||||||
|
|
||||||
## Publicando tu librería
|
|
||||||
|
|
||||||
Usa el Angular CLI y el gestor de paquetes npm para construir y publicar tu librería como un paquete npm.
|
|
||||||
|
|
||||||
Antes de publicar una librería a NPM, constrúyela usando la bandera `--prod` la cúal usará el compilador y tiempo de ejecución (runtime) más antiguos como 'View Engine' en vez de 'Ivy'.
|
|
||||||
|
|
||||||
<code-example language="bash">
|
|
||||||
ng build my-lib --prod
|
|
||||||
cd dist/my-lib
|
|
||||||
npm publish
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
Si nunca has publicado un paquete en npm antes, tu debes crear un cuenta. Lee más en [Publicando paquetes npm](https://docs.npmjs.com/getting-started/publishing-npm-packages).
|
|
||||||
|
|
||||||
<div class="alert is-important">
|
|
||||||
|
|
||||||
Por ahora, no es recomendando publicar librerías con Ivy hacia NPM por que Ivy genera código que no es retrocompatible con 'View Engine', entonces las aplicaciones usando 'View Engine' no podrán consumirlas. Además, las instrucciones internas de IVY no son estables aun, lo cual puede romper potencialmente a los consumidores que usan una diferente versión de Angular a la que uso para construir la libería.
|
|
||||||
|
|
||||||
Cuando una librería publicada es usada en una aplicación con Ivy, el Angular CLI automáticamente la convertirá a Ivy usando una herramienta conocida como el compilador de compatibilidad Angular (`ngcc`). Por lo tanto, publicar tus librerías usado el compilador 'View Engine' garantiza que ellas puede ser consumidas de forma transparente por ambos motores 'View Engine' y 'Ivy'.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{@a lib-assets}
|
|
||||||
|
|
||||||
## Gestionando activos (assets) en una librería.
|
|
||||||
|
|
||||||
Desde la versión 9.x de la herramienta [ng-packagr](https://github.com/ng-packagr/ng-packagr/blob/master/README.md), puedes configurar la herramienta para que automáticamente copie los activos (assets) dentro de el paquete de librería como parte del proceso de construcción.
|
|
||||||
Puedes usar esta característica cuando tu librería necesite publicar archivos de temas opcionales, funciones de Sass o documentación (como un registro de cambios 'changelog').
|
|
||||||
|
|
||||||
* Aprende como [copiar activos (assets) dentro de tu librería como parte de la construcción](https://github.com/ng-packagr/ng-packagr/blob/master/docs/copy-assets.md).
|
|
||||||
|
|
||||||
* Aprende más acerca de como usar la herramienta para [incrustar activos (assets) de CSS](https://github.com/ng-packagr/ng-packagr/blob/master/docs/embed-assets-css.md).
|
|
||||||
|
|
||||||
|
|
||||||
## Vinculando librerías
|
|
||||||
|
|
||||||
Mientras trabajas en un librería publicada, puedes usar [npm link](https://docs.npmjs.com/cli/link) para evitar re instalar la librería en cada construcción.
|
|
||||||
|
|
||||||
La librería debe ser reconstruida en cada cambio.
|
|
||||||
Cuando vinculas una librería, asegurate que el paso de construir corra en modo vigía (watch mode) y que el `package.json` de la librería configure los puntos de entrada correctos.
|
|
||||||
Por ejemplo, `main` debería apuntar a un archivo JavaScript, no a un archivo TypeScript.
|
|
||||||
|
|
||||||
## Utiliza el mapeo de rutas de TypeScript por las dependencias de pares.
|
|
||||||
|
|
||||||
Las librerías de Angular deben enumerar todas las dependencias `@angular/*` como dependencias de pares.
|
|
||||||
Esto garantiza que cuando los módulos solicitan Angular, todos ellos obtienen exactamente el mismo módulo.
|
|
||||||
Si tu librería lista `@angular/core` en `dependencies` en vez de en `peerDependencies`, podría obtener un módulo Angular diferente, lo qué haría que tu aplicación se rompiera.
|
|
||||||
|
|
||||||
Cuando desarrollas una librería, tu debes instalar todas las dependencias de pares mediante `devDependencies` para garantizar que la librería compile apropiadamente.
|
|
||||||
Una librería vinculada tendrá su propio conjunto de librerías Angular que usa para construir, ubicados en su carpeta `node_modules`.
|
|
||||||
|
|
||||||
Sin embargo, esto puede causar problemas mientras construyes o corres tu aplicación.
|
|
||||||
|
|
||||||
Para evitar este problema tu puedes usar el mapeo de rutas de TypeScript para indicarle a TypeScript que este debería cargar algunos módulos desde una ubicación especifica.
|
|
||||||
|
|
||||||
Enumera todas las dependencias de pares que tu librería usa en el archivo de configuración `./tsconfig.json` del espacio de trabajo de TypeScript, y apúntalos a la copia local en la carpeta `node_modules` de la aplicación.
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
// ...
|
|
||||||
// paths are relative to `baseUrl` path.
|
|
||||||
"paths": {
|
|
||||||
"@angular/*": [
|
|
||||||
"./node_modules/@angular/*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Este mapeador garantiza que tu librería siempre cargue las copias locales del módulo que necesita.
|
|
||||||
|
|
||||||
|
|
||||||
## Usando tu propia librería en aplicaciones.
|
|
||||||
|
|
||||||
No tienes que publicar tu librería hacia el gestor de paquetes npm para usarla en tus propias aplicaciones, pero tienes que construirla primero.
|
|
||||||
|
|
||||||
Para usar tu propia librería en tu aplicación:
|
|
||||||
|
|
||||||
* Construye la librería. No puedes usar una librería antes que se construya.
|
|
||||||
<code-example language="bash">
|
|
||||||
ng build my-lib
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
* En tus aplicaciones, importa la librería por el nombre:
|
|
||||||
```
|
|
||||||
import { myExport } from 'my-lib';
|
|
||||||
```
|
|
||||||
|
|
||||||
### Construyendo y re construyendo tu librería.
|
|
||||||
|
|
||||||
El paso de construir es importante si no tienes publicada tu librería como un paquete npm y luego ha instalado el paquete de nuevo dentro tu aplicación desde npm.
|
|
||||||
Por ejemplo, si clonas tu repositorio git y corres `npm install`, tu editor mostrará la importación de `my-lib` como perdida si no tienes aun construida tu librería.
|
|
||||||
|
|
||||||
<div class="alert is-helpful">
|
|
||||||
|
|
||||||
Cuando importas algo desde una librería en una aplicación Angular, Angular busca un mapeo entre el nombre de librería y una ubicación en disco.
|
|
||||||
Cuando instalas un paquete de librería, el mapeo esta en la carpeta `node_modules`. Cuando construyes tu propia librería, tiene que encontrar el mapeo en tus rutas de `tsconfig`.
|
|
||||||
|
|
||||||
Generando una librería con el Angular CLI automáticamente agrega su ruta en el archivo `tsconfig`.
|
|
||||||
El Angular CLI usa las rutas `tsconfig` para indicarle al sistema construido donde encontrar la librería.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
Si descubres que los cambios en tu librería no son reflejados en tu aplicación, tu aplicación probablemente esta usando una construcción antigua de la librería.
|
|
||||||
|
|
||||||
Puedes re construir tu librería cada vez que hagas cambios en esta, pero este paso extra toma tiempo.
|
|
||||||
Las *construcciones incrementales* funcionalmente mejoran la experiencia de desarrollo de librerías.
|
|
||||||
Cada vez que un archivo es cambiando una construcción parcial es realizada y esta emite los archivos modificados.
|
|
||||||
|
|
||||||
Las *Construcciones incrementales* puede ser ejecutadas como un proceso en segundo plano en tu entorno de desarrollo. Para aprovechar esta característica agrega la bandera `--watch` al comando de construcción:
|
|
||||||
|
|
||||||
<code-example language="bash">
|
|
||||||
ng build my-lib --watch
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
<div class="alert is-important">
|
|
||||||
|
|
||||||
El comando `build` del CLI utiliza un constructor diferente e invoca una herramienta de construcción diferente para las librerías que para las aplicaciones.
|
|
||||||
|
|
||||||
* El sistema de construcción para aplicaciones, `@angular-devkit/build-angular`, esta basado en `webpack`, y esta incluida en todos los nuevos proyectos de Angular CLI.
|
|
||||||
* El sistema de construcción esta basado en `ng-packagr`. Este es solo agregado en tus dependencias cuando agregas una librería usando `ng generate library my-lib`.
|
|
||||||
|
|
||||||
Los dos sistemas de construcción soportan diferentes cosas e incluso si ellos soportan las mismas cosas, ellos hacen esas cosas de forma diferente.
|
|
||||||
Esto quiere decir que la fuente de TypeScript puede generar en código JavaScript diferente en una librería construida que en una aplicación construida.
|
|
||||||
|
|
||||||
Por esta razón, una aplicación que depende de una librería debería solo usar el mapeo de rutas de TypeScript que apunte a la *librería construida*.
|
|
||||||
El mapeo de rutas de TypeScript no debería apuntar hacia los archivos `.ts` fuente de la librería.
|
|
||||||
|
|
||||||
</div>
|
|
@ -1,13 +1,16 @@
|
|||||||
# Creating libraries
|
# Creating libraries
|
||||||
|
|
||||||
This page provides a conceptual overview of how you can create and publish new libraries to extend Angular functionality.
|
You can create and publish new libraries to extend Angular functionality. If you find that you need to solve the same problem in more than one app (or want to share your solution with other developers), you have a candidate for a library.
|
||||||
|
|
||||||
If you find that you need to solve the same problem in more than one app (or want to share your solution with other developers), you have a candidate for a library.
|
|
||||||
A simple example might be a button that sends users to your company website, that would be included in all apps that your company builds.
|
A simple example might be a button that sends users to your company website, that would be included in all apps that your company builds.
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
<p>For more details on how a library project is structured you can refer the <a href="guide/file-structure#library-project-files">Library Project Files</a></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
Use the Angular CLI to generate a new library skeleton in a new workspace with the following commands.
|
Use the Angular CLI to generate a new library skeleton with the following command:
|
||||||
|
|
||||||
<code-example language="bash">
|
<code-example language="bash">
|
||||||
ng new my-workspace --create-application=false
|
ng new my-workspace --create-application=false
|
||||||
@ -15,18 +18,12 @@ Use the Angular CLI to generate a new library skeleton in a new workspace with t
|
|||||||
ng generate library my-lib
|
ng generate library my-lib
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
The `ng generate` command creates the `projects/my-lib` folder in your workspace, which contains a component and a service inside an NgModule.
|
|
||||||
|
|
||||||
<div class="alert is-helpful">
|
<div class="alert is-helpful">
|
||||||
|
<p>You can use the monorepo model to use the same workspace for multiple projects. See <a href="guide/file-structure#multiple-projects">Setting up for a multi-project workspace</a>.</p>
|
||||||
For more details on how a library project is structured, refer to the [Library project files](guide/file-structure#library-project-files) section of the [Project File Structure guide](guide/file-structure).
|
|
||||||
|
|
||||||
You can use the monorepo model to use the same workspace for multiple projects.
|
|
||||||
See [Setting up for a multi-project workspace](guide/file-structure#multiple-projects).
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
When you generate a new library, the workspace configuration file, `angular.json`, is updated with a project of type 'library'.
|
This creates the `projects/my-lib` folder in your workspace, which contains a component and a service inside an NgModule.
|
||||||
|
The workspace configuration file, `angular.json`, is updated with a project of type 'library'.
|
||||||
|
|
||||||
<code-example format="json">
|
<code-example format="json">
|
||||||
"projects": {
|
"projects": {
|
||||||
@ -72,30 +69,35 @@ Here are some things to consider in migrating application functionality to a lib
|
|||||||
|
|
||||||
* Components should expose their interactions through inputs for providing context, and outputs for communicating events to other components.
|
* Components should expose their interactions through inputs for providing context, and outputs for communicating events to other components.
|
||||||
|
|
||||||
|
* Services should declare their own providers (rather than declaring providers in the NgModule or a component), so that they are *tree-shakable*. This allows the compiler to leave the service out of the bundle if it never gets injected into the application that imports the library. For more about this, see [Tree-shakable providers](guide/dependency-injection-providers#tree-shakable-providers).
|
||||||
|
|
||||||
|
* If you register global service providers or share providers across multiple NgModules, use the [`forRoot()` and `forChild()` patterns](guide/singleton-services) provided by the [RouterModule](api/router/RouterModule).
|
||||||
|
|
||||||
* Check all internal dependencies.
|
* Check all internal dependencies.
|
||||||
* For custom classes or interfaces used in components or service, check whether they depend on additional classes or interfaces that also need to be migrated.
|
* For custom classes or interfaces used in components or service, check whether they depend on additional classes or interfaces that also need to be migrated.
|
||||||
* Similarly, if your library code depends on a service, that service needs to be migrated.
|
* Similarly, if your library code depends on a service, that service needs to be migrated.
|
||||||
* If your library code or its templates depend on other libraries (such as Angular Material, for instance), you must configure your library with those dependencies.
|
* If your library code or its templates depend on other libraries (such a Angular Material, for instance), you must configure your library with those dependencies.
|
||||||
|
|
||||||
* Consider how you provide services to client applications.
|
## Reusable code and schematics
|
||||||
|
|
||||||
* Services should declare their own providers (rather than declaring providers in the NgModule or a component), so that they are *tree-shakable*. This allows the compiler to leave the service out of the bundle if it never gets injected into the application that imports the library. For more about this, see [Tree-shakable providers](guide/dependency-injection-providers#tree-shakable-providers).
|
A library typically includes *reusable code* that defines components, services, and other Angular artifacts (pipes, directives, and so on) that you simply import into a project.
|
||||||
|
A library is packaged into an npm package for publishing and sharing, and this package can also include [schematics](guide/glossary#schematic) that provide instructions for generating or transforming code directly in your project, in the same way that the CLI creates a generic skeleton app with `ng generate component`.
|
||||||
|
A schematic that is combined with a library can, for example, provide the Angular CLI with the information it needs to generate a particular component defined in that library.
|
||||||
|
|
||||||
* If you register global service providers or share providers across multiple NgModules, use the [`forRoot()` and `forChild()` design patterns](guide/singleton-services) provided by the [RouterModule](api/router/RouterModule).
|
What you include in your library is determined by the kind of task you are trying to accomplish.
|
||||||
|
For example, if you want a dropdown with some canned data to show how to add it to your app, your library could define a schematic to create it.
|
||||||
|
For a component like a dropdown that would contain different passed-in values each time, you could provide it as a component in a shared library.
|
||||||
|
|
||||||
* If your library provides optional services that might not be used by all client applications, support proper tree-shaking for that case by using the [lightweight token design pattern](guide/lightweight-injection-tokens).
|
Suppose you want to read a configuration file and then generate a form based on that configuration.
|
||||||
|
If that form will need additional customization by the user, it might work best as a schematic.
|
||||||
|
However, if the forms will always be the same and not need much customization by developers, then you could create a dynamic component that takes the configuration and generates the form.
|
||||||
|
In general, the more complex the customization, the more useful the schematic approach.
|
||||||
|
|
||||||
{@a integrating-with-the-cli}
|
{@a integrating-with-the-cli}
|
||||||
|
|
||||||
## Integrating with the CLI using code-generation schematics
|
## Integrating with the CLI
|
||||||
|
|
||||||
A library typically includes *reusable code* that defines components, services, and other Angular artifacts (pipes, directives, and so on) that you simply import into a project.
|
A library can include [schematics](guide/glossary#schematic) that allow it to integrate with the Angular CLI.
|
||||||
A library is packaged into an npm package for publishing and sharing.
|
|
||||||
This package can also include [schematics](guide/glossary#schematic) that provide instructions for generating or transforming code directly in your project, in the same way that the CLI creates a generic new component with `ng generate component`.
|
|
||||||
A schematic that is packaged with a library can, for example, provide the Angular CLI with the information it needs to generate a component that configures and uses a particular feature, or set of features, defined in that library.
|
|
||||||
One example of this is Angular Material's navigation schematic which configures the CDK's `BreakpointObserver` and uses it with Material's `MatSideNav` and `MatToolbar` components.
|
|
||||||
|
|
||||||
You can create and include the following kinds of schematics.
|
|
||||||
|
|
||||||
* Include an installation schematic so that `ng add` can add your library to a project.
|
* Include an installation schematic so that `ng add` can add your library to a project.
|
||||||
|
|
||||||
@ -103,20 +105,11 @@ You can create and include the following kinds of schematics.
|
|||||||
|
|
||||||
* Include an update schematic so that `ng update` can update your library’s dependencies and provide migrations for breaking changes in new releases.
|
* Include an update schematic so that `ng update` can update your library’s dependencies and provide migrations for breaking changes in new releases.
|
||||||
|
|
||||||
What you include in your library depends on your task.
|
|
||||||
For example, you could define a schematic to create a dropdown that is pre-populated with canned data to show how to add it to an app.
|
|
||||||
If you want a dropdown that would contain different passed-in values each time, your library could define a schematic to create it with a given configuration. Developers could then use `ng generate` to configure an instance for their own app.
|
|
||||||
|
|
||||||
Suppose you want to read a configuration file and then generate a form based on that configuration.
|
|
||||||
If that form will need additional customization by the developer who is using your library, it might work best as a schematic.
|
|
||||||
However, if the forms will always be the same and not need much customization by developers, then you could create a dynamic component that takes the configuration and generates the form.
|
|
||||||
In general, the more complex the customization, the more useful the schematic approach.
|
|
||||||
|
|
||||||
To learn more, see [Schematics Overview](guide/schematics) and [Schematics for Libraries](guide/schematics-for-libraries).
|
To learn more, see [Schematics Overview](guide/schematics) and [Schematics for Libraries](guide/schematics-for-libraries).
|
||||||
|
|
||||||
## Publishing your library
|
## Publishing your library
|
||||||
|
|
||||||
Use the Angular CLI and the npm package manager to build and publish your library as an npm package.
|
Use the Angular CLI and the npm package manager to build and publish your library as an npm package.
|
||||||
|
|
||||||
Before publishing a library to NPM, build it using the `--prod` flag which will use the older compiler and runtime known as View Engine instead of Ivy.
|
Before publishing a library to NPM, build it using the `--prod` flag which will use the older compiler and runtime known as View Engine instead of Ivy.
|
||||||
|
|
||||||
|
@ -448,13 +448,13 @@ When targeting older browsers, [polyfills](guide/browser-support#polyfills) can
|
|||||||
|
|
||||||
To maximize compatibility, you could ship a single bundle that includes all your compiled code, plus any polyfills that may be needed.
|
To maximize compatibility, you could ship a single bundle that includes all your compiled code, plus any polyfills that may be needed.
|
||||||
Users with modern browsers, however, shouldn't have to pay the price of increased bundle size that comes with polyfills they don't need.
|
Users with modern browsers, however, shouldn't have to pay the price of increased bundle size that comes with polyfills they don't need.
|
||||||
Differential loading, which is supported in Angular CLI version 8 and higher, can help solve this problem.
|
Differential loading, which is supported by default in Angular CLI version 8 and higher, solves this problem.
|
||||||
|
|
||||||
Differential loading is a strategy that allows your web application to support multiple browsers, but only load the necessary code that the browser needs. When differential loading is enabled the CLI builds two separate bundles as part of your deployed application.
|
Differential loading is a strategy that allows your web application to support multiple browsers, but only load the necessary code that the browser needs. When differential loading is enabled (which is the default) the CLI builds two separate bundles as part of your deployed application.
|
||||||
|
|
||||||
* The first bundle contains modern ES2015 syntax. This bundle takes advantage of built-in support in modern browsers, ships fewer polyfills, and results in a smaller bundle size.
|
* The first bundle contains modern ES2015 syntax, takes advantage of built-in support in modern browsers, ships fewer polyfills, and results in a smaller bundle size.
|
||||||
|
|
||||||
* The second bundle contains code in the old ES5 syntax, along with all necessary polyfills. This second bundle is larger, but supports older browsers.
|
* The second bundle contains code in the old ES5 syntax, along with all necessary polyfills. This results in a larger bundle size, but supports older browsers.
|
||||||
|
|
||||||
### Differential builds
|
### Differential builds
|
||||||
|
|
||||||
@ -463,9 +463,9 @@ The [`ng build` CLI command](cli/build) queries the browser configuration and th
|
|||||||
|
|
||||||
The following configurations determine your requirements.
|
The following configurations determine your requirements.
|
||||||
|
|
||||||
* Browserslist
|
* Browsers list
|
||||||
|
|
||||||
The Browserslist configuration file is included in your application [project structure](guide/file-structure#application-configuration-files) and provides the minimum browsers your application supports. See the [Browserslist spec](https://github.com/browserslist/browserslist) for complete configuration options.
|
The `browserslist` configuration file is included in your application [project structure](guide/file-structure#application-configuration-files) and provides the minimum browsers your application supports. See the [Browserslist spec](https://github.com/browserslist/browserslist) for complete configuration options.
|
||||||
|
|
||||||
* TypeScript configuration
|
* TypeScript configuration
|
||||||
|
|
||||||
@ -509,27 +509,16 @@ Each script tag has a `type="module"` or `nomodule` attribute. Browsers with nat
|
|||||||
|
|
||||||
### Configuring differential loading
|
### Configuring differential loading
|
||||||
|
|
||||||
To include differential loading in your application builds, you must configure the Browserslist and TypeScript configuration files in your application project.
|
Differential loading is supported by default with version 8 and later of the Angular CLI.
|
||||||
|
For each application project in your workspace, you can configure how builds are produced based on the `browserslist` and `tsconfig.json` configuration files in your application project.
|
||||||
|
|
||||||
The following examples show a `browserlistrc` and `tsconfig.json` file for a newly created Angular application. In this configuration, legacy browsers such as IE 9-11 are ignored, and the compilation target is ES2015.
|
For a newly created Angular application, legacy browsers such as IE 9-11 are ignored, and the compilation target is ES2015.
|
||||||
|
|
||||||
<code-example language="none" header="browserslistrc">
|
<code-example language="none" header="browserslist">
|
||||||
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
> 0.5%
|
||||||
# For additional information regarding the format and rule options, please see:
|
last 2 versions
|
||||||
# https://github.com/browserslist/browserslist#queries
|
|
||||||
|
|
||||||
# For the full list of supported browsers by the Angular framework, please see:
|
|
||||||
# https://angular.io/guide/browser-support
|
|
||||||
|
|
||||||
# You can see what browsers were selected by your queries by running:
|
|
||||||
# npx browserslist
|
|
||||||
|
|
||||||
last 1 Chrome version
|
|
||||||
last 1 Firefox version
|
|
||||||
last 2 Edge major versions
|
|
||||||
last 2 Safari major version
|
|
||||||
last 2 iOS major versions
|
|
||||||
Firefox ESR
|
Firefox ESR
|
||||||
|
not dead
|
||||||
not IE 9-11 # For IE 9-11 support, remove 'not'.
|
not IE 9-11 # For IE 9-11 support, remove 'not'.
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
@ -560,24 +549,36 @@ not IE 9-11 # For IE 9-11 support, remove 'not'.
|
|||||||
|
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
|
The default configuration creates two builds, with differential loading enabled.
|
||||||
|
|
||||||
<div class="alert is-important">
|
<div class="alert is-important">
|
||||||
|
|
||||||
To see which browsers are supported and determine which settings meet to your browser support requirements, see the [Browserslist compatibility page](https://browserl.ist/?q=%3E+0.5%25%2C+last+2+versions%2C+Firefox+ESR%2C+not+dead%2C+not+IE+9-11).
|
To see which browsers are supported with the default configuration and determine which settings meet to your browser support requirements, see the [Browserslist compatibility page](https://browserl.ist/?q=%3E+0.5%25%2C+last+2+versions%2C+Firefox+ESR%2C+not+dead%2C+not+IE+9-11).
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
The Browserslist configuration allows you to ignore browsers without ES2015 support. In this case, a single build is produced.
|
The `browserslist` configuration allows you to ignore browsers without ES2015 support. In this case, a single build is produced.
|
||||||
|
|
||||||
If your Browserslist configuration includes support for any legacy browsers, the build target in the TypeScript configuration determines whether the build will support differential loading.
|
If your `browserslist` configuration includes support for any legacy browsers, the build target in the TypeScript configuration determines whether the build will support differential loading.
|
||||||
|
|
||||||
{@a configuration-table }
|
{@a configuration-table }
|
||||||
|
|
||||||
| Browserslist | ES target | Build result |
|
| browserslist | ES target | Build result |
|
||||||
| -------- | -------- | -------- |
|
| -------- | -------- | -------- |
|
||||||
| ES5 support disabled | es2015 | Single build, ES5 not required |
|
| ES5 support disabled | es2015 | Single build, ES5 not required |
|
||||||
| ES5 support enabled | es5 | Single build w/conditional polyfills for ES5 only |
|
| ES5 support enabled | es5 | Single build w/conditional polyfills for ES5 only |
|
||||||
| ES5 support enabled | es2015 | Differential loading (two builds w/conditional polyfills) |
|
| ES5 support enabled | es2015 | Differential loading (two builds w/conditional polyfills) |
|
||||||
|
|
||||||
|
|
||||||
|
### Opting out of differential loading
|
||||||
|
|
||||||
|
Differential loading can be explicitly disabled if it causes unexpected issues, or if you need to target ES5 specifically for legacy browser support.
|
||||||
|
|
||||||
|
To explicitly disable differential loading and create an ES5 build:
|
||||||
|
|
||||||
|
- Enable the `dead` or `IE` browsers in the `browserslist` configuration file by removing the `not` keyword in front of them.
|
||||||
|
- To create a single ES5 build, set the target in the `compilerOptions` to `es5`.
|
||||||
|
|
||||||
{@a test-and-serve}
|
{@a test-and-serve}
|
||||||
|
|
||||||
## Local development in older browsers
|
## Local development in older browsers
|
||||||
|
@ -62,7 +62,8 @@ v9 - v12
|
|||||||
| template syntax | [`/deep/`, `>>>`, and `::ng-deep`](#deep-component-style-selector) | <!--v7--> unspecified |
|
| template syntax | [`/deep/`, `>>>`, and `::ng-deep`](#deep-component-style-selector) | <!--v7--> unspecified |
|
||||||
| browser support | [`IE 9 and 10, IE mobile`](#ie-9-10-and-mobile) | <!--v10--> v11 |
|
| browser support | [`IE 9 and 10, IE mobile`](#ie-9-10-and-mobile) | <!--v10--> v11 |
|
||||||
|
|
||||||
For information about Angular CDK and Angular Material deprecations, see the [changelog](https://github.com/angular/components/blob/master/CHANGELOG.md).
|
|
||||||
|
|
||||||
|
|
||||||
## Deprecated APIs
|
## Deprecated APIs
|
||||||
|
|
||||||
|
@ -131,22 +131,6 @@ The `createComponent()` method returns a reference to the loaded component.
|
|||||||
Use that reference to interact with the component by assigning to its properties or calling its methods.
|
Use that reference to interact with the component by assigning to its properties or calling its methods.
|
||||||
|
|
||||||
|
|
||||||
{@a selector-references}
|
|
||||||
|
|
||||||
|
|
||||||
#### Selector references
|
|
||||||
|
|
||||||
Generally, the Angular compiler generates a `ComponentFactory`
|
|
||||||
for any component referenced in a template. However, there are
|
|
||||||
no selector references in the templates for
|
|
||||||
dynamically loaded components since they load at runtime.
|
|
||||||
|
|
||||||
To ensure that the compiler still generates a factory,
|
|
||||||
add dynamically loaded components to the `NgModule`'s `entryComponents` array:
|
|
||||||
|
|
||||||
<code-example path="dynamic-component-loader/src/app/app.module.ts" region="entry-components" header="src/app/app.module.ts (entry components)"></code-example>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{@a common-interface}
|
{@a common-interface}
|
||||||
|
|
||||||
|
@ -939,6 +939,19 @@ A TypeScript-like syntax that Angular evaluates within a [data binding](#data-bi
|
|||||||
|
|
||||||
Read about how to write template expressions in the [template expressions](guide/interpolation#template-expressions) section of the [Interpolation](guide/interpolation) guide.
|
Read about how to write template expressions in the [template expressions](guide/interpolation#template-expressions) section of the [Interpolation](guide/interpolation) guide.
|
||||||
|
|
||||||
|
{@a template-reference-variable}
|
||||||
|
|
||||||
|
## template reference variable
|
||||||
|
|
||||||
|
A variable defined in a template that references an instance associated with an element, such as a directive instance, component instance, template as in `TemplateRef`, or DOM element.
|
||||||
|
After declaring a template reference variable on an element in a template,
|
||||||
|
you can access values from that variable elsewhere within the same template.
|
||||||
|
The following example defines a template reference variable named `#phone`.
|
||||||
|
|
||||||
|
<code-example path="template-reference-variables/src/app/app.component.html" region="ref-var" header="src/app/app.component.html"></code-example>
|
||||||
|
|
||||||
|
For more information, see the [Template reference variable](guide/template-reference-variables) guide.
|
||||||
|
|
||||||
{@a token}
|
{@a token}
|
||||||
|
|
||||||
## token
|
## token
|
||||||
|
@ -170,6 +170,6 @@ If an idempotent expression returns a string or a number, it returns the same st
|
|||||||
|
|
||||||
<div class="alert is-helpful">
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
There is one exception to this behavior that applies to `*ngFor`. `*ngFor` has `trackBy` functionality that can deal with referential inequality of objects when iterating over them. See [*ngFor with `trackBy`](guide/built-in-directives #ngfor-with-trackby) for details.
|
There is one exception to this behavior that applies to `*ngFor`. `*ngFor` has `trackBy` functionality that can deal with referential inequality of objects when iterating over them. See [*ngFor with `trackBy`](guide/built-in-directives#ngfor-with-trackby) for details.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -569,7 +569,7 @@ which can only be reached by querying for them via the property decorated with
|
|||||||
|
|
||||||
{@a no-unidirectional-flow-worries}
|
{@a no-unidirectional-flow-worries}
|
||||||
|
|
||||||
<div class="alert is-helpful>
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
<header>No need to wait for content updates</header>
|
<header>No need to wait for content updates</header>
|
||||||
|
|
||||||
|
@ -1,187 +0,0 @@
|
|||||||
# Optimizing client app size with lightweight injection tokens
|
|
||||||
|
|
||||||
This page provides a conceptual overview of a dependency injection technique that is recommended for library developers.
|
|
||||||
Designing your library with *lightweight injection tokens* helps optimize the bundle size of client applications that use your library.
|
|
||||||
|
|
||||||
You can manage the dependency structure among your components and injectable services to optimize bundle size by using [tree-shakable providers](guide/dependency-injection-providers#tree-shakable-providers).
|
|
||||||
This normally ensures that if a provided component or service is never actually used by the app, the compiler can eliminate its code from the bundle.
|
|
||||||
|
|
||||||
However, due to the way Angular stores injection tokens, it is possible that such an unused component or service can end up in the bundle anyway.
|
|
||||||
This page describes a dependency-injection design pattern that supports proper tree-shaking by using lightweight injection tokens.
|
|
||||||
|
|
||||||
The lightweight injection token design pattern is especially important for library developers. It ensures that when an application uses only some of your library's capabilities, the unused code can be eliminated from the client's app bundle.
|
|
||||||
|
|
||||||
When an application uses your library, there might be some services that your library supplies which the client app doesn't use.
|
|
||||||
In this case, the app developer should expect that service to be tree-shaken, and not contribute to the size of the compiled app.
|
|
||||||
Because the application developer cannot know about or remedy a tree-shaking problem in the library, it is the responsibility of the library developer to do so.
|
|
||||||
To prevent the retention of unused components, your library should use the lightweight injection token design pattern.
|
|
||||||
|
|
||||||
## When tokens are retained
|
|
||||||
|
|
||||||
To better explain the condition under which token retention occurs, consider a library that provides a library-card component, which contains a body and can contain an optional header.
|
|
||||||
|
|
||||||
```
|
|
||||||
<lib-card>
|
|
||||||
<lib-header>...</lib-header>
|
|
||||||
</lib-card>
|
|
||||||
```
|
|
||||||
|
|
||||||
In a likely implementation, the `<lib-card>` component uses `@ContentChild()` or `@ContentChildren()` to obtain `<lib-header>` and `<lib-body>`, as in the following.
|
|
||||||
|
|
||||||
```
|
|
||||||
@Component({
|
|
||||||
selector: 'lib-header',
|
|
||||||
...,
|
|
||||||
})
|
|
||||||
class LibHeaderComponent {}
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'lib-card',
|
|
||||||
...,
|
|
||||||
})
|
|
||||||
class LibCardComponent {
|
|
||||||
@ContentChild(LibHeaderComponent)
|
|
||||||
header: LibHeaderComponent|null = null;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Because `<lib-header>` is optional, the element can appear in the template in its minimal form,
|
|
||||||
`<lib-card></lib-card>`.
|
|
||||||
In this case, `<lib-header>` is not used and you would expect it to be tree-shaken, but that is not what happens.
|
|
||||||
This is because `LibCardComponent` actually contains two references to the `LibHeaderComponent`.
|
|
||||||
|
|
||||||
`@ContentChild(LibHeaderComponent) header: LibHeaderComponent;`
|
|
||||||
|
|
||||||
* One of these reference is in the *type position*-- that is, it specifies `LibHeaderComponent` as a type: `header: LibHeaderComponent;`.
|
|
||||||
|
|
||||||
* The other reference is in the *value position*-- that is, LibHeaderComponent is the value of the `@ContentChild()` parameter decorator: `@ContentChild(LibHeaderComponent)`.
|
|
||||||
|
|
||||||
The compiler handles token references in these positions differently.
|
|
||||||
|
|
||||||
* The compiler erases *type position* references after conversion from TypeScript, so they have no impact on tree-shaking.
|
|
||||||
|
|
||||||
* The compiler must retain *value position* references at runtime, which prevents the component from being tree-shaken.
|
|
||||||
|
|
||||||
In the example, the compiler retains the `LibHeaderComponent` token that occurs in the value position, which prevents the referenced component from being tree-shaken, even if the application developer does not actually use `<lib-header>` anywhere.
|
|
||||||
If `LibHeaderComponent` is large (code, template, and styles), including it unnecessarily can significantly increase the size of the client application.
|
|
||||||
|
|
||||||
## When to use the lightweight injection token pattern
|
|
||||||
|
|
||||||
The tree-shaking problem arises when a component is used as an injection token.
|
|
||||||
There are two cases when that can happen.
|
|
||||||
|
|
||||||
* The token is used in the value position of a [content query](guide/lifecycle-hooks#using-aftercontent-hooks "See more about using content queries.").
|
|
||||||
* The token is used as a type specifier for constructor injection.
|
|
||||||
|
|
||||||
In the following example, both uses of the `OtherComponent` token cause retention of `OtherComponent` (that is, prevent it from being tree-shaken when it is not used).
|
|
||||||
|
|
||||||
```
|
|
||||||
class MyComponent {
|
|
||||||
constructor(@Optional() other: OtherComponent) {}
|
|
||||||
|
|
||||||
@ContentChild(OtherComponent)
|
|
||||||
other: OtherComponent|null;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Although tokens used only as type specifiers are removed when converted to JavaScript, all tokens used for dependency injection are needed at runtime.
|
|
||||||
These effectively change `constructor(@Optional() other: OtherComponent)` to `constructor(@Optional() @Inject(OtherComponent) other)`. The token is now in a value position, and causes the tree shaker to retain the reference.
|
|
||||||
|
|
||||||
<div class="alert is helpful">
|
|
||||||
|
|
||||||
For all services, a library should use [tree-shakable providers](guide/dependency-injection-providers#tree-shakable-providers), providing dependencies at the root level rather than in component constructors.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
## Using lightweight injection tokens
|
|
||||||
|
|
||||||
The lightweight injection token design pattern consists of using a small abstract class as an injection token, and providing the actual implementation at a later stage.
|
|
||||||
The abstract class is retained (not tree-shaken), but it is small and has no material impact on the application size.
|
|
||||||
|
|
||||||
The following example shows how this works for the `LibHeaderComponent`.
|
|
||||||
|
|
||||||
```
|
|
||||||
abstract class LibHeaderToken {}
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'lib-header',
|
|
||||||
providers: [
|
|
||||||
{provide: LibHeaderToken, useExisting: LibHeaderComponent}
|
|
||||||
]
|
|
||||||
...,
|
|
||||||
})
|
|
||||||
class LibHeaderComponent extends LibHeaderToken {}
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'lib-card',
|
|
||||||
...,
|
|
||||||
})
|
|
||||||
class LibCardComponent {
|
|
||||||
@ContentChild(LibHeaderToken) header: LibHeaderToken|null = null;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
In this example, the `LibCardComponent` implementation no longer refers to `LibHeaderComponent` in either the type position or the value position.
|
|
||||||
This allows full tree shaking of `LibHeaderComponent` to take place.
|
|
||||||
The `LibHeaderToken` is retained, but it is only a class declaration, with no concrete implementation. It is small and does not materially impact the application size when retained after compilation.
|
|
||||||
|
|
||||||
Instead, `LibHeaderComponent` itself implements the abstract `LibHeaderToken` class. You can safely use that token as the provider in the component definition, allowing Angular to correctly inject the concrete type.
|
|
||||||
|
|
||||||
To summarize, the lightweight injection token pattern consists of the following.
|
|
||||||
|
|
||||||
1. A lightweight injection token that is represented as an abstract class.
|
|
||||||
2. A component definition that implements the abstract class.
|
|
||||||
3. Injection of the lightweight pattern, using ` @ContentChild()` or `@ContentChildren()`.
|
|
||||||
4. A provider in the implementation of the lightweight injection token which associates the lightweight injection token with the implementation.
|
|
||||||
|
|
||||||
### Use the lightweight injection token for API definition
|
|
||||||
|
|
||||||
A component that injects a lightweight injection token might need to invoke a method in the injected class.
|
|
||||||
Because the token is now an abstract class, and the injectable component implements that class, you must also declare an abstract method in the abstract lightweight injection token class.
|
|
||||||
The implementation of the method (with all of its code overhead) resides in the injectable component that can be tree-shaken.
|
|
||||||
This allows the parent to communicate with the child (if it is present) in a type-safe manner.
|
|
||||||
|
|
||||||
For example, the `LibCardComponent` now queries`LibHeaderToken` rather than `LibHeaderComponent`.
|
|
||||||
The following example shows how the pattern allows `LibCardComponent` to communicate with the `LibHeaderComponent` without actually referring to `LibHeaderComponent`.
|
|
||||||
|
|
||||||
```
|
|
||||||
abstract class LibHeaderToken {
|
|
||||||
abstract doSomething(): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'lib-header',
|
|
||||||
providers: [
|
|
||||||
{provide: LibHeaderToken, useExisting: LibHeader}
|
|
||||||
]
|
|
||||||
...,
|
|
||||||
})
|
|
||||||
class LibHeaderComponent extends LibHeaderToken {
|
|
||||||
doSomething(): void {
|
|
||||||
// Concrete implementation of `doSomething`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'lib-card',
|
|
||||||
...,
|
|
||||||
})
|
|
||||||
class LibCardComponent implement AfterContentInit {
|
|
||||||
@ContentChild(LibHeaderToken)
|
|
||||||
header: LibHeaderToken|null = null;
|
|
||||||
|
|
||||||
ngAfterContentInit(): void {
|
|
||||||
this.header && this.header.doSomething();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
In this example the parent queries the token to obtain the child component, and stores the resulting component reference if it is present.
|
|
||||||
Before calling a method in the child, the parent component checks to see if the child component is present.
|
|
||||||
If the child component has been tree-shaken, there is no runtime reference to it, and no call to its method.
|
|
||||||
|
|
||||||
### Naming your lightweight injection token
|
|
||||||
|
|
||||||
Lightweight injection tokens are only useful with components. The Angular style guide suggests that you name components using the "Component" suffix. The example "LibHeaderComponent" follows this convention.
|
|
||||||
|
|
||||||
To maintain the relationship between the component and its token while still distinguishing between them, the recommended style is to use the component base name with the suffix "Token" to name your lightweight injection tokens: "LibHeaderToken".
|
|
@ -1,116 +1,41 @@
|
|||||||
# Types of feature modules
|
# Guidelines for creating NgModules
|
||||||
|
|
||||||
There are five general categories of feature modules which
|
This topic provides a conceptual overview of the different categories of [NgModules](guide/glossary#ngmodule "Definition of NgModule") you can create in order to organize your code in a modular structure.
|
||||||
tend to fall into the following groups:
|
These categories are not cast in stone—they are suggestions.
|
||||||
|
You may want to create NgModules for other purposes, or combine the characteristics of some of these categories.
|
||||||
|
|
||||||
* Domain feature modules.
|
NgModules are a great way to organize an app and keep code related to a specific functionality or feature separate from other code.
|
||||||
* Routed feature modules.
|
Use NgModules to consolidate [components](guide/glossary#component "Definition of component"), [directives](guide/glossary#directive "Definition of directive"), and [pipes](guide/glossary#pipe "Definition of pipe)") into cohesive blocks of functionality.
|
||||||
* Routing modules.
|
Focus each block on a feature or business domain, a workflow or navigation flow, a common collection of utilities, or one or more [providers](guide/glossary#provider "Definition of provider") for [services](guide/glossary#service "Definition of service").
|
||||||
* Service feature modules.
|
|
||||||
* Widget feature modules.
|
|
||||||
|
|
||||||
While the following guidelines describe the use of each type and their
|
For more about NgModules, see [Organizing your app with NgModules](guide/ngmodules "Organizing your app with NgModules").
|
||||||
typical characteristics, in real world apps, you may see hybrids.
|
|
||||||
|
|
||||||
<table>
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
<tr>
|
For the example app used in NgModules-related topics, see the <live-example name="ngmodules"></live-example>.
|
||||||
<th style="vertical-align: top">
|
|
||||||
Feature Module
|
|
||||||
</th>
|
|
||||||
|
|
||||||
<th style="vertical-align: top">
|
</div>
|
||||||
Guidelines
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
## Summary of NgModule categories
|
||||||
<td>Domain</td>
|
|
||||||
<td>
|
|
||||||
Domain feature modules deliver a user experience dedicated to a particular application domain like editing a customer or placing an order.
|
|
||||||
|
|
||||||
They typically have a top component that acts as the feature root and private, supporting sub-components descend from it.
|
All apps start by [bootstrapping a root NgModule](guide/bootstrapping "Launching an app with a root NgModule").
|
||||||
|
You can organize your other NgModules any way you wish.
|
||||||
|
|
||||||
Domain feature modules consist mostly of declarations. Only the top component is exported.
|
This topic provides some guidelines for the following general categories of NgModules:
|
||||||
|
|
||||||
Domain feature modules rarely have providers. When they do, the lifetime of the provided services should be the same as the lifetime of the module.
|
* [Domain](#domain): A domain NgModule is organized around a feature, business domain, or user experience.
|
||||||
|
* [Routed](#routed): The top component of the NgModule acts as the destination of a [router](guide/glossary#router "Definition of router") navigation route.
|
||||||
|
* [Routing](#routing): A routing NgModule provides the routing configuration for another NgModule.
|
||||||
|
* [Service](#service): A service NgModule provides utility services such as data access and messaging.
|
||||||
|
* [Widget](#widget): A widget NgModule makes a component, directive, or pipe available to other NgModules.
|
||||||
|
* [Shared](#shared): A shared NgModule makes a set of components, directives, and pipes available to other NgModules.
|
||||||
|
|
||||||
Domain feature modules are typically imported exactly once by a larger feature module.
|
The following table summarizes the key characteristics of each category.
|
||||||
|
|
||||||
They might be imported by the root `AppModule` of a small application that lacks routing.
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Routed</td>
|
|
||||||
<td>
|
|
||||||
Routed feature modules are domain feature modules whose top components are the targets of router navigation routes.
|
|
||||||
|
|
||||||
All lazy-loaded modules are routed feature modules by definition.
|
|
||||||
|
|
||||||
Routed feature modules don’t export anything because their components never appear in the template of an external component.
|
|
||||||
|
|
||||||
A lazy-loaded routed feature module should not be imported by any module. Doing so would trigger an eager load, defeating the purpose of lazy loading.That means you won’t see them mentioned among the `AppModule` imports. An eager loaded routed feature module must be imported by another module so that the compiler learns about its components.
|
|
||||||
|
|
||||||
Routed feature modules rarely have providers for reasons explained in [Lazy Loading Feature Modules](/guide/lazy-loading-ngmodules). When they do, the lifetime of the provided services should be the same as the lifetime of the module. Don't provide application-wide singleton services in a routed feature module or in a module that the routed module imports.
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>Routing</td>
|
|
||||||
<td>
|
|
||||||
|
|
||||||
A routing module provides routing configuration for another module and separates routing concerns from its companion module.
|
|
||||||
|
|
||||||
A routing module typically does the following:
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>Defines routes.</li>
|
|
||||||
<li>Adds router configuration to the module's imports.</li>
|
|
||||||
<li>Adds guard and resolver service providers to the module's providers.</li>
|
|
||||||
<li>The name of the routing module should parallel the name of its companion module, using the suffix "Routing". For example, <code>FooModule</code> in <code>foo.module.ts</code> has a routing module named <code>FooRoutingModule</code> in <code>foo-routing.module.ts</code>. If the companion module is the root <code>AppModule</code>, the <code>AppRoutingModule</code> adds router configuration to its imports with <code>RouterModule.forRoot(routes)</code>. All other routing modules are children that import <code>RouterModule.forChild(routes)</code>.</li>
|
|
||||||
<li>A routing module re-exports the <code>RouterModule</code> as a convenience so that components of the companion module have access to router directives such as <code>RouterLink</code> and <code>RouterOutlet</code>.</li>
|
|
||||||
<li>A routing module does not have its own declarations. Components, directives, and pipes are the responsibility of the feature module, not the routing module.</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
A routing module should only be imported by its companion module.
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>Service</td>
|
|
||||||
<td>
|
|
||||||
|
|
||||||
Service modules provide utility services such as data access and messaging. Ideally, they consist entirely of providers and have no declarations. Angular's `HttpClientModule` is a good example of a service module.
|
|
||||||
|
|
||||||
The root `AppModule` is the only module that should import service modules.
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>Widget</td>
|
|
||||||
<td>
|
|
||||||
|
|
||||||
A widget module makes components, directives, and pipes available to external modules. Many third-party UI component libraries are widget modules.
|
|
||||||
|
|
||||||
A widget module should consist entirely of declarations, most of them exported.
|
|
||||||
|
|
||||||
A widget module should rarely have providers.
|
|
||||||
|
|
||||||
Import widget modules in any module whose component templates need the widgets.
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
|
|
||||||
The following table summarizes the key characteristics of each feature module group.
|
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="vertical-align: top">
|
<th style="vertical-align: top">
|
||||||
Feature Module
|
NgModule
|
||||||
</th>
|
</th>
|
||||||
|
|
||||||
<th style="vertical-align: top">
|
<th style="vertical-align: top">
|
||||||
@ -135,7 +60,7 @@ The following table summarizes the key characteristics of each feature module gr
|
|||||||
<td>Yes</td>
|
<td>Yes</td>
|
||||||
<td>Rare</td>
|
<td>Rare</td>
|
||||||
<td>Top component</td>
|
<td>Top component</td>
|
||||||
<td>Feature, AppModule</td>
|
<td>Another domain, AppModule</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
@ -151,7 +76,7 @@ The following table summarizes the key characteristics of each feature module gr
|
|||||||
<td>No</td>
|
<td>No</td>
|
||||||
<td>Yes (Guards)</td>
|
<td>Yes (Guards)</td>
|
||||||
<td>RouterModule</td>
|
<td>RouterModule</td>
|
||||||
<td>Feature (for routing)</td>
|
<td>Another domain (for routing)</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
@ -167,14 +92,137 @@ The following table summarizes the key characteristics of each feature module gr
|
|||||||
<td>Yes</td>
|
<td>Yes</td>
|
||||||
<td>Rare</td>
|
<td>Rare</td>
|
||||||
<td>Yes</td>
|
<td>Yes</td>
|
||||||
<td>Feature</td>
|
<td>Another domain</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>Shared</td>
|
||||||
|
<td>Yes</td>
|
||||||
|
<td>No</td>
|
||||||
|
<td>Yes</td>
|
||||||
|
<td>Another domain</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<hr />
|
{@a domain}
|
||||||
|
|
||||||
## More on NgModules
|
## Domain NgModules
|
||||||
|
|
||||||
|
Use a domain NgModule to deliver a user experience dedicated to a particular feature or app domain, such as editing a customer or placing an order.
|
||||||
|
One example is `ContactModule` in the <live-example name="ngmodules"></live-example>.
|
||||||
|
|
||||||
|
A domain NgModule organizes the code related to a certain function, containing all of the components, routing, and templates that make up the function.
|
||||||
|
Your top component in the domain NgModule acts as the feature or domain's root, and is the only component you export.
|
||||||
|
Private supporting subcomponents descend from it.
|
||||||
|
|
||||||
|
Import a domain NgModule exactly once into another NgModule, such as a domain NgModule, or into the root NgModule (`AppModule`) of an app that contains only a few NgModules.
|
||||||
|
|
||||||
|
Domain NgModules consist mostly of declarations.
|
||||||
|
You rarely include providers.
|
||||||
|
If you do, the lifetime of the provided services should be the same as the lifetime of the NgModule.
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
For more information about lifecycles, see [Hooking into the component lifecycle](guide/lifecycle-hooks "Hooking into the component lifecycle").
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{@a routed}
|
||||||
|
|
||||||
|
## Routed NgModules
|
||||||
|
|
||||||
|
Use a routed NgModule for all [lazy-loaded NgModules](guide/lazy-loading-ngmodules "Lazy-loading an NgModule").
|
||||||
|
Use the top component of the NgModule as the destination of a router navigation route.
|
||||||
|
Routed NgModules don’t export anything because their components never appear in the template of an external component.
|
||||||
|
|
||||||
|
Don't import a lazy-loaded routed NgModule into another NgModule, as this would trigger an eager load, defeating the purpose of lazy loading.
|
||||||
|
|
||||||
|
Routed NgModules rarely have providers because you load a routed NgModule only when needed (such as for routing).
|
||||||
|
Services listed in the NgModules' `provider` array would not be available because the root injector wouldn’t know about the lazy-loaded NgModule.
|
||||||
|
If you include providers, the lifetime of the provided services should be the same as the lifetime of the NgModule.
|
||||||
|
Don't provide app-wide [singleton services](guide/singleton-services) in a routed NgModule or in an NgModule that the routed NgModule imports.
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
For more information about providers and lazy-loaded routed NgModules, see [Limiting provider scope](guide/providers#limiting-provider-scope-by-lazy-loading-modules "Providing dependencies: Limiting provider scope").
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{@a routing}
|
||||||
|
|
||||||
|
## Routing NgModules
|
||||||
|
|
||||||
|
Use a routing NgModule to provide the routing configuration for a domain NgModule, thereby separating routing concerns from its companion domain NgModule.
|
||||||
|
One example is `ContactRoutingModule` in the <live-example name="ngmodules"></live-example>, which provides the routing for its companion domain NgModule `ContactModule`.
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
For an overview and details about routing, see [In-app navigation: routing to views](guide/router "In-app navigation: routing to views").
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
Use a routing NgModule to do the following tasks:
|
||||||
|
|
||||||
|
* Define routes.
|
||||||
|
* Add router configuration to the NgModule's import.
|
||||||
|
* Add guard and resolver service providers to the NgModule's providers.
|
||||||
|
|
||||||
|
The name of the routing NgModule should parallel the name of its companion NgModule, using the suffix `Routing`.
|
||||||
|
For example, <code>ContactModule</code> in <code>contact.module.ts</code> has a routing NgModule named <code>ContactRoutingModule</code> in <code>contact-routing.module.ts</code>.
|
||||||
|
|
||||||
|
Import a routing NgModule only into its companion NgModule.
|
||||||
|
If the companion NgModule is the root <code>AppModule</code>, the <code>AppRoutingModule</code> adds router configuration to its imports with <code>RouterModule.forRoot(routes)</code>.
|
||||||
|
All other routing NgModules are children that import <code>RouterModule.forChild(routes)</code>.
|
||||||
|
|
||||||
|
In your routing NgModule, re-export the <code>RouterModule</code> as a convenience so that components of the companion NgModule have access to router directives such as <code>RouterLink</code> and <code>RouterOutlet</code>.
|
||||||
|
|
||||||
|
Don't use declarations in a routing NgModule.
|
||||||
|
Components, directives, and pipes are the responsibility of the companion domain NgModule, not the routing NgModule.
|
||||||
|
|
||||||
|
{@a service}
|
||||||
|
|
||||||
|
## Service NgModules
|
||||||
|
|
||||||
|
Use a service NgModule to provide a utility service such as data access or messaging.
|
||||||
|
Ideal service NgModules consist entirely of providers and have no declarations.
|
||||||
|
Angular's `HttpClientModule` is a good example of a service NgModule.
|
||||||
|
|
||||||
|
Use only the root `AppModule` to import service NgModules.
|
||||||
|
|
||||||
|
{@a widget}
|
||||||
|
|
||||||
|
## Widget NgModules
|
||||||
|
|
||||||
|
Use a widget NgModule to make a component, directive, or pipe available to external NgModules.
|
||||||
|
Import widget NgModules into any NgModules that need the widgets in their templates.
|
||||||
|
Many third-party UI component libraries are provided as widget NgModules.
|
||||||
|
|
||||||
|
A widget NgModule should consist entirely of declarations, most of them exported.
|
||||||
|
It would rarely have providers.
|
||||||
|
|
||||||
|
{@a shared}
|
||||||
|
|
||||||
|
## Shared NgModules
|
||||||
|
|
||||||
|
Put commonly used directives, pipes, and components into one NgModule, typically named `SharedModule`, and then import just that NgModule wherever you need it in other parts of your app.
|
||||||
|
You can import the shared NgModule in your domain NgModules, including [lazy-loaded NgModules](guide/lazy-loading-ngmodules "Lazy-loading an NgModule").
|
||||||
|
One example is `SharedModule` in the <live-example name="ngmodules"></live-example>, which provides the `AwesomePipe` custom pipe and `HighlightDirective` directive.
|
||||||
|
|
||||||
|
Shared NgModules should not include providers, nor should any of its imported or re-exported NgModules include providers.
|
||||||
|
|
||||||
|
To learn how to use shared modules to organize and streamline your code, see [Sharing NgModules in an app](guide/sharing-ngmodules "Sharing NgModules in an app").
|
||||||
|
|
||||||
|
## Next steps
|
||||||
|
|
||||||
You may also be interested in the following:
|
You may also be interested in the following:
|
||||||
* [Lazy Loading Modules with the Angular Router](guide/lazy-loading-ngmodules).
|
|
||||||
* [Providers](guide/providers).
|
* For more about NgModules, see [Organizing your app with NgModules](guide/ngmodules "Organizing your app with NgModules").
|
||||||
|
* To learn more about the root NgModule, see [Launching an app with a root NgModule](guide/bootstrapping "Launching an app with a root NgModule").
|
||||||
|
* To learn about frequently used Angular NgModules and how to import them into your app, see [Frequently-used modules](guide/frequent-ngmodules "Frequently-used modules").
|
||||||
|
* For a complete description of the NgModule metadata properties, see [Using the NgModule metadata](guide/ngmodule-api "Using the NgModule metadata").
|
||||||
|
|
||||||
|
If you want to manage NgModule loading and the use of dependencies and services, see the following:
|
||||||
|
|
||||||
|
* To learn about loading NgModules eagerly when the app starts, or lazy-loading NgModules asynchronously by the router, see [Lazy-loading feature modules](guide/lazy-loading-ngmodules).
|
||||||
|
* To understand how to provide a service or other dependency for your app, see [Providing Dependencies for an NgModule](guide/providers "Providing Dependencies for an NgModule").
|
||||||
|
* To learn how to create a singleton service to use in NgModules, see [Making a service a singleton](guide/singleton-services "Making a service a singleton").
|
||||||
|
@ -1,72 +1,82 @@
|
|||||||
# JavaScript modules vs. NgModules
|
# JavaScript modules vs. NgModules
|
||||||
|
|
||||||
JavaScript and Angular use modules to organize code, and
|
JavaScript modules and NgModules can help you modularize your code, but they are very different.
|
||||||
though they organize it differently, Angular apps rely on both.
|
Angular apps rely on both kinds of modules.
|
||||||
|
|
||||||
|
## JavaScript modules: Files containing code
|
||||||
|
|
||||||
## JavaScript modules
|
A [JavaScript module](https://javascript.info/modules "JavaScript.Info - Modules") is an individual file with JavaScript code, usually containing a class or a library of functions for a specific purpose within your app.
|
||||||
|
JavaScript modules let you spread your work across multiple files.
|
||||||
|
|
||||||
In JavaScript, modules are individual files with JavaScript code in them. To make what’s in them available, you write an export statement, usually after the relevant code, like this:
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
To learn more about JavaScript modules, see [ES6 In Depth: Modules](https://hacks.mozilla.org/2015/08/es6-in-depth-modules/).
|
||||||
|
For the module specification, see the [6th Edition of the ECMAScript standard](http://www.ecma-international.org/ecma-262/6.0/#sec-modules).
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
To make the code in a JavaScript module available to other modules, use an `export` statement at the end of the relevant code in the module, such as the following:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
export class AppComponent { ... }
|
export class AppComponent { ... }
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, when you need that file’s code in another file, you import it like this:
|
When you need that module’s code in another module, use an `import` statement as follows:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
```
|
```
|
||||||
|
|
||||||
JavaScript modules help you namespace, preventing accidental global variables.
|
Each module has its own top-level scope.
|
||||||
|
In other words, top-level variables and functions in a module are not seen in other scripts or modules.
|
||||||
|
Each module provides a namespace for identifiers to prevent them from clashing with identifiers in other modules.
|
||||||
|
With multiple modules, you can prevent accidental global variables by creating a single global namespace and adding sub-modules to it.
|
||||||
|
|
||||||
For more information on JavaScript modules, see [JavaScript/ECMAScript modules](https://hacks.mozilla.org/2015/08/es6-in-depth-modules/).
|
The Angular framework itself is loaded as a set of JavaScript modules.
|
||||||
|
|
||||||
## NgModules
|
## NgModules: Classes with metadata for compiling
|
||||||
|
|
||||||
<!-- KW-- perMisko: let's discuss. This does not answer the question why it is different. Also, last sentence is confusing.-->
|
An [NgModule](guide/glossary#ngmodule "Definition of NgModule") is a class marked by the `@NgModule` decorator with a metadata object that describes how that particular part of the app fits together with the other parts.
|
||||||
NgModules are classes decorated with `@NgModule`. The `@NgModule` decorator’s `imports` array tells Angular what other NgModules the current module needs. The modules in the `imports` array are different than JavaScript modules because they are NgModules rather than regular JavaScript modules. Classes with an `@NgModule` decorator are by convention kept in their own files, but what makes them an `NgModule` isn’t being in their own file, like JavaScript modules; it’s the presence of `@NgModule` and its metadata.
|
NgModules are specific to Angular.
|
||||||
|
While classes with an `@NgModule` decorator are by convention kept in their own files, they differ from JavaScript modules because they include this metadata.
|
||||||
|
|
||||||
The `AppModule` generated from the [Angular CLI](cli) demonstrates both kinds of modules in action:
|
The `@NgModule` metadata plays an important role in guiding the Angular compilation process that converts the app code you write into highly performant JavaScript code.
|
||||||
|
The metadata describes how to compile a component's template and how to create an [injector](guide/glossary#injector "Definition of injector") at runtime.
|
||||||
|
It identifies the NgModule's [components](guide/glossary#component "Definition of component"), [directives](guide/glossary#directive "Definition of directive"), and [pipes](guide/glossary#pipe "Definition of pipe)"),
|
||||||
|
and makes some of them public through the `exports` property so that external components can use them.
|
||||||
|
You can also use an NgModule to add [providers](guide/glossary#provider "Definition of provider") for [services](guide/glossary#service "Definition of a service"), so that the services are available elsewhere in your app.
|
||||||
|
|
||||||
```typescript
|
Rather than defining all member classes in one giant file as a JavaScript module, declare which components, directives, and pipes belong to the NgModule in the `@NgModule.declarations` list.
|
||||||
/* These are JavaScript import statements. Angular doesn’t know anything about these. */
|
These classes are called [declarables](guide/glossary#declarable "Definition of a declarable").
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
An NgModule can export only the declarable classes it owns or imports from other NgModules.
|
||||||
import { NgModule } from '@angular/core';
|
It doesn't declare or export any other kind of class.
|
||||||
|
Declarables are the only classes that matter to the Angular compilation process.
|
||||||
|
|
||||||
import { AppComponent } from './app.component';
|
For a complete description of the NgModule metadata properties, see [Using the NgModule metadata](guide/ngmodule-api "Using the NgModule metadata").
|
||||||
|
|
||||||
/* The @NgModule decorator lets Angular know that this is an NgModule. */
|
## An example that uses both
|
||||||
@NgModule({
|
|
||||||
declarations: [
|
|
||||||
AppComponent
|
|
||||||
],
|
|
||||||
imports: [ /* These are NgModule imports. */
|
|
||||||
BrowserModule
|
|
||||||
],
|
|
||||||
providers: [],
|
|
||||||
bootstrap: [AppComponent]
|
|
||||||
})
|
|
||||||
export class AppModule { }
|
|
||||||
```
|
|
||||||
|
|
||||||
|
The root NgModule `AppModule` generated by the [Angular CLI](cli) for a new app project demonstrates how you use both kinds of modules:
|
||||||
|
|
||||||
The NgModule classes differ from JavaScript module in the following key ways:
|
<code-example path="ngmodules/src/app/app.module.1.ts" header="src/app/app.module.ts (default AppModule)"></code-example>
|
||||||
|
|
||||||
* An NgModule bounds [declarable classes](guide/ngmodule-faq#q-declarable) only.
|
The root NgModule starts with `import` statements to import JavaScript modules.
|
||||||
Declarables are the only classes that matter to the [Angular compiler](guide/ngmodule-faq#q-angular-compiler).
|
It then configures the `@NgModule` with the following arrays:
|
||||||
* Instead of defining all member classes in one giant file as in a JavaScript module,
|
|
||||||
you list the module's classes in the `@NgModule.declarations` list.
|
|
||||||
* An NgModule can only export the [declarable classes](guide/ngmodule-faq#q-declarable)
|
|
||||||
it owns or imports from other modules. It doesn't declare or export any other kind of class.
|
|
||||||
* Unlike JavaScript modules, an NgModule can extend the _entire_ application with services
|
|
||||||
by adding providers to the `@NgModule.providers` list.
|
|
||||||
|
|
||||||
<hr />
|
* `declarations`: The components, directives, and pipes that belong to the NgModule.
|
||||||
|
A new app project's root NgModule has only one component, called `AppComponent`.
|
||||||
|
|
||||||
## More on NgModules
|
* `imports`: Other NgModules you are using, so that you can use their declarables.
|
||||||
|
The newly generated root NgModule imports [`BrowserModule`](api/platform-browser/BrowserModule "BrowserModule NgModule") in order to use browser-specific services such as [DOM](https://www.w3.org/TR/DOM-Level-2-Core/introduction.html "Definition of Document Object Model") rendering, sanitization, and location.
|
||||||
|
|
||||||
For more information on NgModules, see:
|
* `providers`: Providers of services that components in other NgModules can use.
|
||||||
* [Bootstrapping](guide/bootstrapping).
|
There are no providers in a newly generated root NgModule.
|
||||||
* [Frequently used modules](guide/frequent-ngmodules).
|
|
||||||
* [Providers](guide/providers).
|
* `bootstrap`: The [entry component](guide/entry-components "Specifying an entry component") that Angular creates and inserts into the `index.html` host web page, thereby bootstrapping the app.
|
||||||
|
This entry component, `AppComponent`, appears in both the `declarations` and the `bootstrap` arrays.
|
||||||
|
|
||||||
|
## Next steps
|
||||||
|
|
||||||
|
* For more about NgModules, see [Organizing your app with NgModules](guide/ngmodules "Organizing your app with NgModules").
|
||||||
|
* To learn more about the root NgModule, see [Launching an app with a root NgModule](guide/bootstrapping "Launching an app with a root NgModule").
|
||||||
|
* To learn about frequently used Angular NgModules and how to import them into your app, see [Frequently-used modules](guide/frequent-ngmodules "Frequently-used modules").
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Transforming Data Using Pipes
|
# Transforming Data Using Pipes
|
||||||
|
|
||||||
Use [pipes](guide/glossary#pipe "Definition of a pipe") to transform and format strings, currency amounts, dates, and other display data.
|
Use [pipes](guide/glossary#pipe "Definition of a pipe") to transform strings, currency amounts, dates, and other data for display.
|
||||||
Pipes are simple functions you can use in [template expressions](/guide/glossary#template-expression "Definition of template expression") to accept an input value and return a transformed value.
|
Pipes are simple functions you can use in [template expressions](/guide/glossary#template-expression "Definition of template expression") to accept an input value and return a transformed value. Pipes are useful because you can use them throughout your application, while only declaring each pipe once.
|
||||||
For example, you would use a pipe to show a date as **April 15, 1988** rather than the raw string format.
|
For example, you would use a pipe to show a date as **April 15, 1988** rather than the raw string format.
|
||||||
|
|
||||||
<div class="alert is-helpful">
|
<div class="alert is-helpful">
|
||||||
@ -63,7 +63,7 @@ function.
|
|||||||
|
|
||||||
{@a parameterizing-a-pipe}
|
{@a parameterizing-a-pipe}
|
||||||
|
|
||||||
## Formatting data with parameters and chained pipes
|
## Transforming data with parameters and chained pipes
|
||||||
|
|
||||||
Use optional parameters to fine-tune a pipe's output.
|
Use optional parameters to fine-tune a pipe's output.
|
||||||
For example, you can use the [`CurrencyPipe`](api/common/CurrencyPipe "API reference") with a country code such as EUR as a parameter.
|
For example, you can use the [`CurrencyPipe`](api/common/CurrencyPipe "API reference") with a country code such as EUR as a parameter.
|
||||||
|
@ -57,6 +57,20 @@ The task uses the user's preferred package manager to add the library to the pro
|
|||||||
In this example, the function receives the current `Tree` and returns it without any modifications.
|
In this example, the function receives the current `Tree` and returns it without any modifications.
|
||||||
If you need to, you can do additional setup when your package is installed, such as generating files, updating configuration, or any other initial setup your library requires.
|
If you need to, you can do additional setup when your package is installed, such as generating files, updating configuration, or any other initial setup your library requires.
|
||||||
|
|
||||||
|
### Define dependency type
|
||||||
|
|
||||||
|
Use the `save` option of `ng-add` to configure if the library should be added to the `dependencies`, the `devDepedencies`, or not saved at all in the project's `package.json` configuration file.
|
||||||
|
|
||||||
|
<code-example header="projects/my-lib/package.json (ng-add Reference)" path="schematics-for-libraries/projects/my-lib/package.json" region="ng-add">
|
||||||
|
</code-example>
|
||||||
|
|
||||||
|
Possible values are:
|
||||||
|
|
||||||
|
* `false` - Don't add the package to package.json
|
||||||
|
* `true` - Add the package to the dependencies
|
||||||
|
* `"dependencies"` - Add the package to the dependencies
|
||||||
|
* `"devDependencies"` - Add the package to the devDependencies
|
||||||
|
|
||||||
## Building your schematics
|
## Building your schematics
|
||||||
|
|
||||||
To bundle your schematics together with your library, you must configure the library to build the schematics separately, then add them to the bundle.
|
To bundle your schematics together with your library, you must configure the library to build the schematics separately, then add them to the bundle.
|
||||||
|
@ -879,12 +879,14 @@ export type LoadingState<T> = Loaded<T> | Loading;
|
|||||||
export class IfLoadedDirective<T> {
|
export class IfLoadedDirective<T> {
|
||||||
@Input('ifLoaded') set state(state: LoadingState<T>) {}
|
@Input('ifLoaded') set state(state: LoadingState<T>) {}
|
||||||
static ngTemplateGuard_state<T>(dir: IfLoadedDirective<T>, expr: LoadingState<T>): expr is Loaded<T> { return true; };
|
static ngTemplateGuard_state<T>(dir: IfLoadedDirective<T>, expr: LoadingState<T>): expr is Loaded<T> { return true; };
|
||||||
|
}
|
||||||
|
|
||||||
export interface Person {
|
export interface Person {
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
template: `<div *ifLoaded="state">{{ state.data }}</div>`,
|
template: `<div *ifLoaded="state">{{ state.data }}</div>`,
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
state: LoadingState<Person>;
|
state: LoadingState<Person>;
|
||||||
|
@ -19,6 +19,13 @@ Here, a `<button>` further down the template refers to the `phone` variable.
|
|||||||
|
|
||||||
<code-example path="template-reference-variables/src/app/app.component.html" region="ref-phone" header="src/app/app.component.html"></code-example>
|
<code-example path="template-reference-variables/src/app/app.component.html" region="ref-phone" header="src/app/app.component.html"></code-example>
|
||||||
|
|
||||||
|
Angular assigns each template reference variable a value based on where you declare the variable:
|
||||||
|
|
||||||
|
* If you declare the variable on a component, the variable refers to the component instance.
|
||||||
|
* If you declare the variable on a standard HTML tag, the variable refers to the element.
|
||||||
|
* If you declare the variable on an `<ng-template>` element, the variable refers to a `TemplateRef` instance, which represents the template.
|
||||||
|
* If the variable specifies a name on the right-hand side, such as `#var="ngModel"`, the variable refers to the directive or component on the element with a matching `exportAs` name.
|
||||||
|
|
||||||
<h3 class="no-toc">How a reference variable gets its value</h3>
|
<h3 class="no-toc">How a reference variable gets its value</h3>
|
||||||
|
|
||||||
In most cases, Angular sets the reference variable's value to the element on which it is declared.
|
In most cases, Angular sets the reference variable's value to the element on which it is declared.
|
||||||
|
@ -779,7 +779,7 @@ which reports router activity, is a _hot_ observable.
|
|||||||
|
|
||||||
RxJS marble testing is a rich subject, beyond the scope of this guide.
|
RxJS marble testing is a rich subject, beyond the scope of this guide.
|
||||||
Learn about it on the web, starting with the
|
Learn about it on the web, starting with the
|
||||||
[official documentation](https://github.com/ReactiveX/rxjs/blob/master/doc/writing-marble-tests.md).
|
[official documentation](https://rxjs.dev/guide/testing/marble-testing).
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ as a navigation URL intended for the router.
|
|||||||
|
|
||||||
Fortunately, application routes have something in common: their URLs lack file extensions.
|
Fortunately, application routes have something in common: their URLs lack file extensions.
|
||||||
(Data requests also lack extensions but they're easy to recognize because they always begin with `/api`.)
|
(Data requests also lack extensions but they're easy to recognize because they always begin with `/api`.)
|
||||||
All static asset requests have a file extension (such as `main.js` or `/node_modules/zone.js/bundles/zone.umd.js`).
|
All static asset requests have a file extension (such as `main.js` or `/node_modules/zone.js/dist/zone.js`).
|
||||||
|
|
||||||
Because we use routing, we can easily recognize the three types of requests and handle them differently.
|
Because we use routing, we can easily recognize the three types of requests and handle them differently.
|
||||||
|
|
||||||
|
BIN
aio/content/images/bios/kevin-kreuzer.jpg
Normal file
BIN
aio/content/images/bios/kevin-kreuzer.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
@ -840,5 +840,13 @@
|
|||||||
"bio": "Emma is a Developer Advocate at Google. She is passionate about good user experiences and design.",
|
"bio": "Emma is a Developer Advocate at Google. She is passionate about good user experiences and design.",
|
||||||
"groups": ["Angular"],
|
"groups": ["Angular"],
|
||||||
"lead": "mgechev"
|
"lead": "mgechev"
|
||||||
|
},
|
||||||
|
"kreuzercode": {
|
||||||
|
"name": "Kevin Kreuzer",
|
||||||
|
"picture": "kevin-kreuzer.jpg",
|
||||||
|
"twitter": "kreuzercode",
|
||||||
|
"website": "kreuzercode.com",
|
||||||
|
"bio": "Kevin is a passionate freelance front-end engineer and Google Developer Expert based in Switzerland. He is a JavaScript enthusiast and fascinated by Angular. Kevin always tries to learn new things, expand his knowledge, and share it with others in the form of blog posts, workshops, podcasts, or presentations. He is a writer for various publications and the most active writer on Angular in-depth in 2019. Contributing to multiple projects and maintaining 7 npm packages, Kevin is also a big believer in open source. Furthermore, Kevin is a big football fan. Since his childhood, he has supported Real Madrid, which you might notice in a lot of his blog posts and tutorials.",
|
||||||
|
"groups": ["GDE"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
|
|
||||||
<!-- CONTAINER -->
|
<!-- CONTAINER -->
|
||||||
<div class="homepage-container">
|
<div class="homepage-container">
|
||||||
<div class="hero-headline no-toc">Un framework.<br>Móvil y escritorio.</div>
|
<div class="hero-headline no-toc">One framework.<br>Mobile & desktop.</div>
|
||||||
<a class="button hero-cta" href="docs">Empezar</a>
|
<a class="button hero-cta" href="docs">Get Started</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
@ -41,8 +41,8 @@
|
|||||||
|
|
||||||
<div class="text-container">
|
<div class="text-container">
|
||||||
<div class="text-block promo-1-desc l-pad-top-2">
|
<div class="text-block promo-1-desc l-pad-top-2">
|
||||||
<div class="text-headline">Desarrolla en todas las plataformas</div>
|
<div class="text-headline">Develop Across All Platforms</div>
|
||||||
<p class="text-body">Aprende una forma de crear aplicaciones con Angular y reutiliza tu código y habilidades para crear aplicaciones para cualquier objetivo de implementación. Para web, web móvil, móvil nativo y escritorio nativo.
|
<p class="text-body">Learn one way to build applications with Angular and reuse your code and abilities to build apps for any deployment target. For web, mobile web, native mobile and native desktop.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -53,9 +53,9 @@
|
|||||||
<div layout="row" layout-xs="column" class="home-row">
|
<div layout="row" layout-xs="column" class="home-row">
|
||||||
<div class="text-container">
|
<div class="text-container">
|
||||||
<div class="text-block">
|
<div class="text-block">
|
||||||
<div class="text-headline">Velocidad y Rendimiento</div>
|
<div class="text-headline">Speed & Performance</div>
|
||||||
<p class="text-body">Logra la máxima velocidad posible en la Plataforma Web hoy y avance, a través de Web Workers y renderizado del lado del servidor.</p>
|
<p class="text-body">Achieve the maximum speed possible on the Web Platform today, and take it further, via Web Workers and server-side rendering.</p>
|
||||||
<p class="text-body">Angular te permite controlar la escalabilidad. Satisface requerimientos enormes de datos construyendo modelos en RxJS, Immutable.js o algún otro.</p>
|
<p class="text-body">Angular puts you in control over scalability. Meet huge data requirements by building data models on RxJS, Immutable.js or another push-model.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -75,8 +75,8 @@
|
|||||||
|
|
||||||
<div class="text-container">
|
<div class="text-container">
|
||||||
<div class="text-block promo-3-desc">
|
<div class="text-block promo-3-desc">
|
||||||
<div class="text-headline">Herramientas Increíbles</div>
|
<div class="text-headline">Incredible Tooling</div>
|
||||||
<p class="text-body">Crea funciones rápidamente con plantillas simples y declarativas. Extiende el lenguaje de plantilla con tus propios componentes y usa una amplia gama de componentes existentes. Obtén ayuda inmediata y comentarios específicos de Angular con casi todos los IDE y editores. Todo esto se une para que puedas concentrarte en crear aplicaciones increíbles en lugar de intentar que el código funcione.
|
<p class="text-body">Build features quickly with simple, declarative templates. Extend the template language with your own components and use a wide array of existing components. Get immediate Angular-specific help and feedback with nearly every IDE and editor. All this comes together so you can focus on building amazing apps rather than trying to make the code work.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -88,9 +88,8 @@
|
|||||||
<div layout="row" layout-xs="column" class="home-row">
|
<div layout="row" layout-xs="column" class="home-row">
|
||||||
<div class="text-container">
|
<div class="text-container">
|
||||||
<div class="text-block l-pad-top-2">
|
<div class="text-block l-pad-top-2">
|
||||||
<div class="text-headline">Amada por millones</div>
|
<div class="text-headline">Loved by Millions</div>
|
||||||
<p class="text-body">Desde el prototipo hasta la implementación global, Angular ofrece la productividad y la infraestructura escalable que soportan a las aplicaciones más grandes de Google.
|
<p class="text-body">From prototype through global deployment, Angular delivers the productivity and scalable infrastructure that supports Google's largest applications.</p>
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -107,9 +106,8 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<img src="generated/images/marketing/home/code-icon.svg" height="70px" alt="Get Started with Angular">
|
<img src="generated/images/marketing/home/code-icon.svg" height="70px" alt="Get Started with Angular">
|
||||||
<div class="card-text-container">
|
<div class="card-text-container">
|
||||||
<div class="text-headline">Pruebalo ahora</div>
|
<div class="text-headline">Try it now</div>
|
||||||
<p>Explora las capacidades de Angular con una aplicación de muestra preparada. No se requiere configuración.
|
<p>Explore Angular's capabilities with a ready-made sample app. No setup required.</p>
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"TopBar": [
|
"TopBar": [
|
||||||
{
|
{
|
||||||
"url": "features",
|
"url": "features",
|
||||||
"title": "Caracteristicas"
|
"title": "Features"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "docs",
|
"url": "docs",
|
||||||
@ -10,11 +10,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "resources",
|
"url": "resources",
|
||||||
"title": "Recursos"
|
"title": "Resources"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "events",
|
"url": "events",
|
||||||
"title": "Eventos"
|
"title": "Events"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://blog.angular.io/",
|
"url": "https://blog.angular.io/",
|
||||||
@ -23,19 +23,19 @@
|
|||||||
],
|
],
|
||||||
"TopBarNarrow": [
|
"TopBarNarrow": [
|
||||||
{
|
{
|
||||||
"title": "Acerca de Angular",
|
"title": "About Angular",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"url": "features",
|
"url": "features",
|
||||||
"title": "Caracteristicas"
|
"title": "Features"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "resources",
|
"url": "resources",
|
||||||
"title": "Recursos"
|
"title": "Resources"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "events",
|
"url": "events",
|
||||||
"title": "Eventos"
|
"title": "Events"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://blog.angular.io/",
|
"url": "https://blog.angular.io/",
|
||||||
@ -743,11 +743,6 @@
|
|||||||
"url": "guide/creating-libraries",
|
"url": "guide/creating-libraries",
|
||||||
"title": "Creating Libraries",
|
"title": "Creating Libraries",
|
||||||
"tooltip": "Extend Angular by creating, publishing, and using your own libraries."
|
"tooltip": "Extend Angular by creating, publishing, and using your own libraries."
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "guide/lightweight-injection-tokens",
|
|
||||||
"title": "Lightweight Injection Tokens for Libraries",
|
|
||||||
"tooltip": "Optimize client app size by designing library services with lightweight injection tokens."
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -955,100 +950,80 @@
|
|||||||
],
|
],
|
||||||
"Footer": [
|
"Footer": [
|
||||||
{
|
{
|
||||||
"title": "Recursos",
|
"title": "Resources",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"url": "about",
|
"url": "about",
|
||||||
"title": "Contribuyentes",
|
"title": "About",
|
||||||
"tooltip": "Contribuyentes de Angular."
|
"tooltip": "Angular contributors."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "resources",
|
"url": "resources",
|
||||||
"title": "Listado de recursos",
|
"title": "Resource Listing",
|
||||||
"tooltip": "Herramientas de Angular, capacitación y blogs de toda la web."
|
"tooltip": "Angular tools, training, and blogs from around the web."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "presskit",
|
"url": "presskit",
|
||||||
"title": "Kit de prensa",
|
"title": "Press Kit",
|
||||||
"tooltip": "Contactos de prensa, logotipos y marcas."
|
"tooltip": "Press contacts, logos, and branding."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://blog.angular.io/",
|
"url": "https://blog.angular.io/",
|
||||||
"title": "Blog",
|
"title": "Blog",
|
||||||
"tooltip": "Blog de Angular"
|
"tooltip": "Angular Blog"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "analytics",
|
"url": "analytics",
|
||||||
"title": "Analítica de uso",
|
"title": "Usage Analytics",
|
||||||
"tooltip": "Analítica de uso Angular"
|
"tooltip": "Angular Usage Analytics"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Consigue ayuda",
|
"title": "Help",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
|
||||||
"url": "https://chat.angular.lat/",
|
|
||||||
"title": "Angular Hispano Chat",
|
|
||||||
"tooltip": "Chatea en castellano sobre Angular con otros miembros de la comunidad."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://angular.lat/coc",
|
|
||||||
"title": "Código de Conducta",
|
|
||||||
"tooltip": "Tratarnos con respeto y proporcionar un lugar seguro para contribuir."
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"url": "https://stackoverflow.com/questions/tagged/angular",
|
"url": "https://stackoverflow.com/questions/tagged/angular",
|
||||||
"title": "Stack Overflow",
|
"title": "Stack Overflow",
|
||||||
"tooltip": "Stack Overflow: donde la comunidad responde sus preguntas técnicas de Angular."
|
"tooltip": "Stack Overflow: where the community answers your technical Angular questions."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://gitter.im/angular/angular",
|
"url": "https://gitter.im/angular/angular",
|
||||||
"title": "Gitter",
|
"title": "Gitter",
|
||||||
"tooltip": "Chatea en inglés sobre Angular con otros miembros de la comunidad."
|
"tooltip": "Chat about Angular with other birds of a feather."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://github.com/angular/angular/issues",
|
"url": "https://github.com/angular/angular/issues",
|
||||||
"title": "Informar Issues",
|
"title": "Report Issues",
|
||||||
"tooltip": "Publica problemas y sugerencias en GitHub."
|
"tooltip": "Post issues and suggestions on github."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://github.com/angular-hispano/angular/issues",
|
"url": "https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md",
|
||||||
"title": "Issues de traducción",
|
"title": "Code of Conduct",
|
||||||
"tooltip": "Publica issues y sugerencias de traducción en GitHub."
|
"tooltip": "Treating each other with respect."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Comunidad",
|
"title": "Community",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"url": "https://angular.lat/conferencias",
|
"url": "events",
|
||||||
"title": "Eventos Hispanos",
|
"title": "Events",
|
||||||
"tooltip": "Eventos en castellano de Angular alrededor del mundo."
|
"tooltip": "Angular events around the world."
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://angular.lat/meetups",
|
|
||||||
"title": "Meetups Hispanos",
|
|
||||||
"tooltip": "Asista a una reunión y aprenda de otros desarrolladores."
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "http://www.meetup.com/topics/angularjs/",
|
"url": "http://www.meetup.com/topics/angularjs/",
|
||||||
"title": "Mas Meetups",
|
"title": "Meetups",
|
||||||
"tooltip": "Asista a una reunión y aprenda de otros desarrolladores."
|
"tooltip": "Attend a meetup and learn from fellow developers."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "events",
|
"url": "https://twitter.com/angular",
|
||||||
"title": "Mas Eventos",
|
|
||||||
"tooltip": "Eventos de Angular alrededor del mundo."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://twitter.com/AngularHispana",
|
|
||||||
"title": "Twitter",
|
"title": "Twitter",
|
||||||
"tooltip": "Twitter"
|
"tooltip": "Twitter"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "https://github.com/angular-hispano",
|
"url": "https://github.com/angular/angular",
|
||||||
"title": "GitHub",
|
"title": "GitHub",
|
||||||
"tooltip": "GitHub"
|
"tooltip": "GitHub"
|
||||||
},
|
},
|
||||||
@ -1060,7 +1035,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Idiomas",
|
"title": "Languages",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"title": "简体中文版",
|
"title": "简体中文版",
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
"build-local-with-viewengine": "yarn ~~build",
|
"build-local-with-viewengine": "yarn ~~build",
|
||||||
"prebuild-local-with-viewengine-ci": "node scripts/switch-to-viewengine && yarn setup-local-ci",
|
"prebuild-local-with-viewengine-ci": "node scripts/switch-to-viewengine && yarn setup-local-ci",
|
||||||
"build-local-with-viewengine-ci": "yarn ~~build --progress=false",
|
"build-local-with-viewengine-ci": "yarn ~~build --progress=false",
|
||||||
"extract-cli-command-docs": "node tools/transforms/cli-docs-package/extract-cli-commands.js b76099083",
|
"extract-cli-command-docs": "node tools/transforms/cli-docs-package/extract-cli-commands.js a404d2a86",
|
||||||
"lint": "yarn check-env && yarn docs-lint && ng lint && yarn example-lint && yarn tools-lint",
|
"lint": "yarn check-env && yarn docs-lint && ng lint && yarn example-lint && yarn tools-lint",
|
||||||
"test": "yarn check-env && ng test",
|
"test": "yarn check-env && ng test",
|
||||||
"pree2e": "yarn check-env && yarn update-webdriver",
|
"pree2e": "yarn check-env && yarn update-webdriver",
|
||||||
|
@ -5,13 +5,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<mat-toolbar color="primary" class="app-toolbar no-print" [class.transitioning]="isTransitioning">
|
<mat-toolbar color="primary" class="app-toolbar no-print" [class.transitioning]="isTransitioning">
|
||||||
<mat-toolbar-row class="notification-container">
|
<mat-toolbar-row class="notification-container blm-message">
|
||||||
<aio-notification notificationId="survey-march-2020" expirationDate="2020-04-15" [dismissOnContentClick]="true" (dismissed)="notificationDismissed()">
|
<aio-notification notificationId="blm-2020" expirationDate="2022-04-15" [dismissOnContentClick]="true" (dismissed)="notificationDismissed()">
|
||||||
<a href="https://goo.gle/angular-survey-2020">
|
#BlackLivesMatter
|
||||||
<mat-icon class="icon" svgIcon="insert_comment" aria-label="Announcement"></mat-icon>
|
|
||||||
<span class="message">Help Angular by taking a <b>1 minute survey</b>!</span>
|
|
||||||
<span class="action-button">Go to survey</span>
|
|
||||||
</a>
|
|
||||||
</aio-notification>
|
</aio-notification>
|
||||||
</mat-toolbar-row>
|
</mat-toolbar-row>
|
||||||
<mat-toolbar-row>
|
<mat-toolbar-row>
|
||||||
@ -25,10 +21,10 @@
|
|||||||
<aio-top-menu *ngIf="showTopMenu" [nodes]="topMenuNodes" [currentNode]="currentNodes?.TopBar"></aio-top-menu>
|
<aio-top-menu *ngIf="showTopMenu" [nodes]="topMenuNodes" [currentNode]="currentNodes?.TopBar"></aio-top-menu>
|
||||||
<aio-search-box class="search-container" #searchBox (onSearch)="doSearch($event)" (onFocus)="doSearch($event)"></aio-search-box>
|
<aio-search-box class="search-container" #searchBox (onSearch)="doSearch($event)" (onFocus)="doSearch($event)"></aio-search-box>
|
||||||
<div class="toolbar-external-icons-container">
|
<div class="toolbar-external-icons-container">
|
||||||
<a href="https://twitter.com/AngularHispana" title="Twitter" aria-label="Angular Hispano en Twitter">
|
<a href="https://twitter.com/angular" title="Twitter" aria-label="Angular on twitter">
|
||||||
<mat-icon svgIcon="logos:twitter"></mat-icon>
|
<mat-icon svgIcon="logos:twitter"></mat-icon>
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/angular-hispano/angular" title="GitHub" aria-label="Angular Hispano en GitHub">
|
<a href="https://github.com/angular/angular" title="GitHub" aria-label="Angular on github">
|
||||||
<mat-icon svgIcon="logos:github"></mat-icon>
|
<mat-icon svgIcon="logos:github"></mat-icon>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,11 +10,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Superalimentado por Google LLC ©2020.
|
Super-powered by Google ©2010-2020.
|
||||||
Código licenciado bajo un <a href="license" title="Texto completo de la licencia">Licencia de estilo MIT</a>.
|
Code licensed under an <a href="license" title="License text">MIT-style License</a>.
|
||||||
Documentación bajo licencia
|
Documentation licensed under
|
||||||
<a href="http://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a>.
|
<a href="http://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Versión {{versionInfo?.full}}.
|
Version {{versionInfo?.full}}.
|
||||||
</p>
|
</p>
|
||||||
|
@ -17,8 +17,8 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
|
|||||||
selector: 'aio-search-box',
|
selector: 'aio-search-box',
|
||||||
template: `<input #searchBox
|
template: `<input #searchBox
|
||||||
type="search"
|
type="search"
|
||||||
aria-label="Buscar"
|
aria-label="search"
|
||||||
placeholder="Buscar"
|
placeholder="Search"
|
||||||
(input)="doSearch()"
|
(input)="doSearch()"
|
||||||
(keyup)="doSearch()"
|
(keyup)="doSearch()"
|
||||||
(focus)="doFocus()"
|
(focus)="doFocus()"
|
||||||
|
@ -1,18 +1,13 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="es">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Angular</title>
|
<title>Angular</title>
|
||||||
<meta name="Description" content="Angular es una plataforma para crear aplicaciones de escritorio web y móviles.
|
<meta name="Description" content="Angular is a platform for building mobile and desktop web applications.
|
||||||
Únete a la comunidad de millones de desarrolladores que crean interfaces de usuario atractivas con Angular.">
|
Join the community of millions of developers who build compelling user interfaces with Angular.">
|
||||||
<base href="/">
|
<base href="/">
|
||||||
|
|
||||||
<link rel="preconnect" href="https://www.google-analytics.com">
|
|
||||||
<link rel="dns-prefetch" href="https://www.google-analytics.com">
|
|
||||||
<link rel="preconnect" href="https://stats.g.doubleclick.net">
|
|
||||||
<link rel="dns-prefetch" href="https://stats.g.doubleclick.net">
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
<link rel="search" type="application/opensearchdescription+xml" href="assets/opensearch.xml">
|
<link rel="search" type="application/opensearchdescription+xml" href="assets/opensearch.xml">
|
||||||
@ -101,11 +96,11 @@
|
|||||||
<img src="assets/images/logos/angular/angular.svg" width="250" height="250" alt="Angular">
|
<img src="assets/images/logos/angular/angular.svg" width="250" height="250" alt="Angular">
|
||||||
</div>
|
</div>
|
||||||
<div class="homepage-container">
|
<div class="homepage-container">
|
||||||
<div class="hero-headline">Un framework.<br>Móvil y escritorio.</div>
|
<div class="hero-headline">One framework.<br>Mobile & desktop.</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<h2 style="color: red; margin-top: 40px; position: relative; text-align: center; text-shadow: 1px 1px #fafafa;">
|
<h2 style="color: red; margin-top: 40px; position: relative; text-align: center; text-shadow: 1px 1px #fafafa;">
|
||||||
<b><i>Este sitio web requiere JavaScript.</i></b>
|
<b><i>This website requires JavaScript.</i></b>
|
||||||
</h2>
|
</h2>
|
||||||
</noscript>
|
</noscript>
|
||||||
</body>
|
</body>
|
||||||
|
@ -183,8 +183,8 @@ section#intro {
|
|||||||
|
|
||||||
// ANGULAR LINE
|
// ANGULAR LINE
|
||||||
.background-sky {
|
.background-sky {
|
||||||
background-color: $blue;
|
background-color: $black;
|
||||||
background: $bluegradient;
|
background: $black;
|
||||||
color: $white;
|
color: $white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,9 +22,16 @@ mat-toolbar.mat-toolbar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.blm-message {
|
||||||
|
text-align: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: #2d2d2d;
|
||||||
|
font-size: 0.75em;
|
||||||
|
}
|
||||||
|
|
||||||
// HOME PAGE OVERRIDE: TOPNAV TOOLBAR
|
// HOME PAGE OVERRIDE: TOPNAV TOOLBAR
|
||||||
aio-shell.page-home mat-toolbar.mat-toolbar {
|
aio-shell.page-home mat-toolbar.mat-toolbar {
|
||||||
background-color: $blue;
|
background-color: $black;
|
||||||
|
|
||||||
@media (min-width: 481px) {
|
@media (min-width: 481px) {
|
||||||
&:not(.transitioning) {
|
&:not(.transitioning) {
|
||||||
|
@ -108,6 +108,7 @@ aio-code pre {
|
|||||||
top: -7px;
|
top: -7px;
|
||||||
right: -19px;
|
right: -19px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
overflow: visible; // This is required for the button to be displayed correctly in IE11.
|
||||||
|
|
||||||
color: $blue-grey-200;
|
color: $blue-grey-200;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
5
aio/src/typings.d.ts
vendored
5
aio/src/typings.d.ts
vendored
@ -1,5 +0,0 @@
|
|||||||
/* SystemJS module definition */
|
|
||||||
declare var module: NodeModule;
|
|
||||||
interface NodeModule {
|
|
||||||
id: string;
|
|
||||||
}
|
|
@ -14,16 +14,3 @@ There, select all the packages that are updated on the new Angular release.
|
|||||||
|
|
||||||
**2)** Changes to the tsconfig.json? There are several files in `/aio/tools/examples/shared/boilerplate/*/tsconfig.json` (based on the example type).
|
**2)** Changes to the tsconfig.json? There are several files in `/aio/tools/examples/shared/boilerplate/*/tsconfig.json` (based on the example type).
|
||||||
|
|
||||||
**3)** The files `/aio/tools/examples/shared/boilerplate/systemjs/src/systemjs.config.web[.build].js` contains the configuration for plunkers. They have some hardcoded versions that could be updated.
|
|
||||||
|
|
||||||
>N.B.: Plunkers have been replaced by Stackblitz and (almost) all examples have be replaced by CLI/WebPack-based examples that do not use SystemJS.
|
|
||||||
The upgrade examples may still rely on SystemJS.
|
|
||||||
|
|
||||||
---
|
|
||||||
> NOTE(gkalpak):
|
|
||||||
> There are some `package.json` files in `/aio/tools/examples/shared/boilerplate/*`.
|
|
||||||
> AFAICT, they are copied over to the examples (based on the example type), but they are neither
|
|
||||||
> used for installing dependencies (which come from `/aio/tools/examples/shared/package.json`) nor
|
|
||||||
> used in zips (since they are overwritten by `/aio/tools/example-zipper/customizer`).
|
|
||||||
> For all stackblitz live-examples, `/aio/tools/examples/shared/boilerplate/cli/package.json` seems
|
|
||||||
> to be used.
|
|
||||||
|
@ -23,33 +23,18 @@ to flag an example as something to stackblitz or zip. For example:
|
|||||||
|
|
||||||
The zipper will use this information for creating new zips.
|
The zipper will use this information for creating new zips.
|
||||||
|
|
||||||
## Three kinds of examples
|
## Two kinds of examples
|
||||||
|
|
||||||
The majority of examples in AIO use `CLI`, with some additionally using `Webpack` and upgrade usiing `SystemJS`. This
|
There are mainly two kinds of AIO docs examples: The ones based on the Angular CLI and the ones based on SystemJS.
|
||||||
tool is able to differentiate between them.
|
The majority of the examples are CLI-based with only some of the `ngUpgrade` examples using SystemJS.
|
||||||
|
|
||||||
The boilerplate uses a `package.json` that contains packages and scripts to run any kind of example.
|
Some of the CLI-based examples require small tweaks to the default layout/configuration (for example, to add support for Angular elements, i18n, universal, etc.).
|
||||||
Using that `package.json` in the zips would confuse the users.
|
These example types have separate boilerplate directories with the files that are different from the default `cli` boilerplate.
|
||||||
|
|
||||||
Thanks to the `package.json` customizer, we can create a new `package.json` on the fly that would
|
There are appropriate `package.json` files for each type of example in the boilerplate directories.
|
||||||
only contain the packages and scripts needed to run that example.
|
If there is no special `package.json` file for an example type, the one from the `cli` boilerplate directory will be used instead.
|
||||||
|
|
||||||
The `exampleZipper.js` won't include any `System.js` related files for `CLI` or `Webpack` projects.
|
The `exampleZipper.js` won't include any `System.js` related files for CLI-based projects.
|
||||||
|
|
||||||
### The package.json customizer
|
|
||||||
|
|
||||||
Given a `type`, this tool will populate a `package.json` file customized for that type.
|
|
||||||
|
|
||||||
Here you find a:
|
|
||||||
|
|
||||||
* **base.json** - All the common scripts and packages
|
|
||||||
* **cli.json** - Extra scripts and packages for the CLI
|
|
||||||
* **universal.json** - Extra scripts and packages for universal
|
|
||||||
* **i18n.json** - Extra scripts and packages for i18n
|
|
||||||
* **systemjs.json** - All the System.js related packages but it also contains the remainder scripts
|
|
||||||
that are not in the other files.
|
|
||||||
|
|
||||||
The tool will also give some standard names to the scripts.
|
|
||||||
|
|
||||||
## The zipper.json
|
## The zipper.json
|
||||||
|
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
"scripts": [
|
|
||||||
{ "name": "lint" }
|
|
||||||
],
|
|
||||||
"dependencies": [
|
|
||||||
"@angular/animations",
|
|
||||||
"@angular/common",
|
|
||||||
"@angular/compiler",
|
|
||||||
"@angular/core",
|
|
||||||
"@angular/forms",
|
|
||||||
"@angular/platform-browser",
|
|
||||||
"@angular/platform-browser-dynamic",
|
|
||||||
"@angular/router",
|
|
||||||
"@angular/upgrade",
|
|
||||||
"angular-in-memory-web-api",
|
|
||||||
"rxjs",
|
|
||||||
"zone.js"
|
|
||||||
],
|
|
||||||
"devDependencies": [
|
|
||||||
"@angular/compiler-cli",
|
|
||||||
"@types/jasmine",
|
|
||||||
"@types/node",
|
|
||||||
"jasmine-core",
|
|
||||||
"karma",
|
|
||||||
"karma-chrome-launcher",
|
|
||||||
"karma-cli",
|
|
||||||
"karma-jasmine",
|
|
||||||
"karma-jasmine-html-reporter",
|
|
||||||
"lodash",
|
|
||||||
"protractor",
|
|
||||||
"tslint",
|
|
||||||
"typescript"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"scripts": [
|
|
||||||
{ "name": "ng", "command": "ng" },
|
|
||||||
{ "name": "build", "command": "ng build" },
|
|
||||||
{ "name": "start", "command": "ng serve" },
|
|
||||||
{ "name": "test", "command": "ng test" },
|
|
||||||
{ "name": "lint", "command": "ng lint" },
|
|
||||||
{ "name": "e2e", "command": "ng e2e" }
|
|
||||||
],
|
|
||||||
"dependencies": [
|
|
||||||
"angular",
|
|
||||||
"angular-route"
|
|
||||||
],
|
|
||||||
"devDependencies": [
|
|
||||||
"@angular/cli",
|
|
||||||
"@types/angular",
|
|
||||||
"@types/angular-route",
|
|
||||||
"@types/jasminewd2",
|
|
||||||
"jasmine-spec-reporter",
|
|
||||||
"karma-coverage-istanbul-reporter",
|
|
||||||
"ts-node"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"scripts": [
|
|
||||||
{ "name": "ng", "command": "ng" },
|
|
||||||
{ "name": "build", "command": "ng build" },
|
|
||||||
{ "name": "start", "command": "ng serve" },
|
|
||||||
{ "name": "test", "command": "ng test" },
|
|
||||||
{ "name": "lint", "command": "ng lint" },
|
|
||||||
{ "name": "e2e", "command": "ng e2e" }
|
|
||||||
],
|
|
||||||
"dependencies": [],
|
|
||||||
"devDependencies": [
|
|
||||||
"@angular-devkit/build-angular",
|
|
||||||
"@angular/cli",
|
|
||||||
"@types/jasminewd2",
|
|
||||||
"jasmine-spec-reporter",
|
|
||||||
"karma-coverage-istanbul-reporter",
|
|
||||||
"ts-node"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"scripts": [
|
|
||||||
{ "name": "ng", "command": "ng" },
|
|
||||||
{ "name": "build", "command": "ng build" },
|
|
||||||
{ "name": "start", "command": "ng serve" },
|
|
||||||
{ "name": "test", "command": "ng test" },
|
|
||||||
{ "name": "lint", "command": "ng lint" },
|
|
||||||
{ "name": "e2e", "command": "ng e2e" }
|
|
||||||
],
|
|
||||||
"dependencies": [
|
|
||||||
"@angular/elements",
|
|
||||||
"@webcomponents/custom-elements"
|
|
||||||
],
|
|
||||||
"devDependencies": [
|
|
||||||
"@angular-devkit/build-angular",
|
|
||||||
"@angular/cli",
|
|
||||||
"@types/jasminewd2",
|
|
||||||
"jasmine-spec-reporter",
|
|
||||||
"karma-coverage-istanbul-reporter",
|
|
||||||
"ts-node"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"scripts": [
|
|
||||||
{ "name": "ng", "command": "ng" },
|
|
||||||
{ "name": "build", "command": "ng build" },
|
|
||||||
{ "name": "start", "command": "ng serve" },
|
|
||||||
{ "name": "test", "command": "ng test" },
|
|
||||||
{ "name": "lint", "command": "ng lint" },
|
|
||||||
{ "name": "e2e", "command": "ng e2e" }
|
|
||||||
],
|
|
||||||
"dependencies": [],
|
|
||||||
"devDependencies": [
|
|
||||||
"@angular-devkit/build-angular",
|
|
||||||
"@angular/cli",
|
|
||||||
"@types/jasminewd2",
|
|
||||||
"jasmine-spec-reporter",
|
|
||||||
"karma-coverage-istanbul-reporter",
|
|
||||||
"ts-node"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"scripts": [
|
|
||||||
{ "name": "start", "command": "ng serve" },
|
|
||||||
{ "name": "start:fr", "command": "ng serve --configuration=fr" },
|
|
||||||
{ "name": "build", "command": "ng build" },
|
|
||||||
{ "name": "build:fr", "command": "ng build --configuration=production-fr" },
|
|
||||||
{ "name": "test", "command": "ng test" },
|
|
||||||
{ "name": "lint", "command": "ng lint" },
|
|
||||||
{ "name": "e2e", "command": "ng e2e" },
|
|
||||||
{ "name": "extract", "command": "ng xi18n --output-path=locale" }
|
|
||||||
],
|
|
||||||
"dependencies": [],
|
|
||||||
"devDependencies": [
|
|
||||||
"@angular-devkit/build-angular",
|
|
||||||
"@angular/cli",
|
|
||||||
"@types/jasminewd2",
|
|
||||||
"jasmine-spec-reporter",
|
|
||||||
"karma-coverage-istanbul-reporter",
|
|
||||||
"ts-node"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "angular-io-example",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"private": true,
|
|
||||||
"description": "Example project from an angular.io guide.",
|
|
||||||
"scripts": {
|
|
||||||
|
|
||||||
},
|
|
||||||
"keywords": [],
|
|
||||||
"author": "",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
|
|
||||||
},
|
|
||||||
"repository": {}
|
|
||||||
}
|
|
@ -1,63 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
const path = require('canonical-path');
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
const examplesPath = path.resolve(__dirname, '../../../examples');
|
|
||||||
const packageFolder = path.resolve(__dirname);
|
|
||||||
|
|
||||||
class PackageJsonCustomizer {
|
|
||||||
constructor() {
|
|
||||||
this.dependenciesPackageJson = this.readJson(path.join(examplesPath, '/shared/package.json'));
|
|
||||||
this.scriptsPackageJson = this.readJson(path.join(examplesPath, '/shared/boilerplate/systemjs/package.json'));
|
|
||||||
this.basePackageJson = this.readJson(`${packageFolder}/base.json`);
|
|
||||||
this.templatePackageJson = this.readJson(`${packageFolder}/package.json`, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
generate(type = 'systemjs') {
|
|
||||||
let packageJson = JSON.parse(this.templatePackageJson);
|
|
||||||
let rules = require(`${packageFolder}/${type}.json`);
|
|
||||||
|
|
||||||
this._mergeJSON(rules, this.basePackageJson);
|
|
||||||
|
|
||||||
rules.scripts.forEach((r) => {
|
|
||||||
const scriptName = r.name;
|
|
||||||
const script = this.scriptsPackageJson.scripts[scriptName];
|
|
||||||
const finalName = r.rename ? r.rename : r.name;
|
|
||||||
const finalScript = r.command ? r.command : script;
|
|
||||||
packageJson.scripts[finalName] = finalScript;
|
|
||||||
});
|
|
||||||
|
|
||||||
rules.dependencies.forEach((name) => {
|
|
||||||
const version = this.dependenciesPackageJson.dependencies[name];
|
|
||||||
packageJson.dependencies[name] = version;
|
|
||||||
});
|
|
||||||
|
|
||||||
rules.devDependencies.forEach((name) => {
|
|
||||||
const version = this.dependenciesPackageJson.devDependencies[name];
|
|
||||||
packageJson.devDependencies[name] = version;
|
|
||||||
});
|
|
||||||
|
|
||||||
return JSON.stringify(packageJson, null, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
_mergeJSON(json1, json2) {
|
|
||||||
var result = json1;
|
|
||||||
for (var prop in json2)
|
|
||||||
{
|
|
||||||
if (json2.hasOwnProperty(prop))
|
|
||||||
{
|
|
||||||
result[prop] = (result[prop].concat(json2[prop])).sort();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
readJson(jsonFile, parse = true) {
|
|
||||||
const contents = fs.readFileSync(jsonFile, 'utf8');
|
|
||||||
|
|
||||||
return parse ? JSON.parse(contents) : contents;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = PackageJsonCustomizer;
|
|
@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"scripts": [
|
|
||||||
{ "name": "ng", "command": "ng" },
|
|
||||||
{ "name": "build", "command": "ng build" },
|
|
||||||
{ "name": "build:lib", "command": "ng build my-lib" },
|
|
||||||
{ "name": "start", "command": "ng serve" },
|
|
||||||
{ "name": "test", "command": "ng test" },
|
|
||||||
{ "name": "lint", "command": "ng lint" },
|
|
||||||
{ "name": "e2e", "command": "ng e2e" }
|
|
||||||
],
|
|
||||||
"dependencies": [],
|
|
||||||
"devDependencies": [
|
|
||||||
"@angular-devkit/build-angular",
|
|
||||||
"@angular-devkit/build-ng-packagr",
|
|
||||||
"@angular/cli",
|
|
||||||
"@types/jasminewd2",
|
|
||||||
"jasmine-spec-reporter",
|
|
||||||
"karma-coverage-istanbul-reporter",
|
|
||||||
"ng-packagr",
|
|
||||||
"tsickle",
|
|
||||||
"tslib",
|
|
||||||
"ts-node"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
"scripts": [
|
|
||||||
{ "name": "build" },
|
|
||||||
{ "name": "build:watch" },
|
|
||||||
{ "name": "serve" },
|
|
||||||
{ "name": "prestart" },
|
|
||||||
{ "name": "start" },
|
|
||||||
{ "name": "pretest" },
|
|
||||||
{ "name": "test" },
|
|
||||||
{ "name": "pretest:once" },
|
|
||||||
{ "name": "test:once" },
|
|
||||||
{ "name": "build:upgrade" },
|
|
||||||
{ "name": "serve:upgrade" },
|
|
||||||
{ "name": "build:aot" },
|
|
||||||
{ "name": "serve:aot" },
|
|
||||||
{ "name": "copy-dist-files" }
|
|
||||||
],
|
|
||||||
"dependencies": [
|
|
||||||
"@angular/animations",
|
|
||||||
"@angular/common",
|
|
||||||
"@angular/compiler",
|
|
||||||
"@angular/core",
|
|
||||||
"@angular/forms",
|
|
||||||
"@angular/platform-browser",
|
|
||||||
"@angular/platform-browser-dynamic",
|
|
||||||
"@angular/router",
|
|
||||||
"@angular/upgrade",
|
|
||||||
"core-js",
|
|
||||||
"rxjs",
|
|
||||||
"systemjs",
|
|
||||||
"tslib",
|
|
||||||
"zone.js"
|
|
||||||
],
|
|
||||||
"devDependencies": [
|
|
||||||
"@angular/compiler-cli",
|
|
||||||
"@types/angular",
|
|
||||||
"@types/angular-animate",
|
|
||||||
"@types/angular-mocks",
|
|
||||||
"@types/angular-resource",
|
|
||||||
"@types/angular-route",
|
|
||||||
"@types/jasmine",
|
|
||||||
"@types/jasminewd2",
|
|
||||||
"@types/node",
|
|
||||||
"concurrently",
|
|
||||||
"http-server",
|
|
||||||
"jasmine-core",
|
|
||||||
"karma",
|
|
||||||
"karma-chrome-launcher",
|
|
||||||
"karma-jasmine",
|
|
||||||
"karma-jasmine-html-reporter",
|
|
||||||
"lite-server",
|
|
||||||
"protractor",
|
|
||||||
"rollup",
|
|
||||||
"rollup-plugin-commonjs",
|
|
||||||
"rollup-plugin-node-resolve",
|
|
||||||
"rollup-plugin-uglify",
|
|
||||||
"tslint",
|
|
||||||
"typescript"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"scripts": [
|
|
||||||
{ "name": "ng", "command": "ng" },
|
|
||||||
{ "name": "build", "command": "ng build" },
|
|
||||||
{ "name": "start", "command": "ng serve" },
|
|
||||||
{ "name": "test", "command": "ng test" },
|
|
||||||
{ "name": "lint", "command": "ng lint" },
|
|
||||||
{ "name": "e2e", "command": "ng e2e" }
|
|
||||||
],
|
|
||||||
"dependencies": [],
|
|
||||||
"devDependencies": [
|
|
||||||
"@angular-devkit/build-angular",
|
|
||||||
"@angular/cli",
|
|
||||||
"@types/jasminewd2",
|
|
||||||
"jasmine-marbles",
|
|
||||||
"jasmine-spec-reporter",
|
|
||||||
"karma-coverage-istanbul-reporter",
|
|
||||||
"ts-node"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
{
|
|
||||||
"scripts": [
|
|
||||||
{ "name": "ng", "command": "ng" },
|
|
||||||
{ "name": "build", "command": "ng build" },
|
|
||||||
{ "name": "start", "command": "ng serve" },
|
|
||||||
{ "name": "test", "command": "ng test" },
|
|
||||||
{ "name": "lint", "command": "ng lint" },
|
|
||||||
{ "name": "e2e", "command": "ng e2e" },
|
|
||||||
{ "name": "dev:ssr", "command": "ng run angular.io-example:serve-ssr" },
|
|
||||||
{ "name": "build:ssr", "command": "ng build --prod && ng run angular.io-example:server:production" },
|
|
||||||
{ "name": "serve:ssr", "command": "node dist/server/main.js" },
|
|
||||||
{ "name": "prerender", "command": "ng run angular.io-example:prerender" }
|
|
||||||
],
|
|
||||||
"dependencies": [
|
|
||||||
"@angular/platform-server",
|
|
||||||
"@nguniversal/express-engine",
|
|
||||||
"express"
|
|
||||||
],
|
|
||||||
"devDependencies": [
|
|
||||||
"@angular-devkit/build-angular",
|
|
||||||
"@angular/cli",
|
|
||||||
"@nguniversal/builders",
|
|
||||||
"@types/express",
|
|
||||||
"@types/jasminewd2",
|
|
||||||
"jasmine-spec-reporter",
|
|
||||||
"karma-coverage-istanbul-reporter",
|
|
||||||
"ts-node"
|
|
||||||
]
|
|
||||||
}
|
|
@ -6,7 +6,6 @@ const archiver = require('archiver');
|
|||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const globby = require('globby');
|
const globby = require('globby');
|
||||||
|
|
||||||
const PackageJsonCustomizer = require('./customizer/package-json/packageJsonCustomizer');
|
|
||||||
const regionExtractor = require('../transforms/examples-package/services/region-parser');
|
const regionExtractor = require('../transforms/examples-package/services/region-parser');
|
||||||
|
|
||||||
const EXAMPLE_CONFIG_NAME = 'example-config.json';
|
const EXAMPLE_CONFIG_NAME = 'example-config.json';
|
||||||
@ -17,7 +16,6 @@ class ExampleZipper {
|
|||||||
this.examplesSystemjsConfig = path.join(__dirname, '../examples/shared/boilerplate/systemjs/src/systemjs.config.js');
|
this.examplesSystemjsConfig = path.join(__dirname, '../examples/shared/boilerplate/systemjs/src/systemjs.config.js');
|
||||||
this.examplesSystemjsLoaderConfig = path.join(__dirname, '../examples/shared/boilerplate/systemjs/src/systemjs-angular-loader.js');
|
this.examplesSystemjsLoaderConfig = path.join(__dirname, '../examples/shared/boilerplate/systemjs/src/systemjs-angular-loader.js');
|
||||||
this.exampleTsconfig = path.join(__dirname, '../examples/shared/boilerplate/systemjs/src/tsconfig.json');
|
this.exampleTsconfig = path.join(__dirname, '../examples/shared/boilerplate/systemjs/src/tsconfig.json');
|
||||||
this.customizer = new PackageJsonCustomizer();
|
|
||||||
|
|
||||||
let gpathStackblitz = path.join(sourceDirName, '**/*stackblitz.json');
|
let gpathStackblitz = path.join(sourceDirName, '**/*stackblitz.json');
|
||||||
let gpathZipper = path.join(sourceDirName, '**/zipper.json');
|
let gpathZipper = path.join(sourceDirName, '**/zipper.json');
|
||||||
@ -91,6 +89,7 @@ class ExampleZipper {
|
|||||||
'bs-config.json',
|
'bs-config.json',
|
||||||
'karma.conf.js',
|
'karma.conf.js',
|
||||||
'karma-test-shim.js',
|
'karma-test-shim.js',
|
||||||
|
'package.json',
|
||||||
'tsconfig.*',
|
'tsconfig.*',
|
||||||
'tslint.*',
|
'tslint.*',
|
||||||
'e2e/protractor.conf.js',
|
'e2e/protractor.conf.js',
|
||||||
@ -98,11 +97,8 @@ class ExampleZipper {
|
|||||||
'src/favicon.ico',
|
'src/favicon.ico',
|
||||||
'src/polyfills.ts',
|
'src/polyfills.ts',
|
||||||
'src/test.ts',
|
'src/test.ts',
|
||||||
'src/typings.d.ts',
|
|
||||||
'src/environments/**/*',
|
'src/environments/**/*',
|
||||||
'src/testing/**/*',
|
'src/testing/**/*',
|
||||||
// Only ignore root package.json
|
|
||||||
'!package.json'
|
|
||||||
];
|
];
|
||||||
var alwaysExcludes = [
|
var alwaysExcludes = [
|
||||||
'!**/bs-config.e2e.json',
|
'!**/bs-config.e2e.json',
|
||||||
@ -168,8 +164,6 @@ class ExampleZipper {
|
|||||||
zip.append(output, { name: relativePath } );
|
zip.append(output, { name: relativePath } );
|
||||||
});
|
});
|
||||||
|
|
||||||
// we need the package.json from _examples root, not the _boilerplate one
|
|
||||||
zip.append(this.customizer.generate(exampleType), { name: 'package.json' });
|
|
||||||
// also a systemjs config
|
// also a systemjs config
|
||||||
if (exampleType === 'systemjs') {
|
if (exampleType === 'systemjs') {
|
||||||
zip.append(fs.readFileSync(this.examplesSystemjsConfig, 'utf8'), { name: 'src/systemjs.config.js' });
|
zip.append(fs.readFileSync(this.examplesSystemjsConfig, 'utf8'), { name: 'src/systemjs.config.js' });
|
||||||
|
@ -6,65 +6,13 @@ const yargs = require('yargs');
|
|||||||
|
|
||||||
const SHARED_PATH = path.resolve(__dirname, 'shared');
|
const SHARED_PATH = path.resolve(__dirname, 'shared');
|
||||||
const SHARED_NODE_MODULES_PATH = path.resolve(SHARED_PATH, 'node_modules');
|
const SHARED_NODE_MODULES_PATH = path.resolve(SHARED_PATH, 'node_modules');
|
||||||
|
|
||||||
const BOILERPLATE_BASE_PATH = path.resolve(SHARED_PATH, 'boilerplate');
|
const BOILERPLATE_BASE_PATH = path.resolve(SHARED_PATH, 'boilerplate');
|
||||||
const BOILERPLATE_COMMON_BASE_PATH = path.resolve(BOILERPLATE_BASE_PATH, 'common');
|
const BOILERPLATE_CLI_PATH = path.resolve(BOILERPLATE_BASE_PATH, 'cli');
|
||||||
|
const BOILERPLATE_COMMON_PATH = path.resolve(BOILERPLATE_BASE_PATH, 'common');
|
||||||
|
const BOILERPLATE_VIEWENGINE_PATH = path.resolve(BOILERPLATE_BASE_PATH, 'viewengine');
|
||||||
|
|
||||||
const EXAMPLES_BASE_PATH = path.resolve(__dirname, '../../content/examples');
|
const EXAMPLES_BASE_PATH = path.resolve(__dirname, '../../content/examples');
|
||||||
|
|
||||||
const BOILERPLATE_PATHS = {
|
|
||||||
cli: [
|
|
||||||
'src/environments/environment.prod.ts', 'src/environments/environment.ts',
|
|
||||||
'src/assets/.gitkeep', 'browserslist', 'src/favicon.ico', 'karma.conf.js',
|
|
||||||
'src/polyfills.ts', 'src/test.ts', 'tsconfig.app.json', 'tsconfig.spec.json',
|
|
||||||
'tslint.json', 'e2e/src/app.po.ts', 'e2e/protractor-puppeteer.conf.js',
|
|
||||||
'e2e/protractor.conf.js', 'e2e/tsconfig.json', '.editorconfig', 'angular.json', 'package.json',
|
|
||||||
'tsconfig.json', 'tslint.json'
|
|
||||||
],
|
|
||||||
systemjs: [
|
|
||||||
'src/systemjs-angular-loader.js', 'src/systemjs.config.js', 'src/tsconfig.json',
|
|
||||||
'bs-config.json', 'bs-config.e2e.json', 'package.json', 'tslint.json'
|
|
||||||
],
|
|
||||||
common: ['src/styles.css']
|
|
||||||
};
|
|
||||||
|
|
||||||
// All paths in this tool are relative to the current boilerplate folder, i.e boilerplate/i18n
|
|
||||||
// This maps the CLI files that exists in a parent folder
|
|
||||||
const cliRelativePath = BOILERPLATE_PATHS.cli.map(file => `../cli/${file}`);
|
|
||||||
|
|
||||||
BOILERPLATE_PATHS.elements = [...cliRelativePath, 'package.json', 'src/polyfills.ts'];
|
|
||||||
|
|
||||||
BOILERPLATE_PATHS.i18n = [...cliRelativePath, 'angular.json', 'package.json'];
|
|
||||||
|
|
||||||
BOILERPLATE_PATHS['service-worker'] = [...cliRelativePath, 'angular.json', 'package.json'];
|
|
||||||
|
|
||||||
BOILERPLATE_PATHS.testing = [
|
|
||||||
...cliRelativePath,
|
|
||||||
'angular.json',
|
|
||||||
'tsconfig.app.json',
|
|
||||||
'tsconfig.spec.json'
|
|
||||||
];
|
|
||||||
|
|
||||||
BOILERPLATE_PATHS.universal = [...cliRelativePath, 'angular.json', 'package.json'];
|
|
||||||
|
|
||||||
BOILERPLATE_PATHS['getting-started'] = [
|
|
||||||
...cliRelativePath,
|
|
||||||
'src/styles.css'
|
|
||||||
];
|
|
||||||
|
|
||||||
BOILERPLATE_PATHS.schematics = [
|
|
||||||
...cliRelativePath,
|
|
||||||
'angular.json'
|
|
||||||
];
|
|
||||||
|
|
||||||
BOILERPLATE_PATHS['cli-ajs'] = [
|
|
||||||
...cliRelativePath,
|
|
||||||
'package.json'
|
|
||||||
];
|
|
||||||
|
|
||||||
BOILERPLATE_PATHS.viewengine = {
|
|
||||||
systemjs: ['rollup-config.js', 'tsconfig-aot.json'],
|
|
||||||
cli: ['tsconfig.json']
|
|
||||||
};
|
|
||||||
|
|
||||||
const EXAMPLE_CONFIG_FILENAME = 'example-config.json';
|
const EXAMPLE_CONFIG_FILENAME = 'example-config.json';
|
||||||
|
|
||||||
class ExampleBoilerPlate {
|
class ExampleBoilerPlate {
|
||||||
@ -96,24 +44,26 @@ class ExampleBoilerPlate {
|
|||||||
const boilerPlateType = exampleConfig.projectType || 'cli';
|
const boilerPlateType = exampleConfig.projectType || 'cli';
|
||||||
const boilerPlateBasePath = path.resolve(BOILERPLATE_BASE_PATH, boilerPlateType);
|
const boilerPlateBasePath = path.resolve(BOILERPLATE_BASE_PATH, boilerPlateType);
|
||||||
|
|
||||||
// Copy the boilerplate specific files
|
// All example types other than `cli` and `systemjs` are based on `cli`. Copy over the `cli`
|
||||||
BOILERPLATE_PATHS[boilerPlateType].forEach(
|
// boilerplate files first.
|
||||||
filePath => this.copyFile(boilerPlateBasePath, exampleFolder, filePath));
|
// (Some of these files might be later overwritten by type-specific files.)
|
||||||
|
if (boilerPlateType !== 'cli' && boilerPlateType !== 'systemjs') {
|
||||||
|
this.copyDirectoryContents(BOILERPLATE_CLI_PATH, exampleFolder);
|
||||||
|
}
|
||||||
|
|
||||||
// Copy the boilerplate common files
|
// Copy the type-specific boilerplate files.
|
||||||
const useCommonBoilerplate = exampleConfig.useCommonBoilerplate !== false;
|
this.copyDirectoryContents(boilerPlateBasePath, exampleFolder);
|
||||||
|
|
||||||
if (useCommonBoilerplate) {
|
// Copy the common boilerplate files (unless explicitly not used).
|
||||||
BOILERPLATE_PATHS.common.forEach(filePath => this.copyFile(BOILERPLATE_COMMON_BASE_PATH, exampleFolder, filePath));
|
if (exampleConfig.useCommonBoilerplate !== false) {
|
||||||
|
this.copyDirectoryContents(BOILERPLATE_COMMON_PATH, exampleFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy ViewEngine (pre-Ivy) specific files
|
// Copy ViewEngine (pre-Ivy) specific files
|
||||||
if (viewengine) {
|
if (viewengine) {
|
||||||
const veBoilerPlateType = boilerPlateType === 'systemjs' ? 'systemjs' : 'cli';
|
const veBoilerPlateType = boilerPlateType === 'systemjs' ? 'systemjs' : 'cli';
|
||||||
const veBoilerPlateBasePath =
|
const veBoilerPlateBasePath = path.resolve(BOILERPLATE_VIEWENGINE_PATH, veBoilerPlateType);
|
||||||
path.resolve(BOILERPLATE_BASE_PATH, 'viewengine', veBoilerPlateType);
|
this.copyDirectoryContents(veBoilerPlateBasePath, exampleFolder);
|
||||||
BOILERPLATE_PATHS.viewengine[veBoilerPlateType].forEach(
|
|
||||||
filePath => this.copyFile(veBoilerPlateBasePath, exampleFolder, filePath));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -137,22 +87,28 @@ class ExampleBoilerPlate {
|
|||||||
return glob.sync(pattern, {ignore: [ignorePattern]}).map(file => path.dirname(file));
|
return glob.sync(pattern, {ignore: [ignorePattern]}).map(file => path.dirname(file));
|
||||||
}
|
}
|
||||||
|
|
||||||
copyFile(sourceFolder, destinationFolder, filePath) {
|
|
||||||
const sourcePath = path.resolve(sourceFolder, filePath);
|
|
||||||
|
|
||||||
// normalize path if needed
|
|
||||||
filePath = this.normalizePath(filePath);
|
|
||||||
|
|
||||||
const destinationPath = path.resolve(destinationFolder, filePath);
|
|
||||||
fs.copySync(sourcePath, destinationPath, {overwrite: true});
|
|
||||||
fs.chmodSync(destinationPath, 444);
|
|
||||||
}
|
|
||||||
|
|
||||||
loadJsonFile(filePath) { return fs.readJsonSync(filePath, {throws: false}) || {}; }
|
loadJsonFile(filePath) { return fs.readJsonSync(filePath, {throws: false}) || {}; }
|
||||||
|
|
||||||
normalizePath(filePath) {
|
copyDirectoryContents(srcDir, dstDir) {
|
||||||
// transform for example ../cli/src/tsconfig.app.json to src/tsconfig.app.json
|
shelljs.ls('-Al', srcDir).forEach(stat => {
|
||||||
return filePath.replace(/\.{2}\/\w+\//, '');
|
const srcPath = path.resolve(srcDir, stat.name);
|
||||||
|
const dstPath = path.resolve(dstDir, stat.name);
|
||||||
|
|
||||||
|
if (stat.isDirectory()) {
|
||||||
|
// `srcPath` is a directory: Recursively copy it to `dstDir`.
|
||||||
|
shelljs.mkdir('-p', dstPath);
|
||||||
|
return this.copyDirectoryContents(srcPath, dstPath);
|
||||||
|
} else {
|
||||||
|
// `srcPath` is a file: Copy it to `dstDir`.
|
||||||
|
// (Also make the file non-writable to avoid accidental editing of boilerplate files).
|
||||||
|
if (shelljs.test('-f', dstPath)) {
|
||||||
|
// If the file already exists, ensure it is writable (so it can be overwritten).
|
||||||
|
shelljs.chmod(666, dstPath);
|
||||||
|
}
|
||||||
|
shelljs.cp(srcPath, dstDir);
|
||||||
|
shelljs.chmod(444, dstPath);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,24 +9,13 @@ describe('example-boilerplate tool', () => {
|
|||||||
describe('add', () => {
|
describe('add', () => {
|
||||||
const sharedDir = path.resolve(__dirname, 'shared');
|
const sharedDir = path.resolve(__dirname, 'shared');
|
||||||
const sharedNodeModulesDir = path.resolve(sharedDir, 'node_modules');
|
const sharedNodeModulesDir = path.resolve(sharedDir, 'node_modules');
|
||||||
const BPFiles = {
|
|
||||||
cli: 20,
|
|
||||||
i18n: 2,
|
|
||||||
universal: 2,
|
|
||||||
systemjs: 7,
|
|
||||||
common: 1,
|
|
||||||
viewengine: {
|
|
||||||
cli: 1,
|
|
||||||
systemjs: 2,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
const exampleFolders = ['a/b', 'c/d'];
|
const exampleFolders = ['a/b', 'c/d'];
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyOn(fs, 'ensureSymlinkSync');
|
spyOn(fs, 'ensureSymlinkSync');
|
||||||
spyOn(fs, 'existsSync').and.returnValue(true);
|
spyOn(fs, 'existsSync').and.returnValue(true);
|
||||||
spyOn(shelljs, 'exec');
|
spyOn(shelljs, 'exec');
|
||||||
spyOn(exampleBoilerPlate, 'copyFile');
|
spyOn(exampleBoilerPlate, 'copyDirectoryContents');
|
||||||
spyOn(exampleBoilerPlate, 'getFoldersContaining').and.returnValue(exampleFolders);
|
spyOn(exampleBoilerPlate, 'getFoldersContaining').and.returnValue(exampleFolders);
|
||||||
spyOn(exampleBoilerPlate, 'loadJsonFile').and.returnValue({});
|
spyOn(exampleBoilerPlate, 'loadJsonFile').and.returnValue({});
|
||||||
});
|
});
|
||||||
@ -61,58 +50,81 @@ describe('example-boilerplate tool', () => {
|
|||||||
|
|
||||||
it('should copy all the source boilerplate files for systemjs', () => {
|
it('should copy all the source boilerplate files for systemjs', () => {
|
||||||
const boilerplateDir = path.resolve(sharedDir, 'boilerplate');
|
const boilerplateDir = path.resolve(sharedDir, 'boilerplate');
|
||||||
exampleBoilerPlate.loadJsonFile.and.callFake(filePath => filePath.indexOf('a/b') !== -1 ? { projectType: 'systemjs' } : {});
|
exampleBoilerPlate.loadJsonFile.and.returnValue({ projectType: 'systemjs' });
|
||||||
|
|
||||||
exampleBoilerPlate.add();
|
exampleBoilerPlate.add();
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledTimes(
|
|
||||||
(BPFiles.cli) +
|
expect(exampleBoilerPlate.copyDirectoryContents).toHaveBeenCalledTimes(4);
|
||||||
(BPFiles.systemjs) +
|
expect(exampleBoilerPlate.copyDirectoryContents.calls.allArgs()).toEqual([
|
||||||
(BPFiles.common * exampleFolders.length)
|
[`${boilerplateDir}/systemjs`, 'a/b'],
|
||||||
);
|
[`${boilerplateDir}/common`, 'a/b'],
|
||||||
// for example
|
[`${boilerplateDir}/systemjs`, 'c/d'],
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledWith(`${boilerplateDir}/systemjs`, 'a/b', 'package.json');
|
[`${boilerplateDir}/common`, 'c/d'],
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledWith(`${boilerplateDir}/common`, 'a/b', 'src/styles.css');
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should copy all the source boilerplate files for cli', () => {
|
it('should copy all the source boilerplate files for cli', () => {
|
||||||
const boilerplateDir = path.resolve(sharedDir, 'boilerplate');
|
const boilerplateDir = path.resolve(sharedDir, 'boilerplate');
|
||||||
|
exampleBoilerPlate.loadJsonFile.and.returnValue({ projectType: 'cli' });
|
||||||
|
|
||||||
exampleBoilerPlate.add();
|
exampleBoilerPlate.add();
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledTimes(
|
|
||||||
(BPFiles.cli * exampleFolders.length) +
|
expect(exampleBoilerPlate.copyDirectoryContents).toHaveBeenCalledTimes(4);
|
||||||
(BPFiles.common * exampleFolders.length)
|
expect(exampleBoilerPlate.copyDirectoryContents.calls.allArgs()).toEqual([
|
||||||
);
|
[`${boilerplateDir}/cli`, 'a/b'],
|
||||||
// for example
|
[`${boilerplateDir}/common`, 'a/b'],
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledWith(`${boilerplateDir}/cli`, 'a/b', 'package.json');
|
[`${boilerplateDir}/cli`, 'c/d'],
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledWith(`${boilerplateDir}/common`, 'c/d', 'src/styles.css');
|
[`${boilerplateDir}/common`, 'c/d'],
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should copy all the source boilerplate files for i18n', () => {
|
it('should default to `cli` if `projectType` is not specified', () => {
|
||||||
const boilerplateDir = path.resolve(sharedDir, 'boilerplate');
|
const boilerplateDir = path.resolve(sharedDir, 'boilerplate');
|
||||||
exampleBoilerPlate.loadJsonFile.and.callFake(filePath => filePath.indexOf('a/b') !== -1 ? { projectType: 'i18n' } : {})
|
exampleBoilerPlate.loadJsonFile.and.returnValue({});
|
||||||
|
|
||||||
exampleBoilerPlate.add();
|
exampleBoilerPlate.add();
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledTimes(
|
|
||||||
(BPFiles.cli + BPFiles.i18n) +
|
expect(exampleBoilerPlate.copyDirectoryContents).toHaveBeenCalledTimes(4);
|
||||||
(BPFiles.cli) +
|
expect(exampleBoilerPlate.copyDirectoryContents.calls.allArgs()).toEqual([
|
||||||
(BPFiles.common * exampleFolders.length)
|
[`${boilerplateDir}/cli`, 'a/b'],
|
||||||
);
|
[`${boilerplateDir}/common`, 'a/b'],
|
||||||
// for example
|
[`${boilerplateDir}/cli`, 'c/d'],
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledWith(`${boilerplateDir}/i18n`, 'a/b', '../cli/angular.json');
|
[`${boilerplateDir}/common`, 'c/d'],
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledWith(`${boilerplateDir}/i18n`, 'a/b', 'package.json');
|
]);
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledWith(`${boilerplateDir}/common`, 'c/d', 'src/styles.css');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should copy all the source boilerplate files for universal', () => {
|
it('should copy all the source boilerplate files for i18n (on top of the cli ones)', () => {
|
||||||
const boilerplateDir = path.resolve(sharedDir, 'boilerplate');
|
const boilerplateDir = path.resolve(sharedDir, 'boilerplate');
|
||||||
exampleBoilerPlate.loadJsonFile.and.callFake(filePath => filePath.indexOf('a/b') !== -1 ? { projectType: 'universal' } : {})
|
exampleBoilerPlate.loadJsonFile.and.returnValue({ projectType: 'i18n' });
|
||||||
|
|
||||||
exampleBoilerPlate.add();
|
exampleBoilerPlate.add();
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledTimes(
|
|
||||||
(BPFiles.cli + BPFiles.universal) +
|
expect(exampleBoilerPlate.copyDirectoryContents).toHaveBeenCalledTimes(6);
|
||||||
(BPFiles.cli) +
|
expect(exampleBoilerPlate.copyDirectoryContents.calls.allArgs()).toEqual([
|
||||||
(BPFiles.common * exampleFolders.length)
|
[`${boilerplateDir}/cli`, 'a/b'],
|
||||||
);
|
[`${boilerplateDir}/i18n`, 'a/b'],
|
||||||
// for example
|
[`${boilerplateDir}/common`, 'a/b'],
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledWith(`${boilerplateDir}/universal`, 'a/b', '../cli/tslint.json');
|
[`${boilerplateDir}/cli`, 'c/d'],
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledWith(`${boilerplateDir}/universal`, 'a/b', 'angular.json');
|
[`${boilerplateDir}/i18n`, 'c/d'],
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledWith(`${boilerplateDir}/common`, 'c/d', 'src/styles.css');
|
[`${boilerplateDir}/common`, 'c/d'],
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should copy all the source boilerplate files for universal (on top of the cli ones)', () => {
|
||||||
|
const boilerplateDir = path.resolve(sharedDir, 'boilerplate');
|
||||||
|
exampleBoilerPlate.loadJsonFile.and.returnValue({ projectType: 'universal' });
|
||||||
|
|
||||||
|
exampleBoilerPlate.add();
|
||||||
|
|
||||||
|
expect(exampleBoilerPlate.copyDirectoryContents).toHaveBeenCalledTimes(6);
|
||||||
|
expect(exampleBoilerPlate.copyDirectoryContents.calls.allArgs()).toEqual([
|
||||||
|
[`${boilerplateDir}/cli`, 'a/b'],
|
||||||
|
[`${boilerplateDir}/universal`, 'a/b'],
|
||||||
|
[`${boilerplateDir}/common`, 'a/b'],
|
||||||
|
[`${boilerplateDir}/cli`, 'c/d'],
|
||||||
|
[`${boilerplateDir}/universal`, 'c/d'],
|
||||||
|
[`${boilerplateDir}/common`, 'c/d'],
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should try to load the example config file', () => {
|
it('should try to load the example config file', () => {
|
||||||
@ -130,27 +142,55 @@ describe('example-boilerplate tool', () => {
|
|||||||
|
|
||||||
it('should copy all the source boilerplate files for systemjs', () => {
|
it('should copy all the source boilerplate files for systemjs', () => {
|
||||||
const boilerplateDir = path.resolve(sharedDir, 'boilerplate');
|
const boilerplateDir = path.resolve(sharedDir, 'boilerplate');
|
||||||
exampleBoilerPlate.loadJsonFile.and.callFake(filePath => filePath.indexOf('a/b') !== -1 ? { projectType: 'systemjs' } : {});
|
exampleBoilerPlate.loadJsonFile.and.returnValue({ projectType: 'systemjs' });
|
||||||
|
|
||||||
exampleBoilerPlate.add(true);
|
exampleBoilerPlate.add(true);
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledTimes(
|
|
||||||
(BPFiles.cli + BPFiles.viewengine.cli) +
|
expect(exampleBoilerPlate.copyDirectoryContents).toHaveBeenCalledTimes(6);
|
||||||
(BPFiles.systemjs + BPFiles.viewengine.systemjs) +
|
expect(exampleBoilerPlate.copyDirectoryContents.calls.allArgs()).toEqual([
|
||||||
(BPFiles.common * exampleFolders.length)
|
[`${boilerplateDir}/systemjs`, 'a/b'],
|
||||||
);
|
[`${boilerplateDir}/common`, 'a/b'],
|
||||||
// for example
|
[`${boilerplateDir}/viewengine/systemjs`, 'a/b'],
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledWith(`${boilerplateDir}/viewengine/systemjs`, 'a/b', 'tsconfig-aot.json');
|
[`${boilerplateDir}/systemjs`, 'c/d'],
|
||||||
|
[`${boilerplateDir}/common`, 'c/d'],
|
||||||
|
[`${boilerplateDir}/viewengine/systemjs`, 'c/d'],
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should copy all the source boilerplate files for cli', () => {
|
it('should copy all the source boilerplate files for cli', () => {
|
||||||
const boilerplateDir = path.resolve(sharedDir, 'boilerplate');
|
const boilerplateDir = path.resolve(sharedDir, 'boilerplate');
|
||||||
|
exampleBoilerPlate.loadJsonFile.and.returnValue({ projectType: 'cli' });
|
||||||
|
|
||||||
exampleBoilerPlate.add(true);
|
exampleBoilerPlate.add(true);
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledTimes(
|
|
||||||
(BPFiles.cli * exampleFolders.length) +
|
expect(exampleBoilerPlate.copyDirectoryContents).toHaveBeenCalledTimes(6);
|
||||||
(BPFiles.viewengine.cli * exampleFolders.length) +
|
expect(exampleBoilerPlate.copyDirectoryContents.calls.allArgs()).toEqual([
|
||||||
(BPFiles.common * exampleFolders.length)
|
[`${boilerplateDir}/cli`, 'a/b'],
|
||||||
);
|
[`${boilerplateDir}/common`, 'a/b'],
|
||||||
// for example
|
[`${boilerplateDir}/viewengine/cli`, 'a/b'],
|
||||||
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledWith(`${boilerplateDir}/viewengine/cli`, 'a/b', 'tsconfig.json');
|
[`${boilerplateDir}/cli`, 'c/d'],
|
||||||
|
[`${boilerplateDir}/common`, 'c/d'],
|
||||||
|
[`${boilerplateDir}/viewengine/cli`, 'c/d'],
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should copy all the source boilerplate files for elements', () => {
|
||||||
|
const boilerplateDir = path.resolve(sharedDir, 'boilerplate');
|
||||||
|
exampleBoilerPlate.loadJsonFile.and.returnValue({ projectType: 'elements' });
|
||||||
|
|
||||||
|
exampleBoilerPlate.add(true);
|
||||||
|
|
||||||
|
expect(exampleBoilerPlate.copyDirectoryContents).toHaveBeenCalledTimes(8);
|
||||||
|
expect(exampleBoilerPlate.copyDirectoryContents.calls.allArgs()).toEqual([
|
||||||
|
[`${boilerplateDir}/cli`, 'a/b'],
|
||||||
|
[`${boilerplateDir}/elements`, 'a/b'],
|
||||||
|
[`${boilerplateDir}/common`, 'a/b'],
|
||||||
|
[`${boilerplateDir}/viewengine/cli`, 'a/b'],
|
||||||
|
[`${boilerplateDir}/cli`, 'c/d'],
|
||||||
|
[`${boilerplateDir}/elements`, 'c/d'],
|
||||||
|
[`${boilerplateDir}/common`, 'c/d'],
|
||||||
|
[`${boilerplateDir}/viewengine/cli`, 'c/d'],
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -172,16 +212,110 @@ describe('example-boilerplate tool', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('copyFile', () => {
|
describe('copyDirectoryContents', () => {
|
||||||
it('should use copySync and chmodSync', () => {
|
const spyFnFor = fnName => (...args) => { callLog.push(`${fnName}(${args.join(', ')})`); };
|
||||||
spyOn(fs, 'copySync');
|
let callLog;
|
||||||
spyOn(fs, 'chmodSync');
|
|
||||||
exampleBoilerPlate.copyFile('source/folder', 'destination/folder', 'some/file/path');
|
beforeEach(() => {
|
||||||
expect(fs.copySync).toHaveBeenCalledWith(
|
callLog = [];
|
||||||
path.resolve('source/folder/some/file/path'),
|
spyOn(shelljs, 'chmod').and.callFake(spyFnFor('chmod'));
|
||||||
path.resolve('destination/folder/some/file/path'),
|
spyOn(shelljs, 'cp').and.callFake(spyFnFor('cp'));
|
||||||
{ overwrite: true });
|
spyOn(shelljs, 'mkdir').and.callFake(spyFnFor('mkdir'));
|
||||||
expect(fs.chmodSync).toHaveBeenCalledWith(path.resolve('destination/folder/some/file/path'), 444);
|
spyOn(shelljs, 'test').and.callFake(spyFnFor('test'));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should list all contents of a directory', () => {
|
||||||
|
const lsSpy = spyOn(shelljs, 'ls').and.returnValue([]);
|
||||||
|
exampleBoilerPlate.copyDirectoryContents('source/dir', 'destination/dir');
|
||||||
|
expect(lsSpy).toHaveBeenCalledWith('-Al', 'source/dir');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should use copy files and make them read-only', () => {
|
||||||
|
spyOn(shelljs, 'ls').and.returnValue([
|
||||||
|
{name: 'file-1.txt', isDirectory: () => false},
|
||||||
|
{name: 'file-2.txt', isDirectory: () => false},
|
||||||
|
]);
|
||||||
|
|
||||||
|
exampleBoilerPlate.copyDirectoryContents('source/dir', 'destination/dir');
|
||||||
|
|
||||||
|
expect(callLog).toEqual([
|
||||||
|
`test(-f, ${path.resolve('destination/dir/file-1.txt')})`,
|
||||||
|
`cp(${path.resolve('source/dir/file-1.txt')}, destination/dir)`,
|
||||||
|
`chmod(444, ${path.resolve('destination/dir/file-1.txt')})`,
|
||||||
|
|
||||||
|
`test(-f, ${path.resolve('destination/dir/file-2.txt')})`,
|
||||||
|
`cp(${path.resolve('source/dir/file-2.txt')}, destination/dir)`,
|
||||||
|
`chmod(444, ${path.resolve('destination/dir/file-2.txt')})`,
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should make existing files in destination writable before overwriting', () => {
|
||||||
|
spyOn(shelljs, 'ls').and.returnValue([
|
||||||
|
{name: 'new-file.txt', isDirectory: () => false},
|
||||||
|
{name: 'existing-file.txt', isDirectory: () => false},
|
||||||
|
]);
|
||||||
|
shelljs.test.and.callFake((_, filePath) => filePath.endsWith('existing-file.txt'));
|
||||||
|
|
||||||
|
exampleBoilerPlate.copyDirectoryContents('source/dir', 'destination/dir');
|
||||||
|
|
||||||
|
expect(callLog).toEqual([
|
||||||
|
`cp(${path.resolve('source/dir/new-file.txt')}, destination/dir)`,
|
||||||
|
`chmod(444, ${path.resolve('destination/dir/new-file.txt')})`,
|
||||||
|
|
||||||
|
`chmod(666, ${path.resolve('destination/dir/existing-file.txt')})`,
|
||||||
|
`cp(${path.resolve('source/dir/existing-file.txt')}, destination/dir)`,
|
||||||
|
`chmod(444, ${path.resolve('destination/dir/existing-file.txt')})`,
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should recursively copy sub-directories', () => {
|
||||||
|
spyOn(shelljs, 'ls')
|
||||||
|
.withArgs('-Al', 'source/dir').and.returnValue([
|
||||||
|
{name: 'file-1.txt', isDirectory: () => false},
|
||||||
|
{name: 'sub-dir-1', isDirectory: () => true},
|
||||||
|
{name: 'file-2.txt', isDirectory: () => false},
|
||||||
|
])
|
||||||
|
.withArgs('-Al', path.resolve('source/dir/sub-dir-1')).and.returnValue([
|
||||||
|
{name: 'file-3.txt', isDirectory: () => false},
|
||||||
|
{name: 'sub-dir-2', isDirectory: () => true},
|
||||||
|
])
|
||||||
|
.withArgs('-Al', path.resolve('source/dir/sub-dir-1/sub-dir-2')).and.returnValue([
|
||||||
|
{name: 'file-4.txt', isDirectory: () => false},
|
||||||
|
]);
|
||||||
|
|
||||||
|
exampleBoilerPlate.copyDirectoryContents('source/dir', 'destination/dir');
|
||||||
|
|
||||||
|
expect(callLog).toEqual([
|
||||||
|
// Copy `file-1.txt`.
|
||||||
|
`test(-f, ${path.resolve('destination/dir/file-1.txt')})`,
|
||||||
|
`cp(${path.resolve('source/dir/file-1.txt')}, destination/dir)`,
|
||||||
|
`chmod(444, ${path.resolve('destination/dir/file-1.txt')})`,
|
||||||
|
|
||||||
|
// Create `sub-dir-1` and recursively copy its contents.
|
||||||
|
`mkdir(-p, ${path.resolve('destination/dir/sub-dir-1')})`,
|
||||||
|
|
||||||
|
// Copy `sub-dir-1/file-3.txt`.
|
||||||
|
`test(-f, ${path.resolve('destination/dir/sub-dir-1/file-3.txt')})`,
|
||||||
|
'cp(' +
|
||||||
|
`${path.resolve('source/dir/sub-dir-1/file-3.txt')}, ` +
|
||||||
|
`${path.resolve('destination/dir/sub-dir-1')})`,
|
||||||
|
`chmod(444, ${path.resolve('destination/dir/sub-dir-1/file-3.txt')})`,
|
||||||
|
|
||||||
|
// Create `sub-dir-1/sub-dir-2` and recursively copy its contents.
|
||||||
|
`mkdir(-p, ${path.resolve('destination/dir/sub-dir-1/sub-dir-2')})`,
|
||||||
|
|
||||||
|
// Copy `sub-dir-1/sub-dir-2/file-4.txt`.
|
||||||
|
`test(-f, ${path.resolve('destination/dir/sub-dir-1/sub-dir-2/file-4.txt')})`,
|
||||||
|
'cp(' +
|
||||||
|
`${path.resolve('source/dir/sub-dir-1/sub-dir-2/file-4.txt')}, ` +
|
||||||
|
`${path.resolve('destination/dir/sub-dir-1/sub-dir-2')})`,
|
||||||
|
`chmod(444, ${path.resolve('destination/dir/sub-dir-1/sub-dir-2/file-4.txt')})`,
|
||||||
|
|
||||||
|
// Copy `file-2.txt`.
|
||||||
|
`test(-f, ${path.resolve('destination/dir/file-2.txt')})`,
|
||||||
|
`cp(${path.resolve('source/dir/file-2.txt')}, destination/dir)`,
|
||||||
|
`chmod(444, ${path.resolve('destination/dir/file-2.txt')})`,
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "angular.io-example",
|
"name": "angular.io-example",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
|
"description": "Example project from an angular.io guide.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "angular.io-example",
|
"name": "angular.io-example",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
|
"description": "Example project from an angular.io guide.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
/* SystemJS module definition */
|
|
||||||
declare var module: NodeModule;
|
|
||||||
interface NodeModule {
|
|
||||||
id: string;
|
|
||||||
}
|
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "angular.io-example",
|
"name": "angular.io-example",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
|
"description": "Example project from an angular.io guide.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "angular.io-example",
|
"name": "angular.io-example",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
|
"description": "Example project from an angular.io guide.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "angular.io-example",
|
"name": "angular.io-example",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
|
"description": "Example project from an angular.io guide.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "angular-examples",
|
"name": "angular.io-example",
|
||||||
"version": "1.0.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
"description": "Example project from an angular.io guide.",
|
||||||
"description": "Example package.json, only contains needed scripts for examples. See _examples/package.json for master package.json.",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc -p src/",
|
"build": "tsc -p src/",
|
||||||
"build:watch": "tsc -p src/ -w",
|
"build:watch": "tsc -p src/ -w",
|
||||||
@ -25,26 +25,25 @@
|
|||||||
"serve:aot": "lite-server -c bs-config.aot.json",
|
"serve:aot": "lite-server -c bs-config.aot.json",
|
||||||
"copy-dist-files": "node ./copy-dist-files.js"
|
"copy-dist-files": "node ./copy-dist-files.js"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"private": true,
|
||||||
"author": "",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "~9.0.3",
|
"@angular/animations": "~9.1.4",
|
||||||
"@angular/common": "~9.0.3",
|
"@angular/common": "~9.1.4",
|
||||||
"@angular/compiler": "~9.0.3",
|
"@angular/compiler": "~9.1.4",
|
||||||
"@angular/core": "~9.0.3",
|
"@angular/core": "~9.1.4",
|
||||||
"@angular/forms": "~9.0.3",
|
"@angular/forms": "~9.1.4",
|
||||||
"@angular/platform-browser": "~9.0.3",
|
"@angular/platform-browser": "~9.1.4",
|
||||||
"@angular/platform-browser-dynamic": "~9.0.3",
|
"@angular/platform-browser-dynamic": "~9.1.4",
|
||||||
"@angular/router": "~9.0.3",
|
"@angular/router": "~9.1.4",
|
||||||
"@angular/upgrade": "~9.0.3",
|
"@angular/upgrade": "~9.1.4",
|
||||||
"core-js": "^2.5.4",
|
"core-js": "^2.5.4",
|
||||||
"rxjs": "~6.5.4",
|
"rxjs": "~6.5.4",
|
||||||
"tslib": "^1.10.0",
|
"tslib": "^1.10.0",
|
||||||
"zone.js": "~0.10.3"
|
"zone.js": "~0.10.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/compiler-cli": "~9.0.3",
|
"@angular/compiler-cli": "~9.1.4",
|
||||||
|
"@angular/language-service": "~9.1.4",
|
||||||
"@types/angular": "1.6.47",
|
"@types/angular": "1.6.47",
|
||||||
"@types/angular-animate": "1.5.10",
|
"@types/angular-animate": "1.5.10",
|
||||||
"@types/angular-mocks": "1.6.0",
|
"@types/angular-mocks": "1.6.0",
|
||||||
@ -68,6 +67,5 @@
|
|||||||
"rollup-plugin-terser": "^5.3.0",
|
"rollup-plugin-terser": "^5.3.0",
|
||||||
"tslint": "~5.18.0",
|
"tslint": "~5.18.0",
|
||||||
"typescript": "~3.7.5"
|
"typescript": "~3.7.5"
|
||||||
},
|
}
|
||||||
"repository": {}
|
|
||||||
}
|
}
|
||||||
|
@ -1,101 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Google LLC. All Rights Reserved.
|
|
||||||
Use of this source code is governed by an MIT-style license that
|
|
||||||
can be found in the LICENSE file at http://angular.io/license
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WEB VERSION FOR CURRENT ANGULAR BUILD
|
|
||||||
* (based on systemjs.config.js in angular.io)
|
|
||||||
* System configuration for Angular samples
|
|
||||||
* Adjust as necessary for your application needs.
|
|
||||||
*
|
|
||||||
* UNTESTED !
|
|
||||||
*/
|
|
||||||
(function (global) {
|
|
||||||
System.config({
|
|
||||||
// DEMO ONLY! REAL CODE SHOULD NOT TRANSPILE IN THE BROWSER
|
|
||||||
transpiler: 'ts',
|
|
||||||
typescriptOptions: {
|
|
||||||
// Copy of compiler options in standard tsconfig.json
|
|
||||||
"target": "es5",
|
|
||||||
"module": "commonjs",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"sourceMap": true,
|
|
||||||
"emitDecoratorMetadata": true,
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"lib": ["es2015", "dom"],
|
|
||||||
"noImplicitAny": true,
|
|
||||||
"suppressImplicitAnyIndexErrors": true
|
|
||||||
},
|
|
||||||
meta: {
|
|
||||||
'typescript': {
|
|
||||||
"exports": "ts"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
paths: {
|
|
||||||
// paths serve as alias
|
|
||||||
'npm:': 'https://unpkg.com/',
|
|
||||||
'ng:': 'https://cdn.rawgit.com/angular/'
|
|
||||||
},
|
|
||||||
// map tells the System loader where to look for things
|
|
||||||
map: {
|
|
||||||
// our app is within the app folder
|
|
||||||
'app': 'app',
|
|
||||||
|
|
||||||
// angular bundles
|
|
||||||
'@angular/animations': 'ng:animations-builds/master/bundles/animations.umd.js',
|
|
||||||
'@angular/animations/browser': 'ng:animations-builds/master/bundles/animations-browser.umd.js',
|
|
||||||
'@angular/core': 'ng:core-builds/master/bundles/core.umd.js',
|
|
||||||
'@angular/common': 'ng:common-builds/master/bundles/common.umd.js',
|
|
||||||
'@angular/common/http': 'ng:common-builds/master/bundles/common-http.umd.js',
|
|
||||||
'@angular/compiler': 'ng:compiler-builds/master/bundles/compiler.umd.js',
|
|
||||||
'@angular/platform-browser': 'ng:platform-browser-builds/master/bundles/platform-browser.umd.js',
|
|
||||||
'@angular/platform-browser/animations': 'ng:animations-builds/master/bundles/platform-browser-animations.umd.js',
|
|
||||||
'@angular/platform-browser-dynamic': 'ng:platform-browser-dynamic-builds/master/bundles/platform-browser-dynamic.umd.js',
|
|
||||||
'@angular/router': 'ng:router-builds/master/bundles/router.umd.js',
|
|
||||||
'@angular/router/upgrade': 'ng:router-builds/master/bundles/router-upgrade.umd.js',
|
|
||||||
'@angular/forms': 'ng:forms-builds/master/bundles/forms.umd.js',
|
|
||||||
'@angular/upgrade': 'ng:upgrade-builds/master/bundles/upgrade.umd.js',
|
|
||||||
'@angular/upgrade/static': 'ng:upgrade-builds/master/bundles/upgrade-static.umd.js',
|
|
||||||
|
|
||||||
// angular testing umd bundles (overwrite the shim mappings)
|
|
||||||
'@angular/core/testing': 'ng:core-builds/master/bundles/core-testing.umd.js',
|
|
||||||
'@angular/common/testing': 'ng:common-builds/master/bundles/common-testing.umd.js',
|
|
||||||
'@angular/common/http/testing': 'ng:common-builds/master/bundles/common-http-testing.umd.js',
|
|
||||||
'@angular/compiler/testing': 'ng:compiler-builds/master/bundles/compiler-testing.umd.js',
|
|
||||||
'@angular/platform-browser/testing': 'ng:platform-browser-builds/master/bundles/platform-browser-testing.umd.js',
|
|
||||||
'@angular/platform-browser-dynamic/testing': 'ng:platform-browser-dynamic-builds/master/bundles/platform-browser-dynamic-testing.umd.js',
|
|
||||||
'@angular/router/testing': 'ng:router-builds/master/bundles/router-testing.umd.js',
|
|
||||||
'@angular/forms/testing': 'ng:forms-builds/master/bundles/forms-testing.umd.js',
|
|
||||||
|
|
||||||
// other libraries
|
|
||||||
'rxjs': 'npm:rxjs@5.5.2',
|
|
||||||
'rxjs/operators': 'npm:rxjs@5.5.2/operators/index.js',
|
|
||||||
'tslib': 'npm:tslib/tslib.js',
|
|
||||||
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api@0.4/bundles/in-memory-web-api.umd.js',
|
|
||||||
'ts': 'npm:plugin-typescript@5.2.7/lib/plugin.js',
|
|
||||||
'typescript': 'npm:typescript@2.4.2/lib/typescript.js',
|
|
||||||
|
|
||||||
},
|
|
||||||
// packages tells the System loader how to load when no filename and/or no extension
|
|
||||||
packages: {
|
|
||||||
app: {
|
|
||||||
main: './main.ts',
|
|
||||||
defaultExtension: 'ts',
|
|
||||||
meta: {
|
|
||||||
'./*.ts': {
|
|
||||||
loader: 'systemjs-angular-loader.js'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'rxjs/ajax': {main: 'index.js', defaultExtension: 'js' },
|
|
||||||
'rxjs/operators': {main: 'index.js', defaultExtension: 'js' },
|
|
||||||
'rxjs/testing': {main: 'index.js', defaultExtension: 'js' },
|
|
||||||
'rxjs/websocket': {main: 'index.js', defaultExtension: 'js' },
|
|
||||||
'rxjs': { main: 'index.js', defaultExtension: 'js' },
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
})(this);
|
|
@ -1,87 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Google LLC. All Rights Reserved.
|
|
||||||
Use of this source code is governed by an MIT-style license that
|
|
||||||
can be found in the LICENSE file at http://angular.io/license
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* WEB ANGULAR VERSION
|
|
||||||
* (based on systemjs.config.js in angular.io)
|
|
||||||
* System configuration for Angular samples
|
|
||||||
* Adjust as necessary for your application needs.
|
|
||||||
*/
|
|
||||||
(function (global) {
|
|
||||||
System.config({
|
|
||||||
// DEMO ONLY! REAL CODE SHOULD NOT TRANSPILE IN THE BROWSER
|
|
||||||
transpiler: 'ts',
|
|
||||||
typescriptOptions: {
|
|
||||||
// Copy of compiler options in standard tsconfig.json
|
|
||||||
"target": "es5",
|
|
||||||
"module": "commonjs",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"sourceMap": true,
|
|
||||||
"emitDecoratorMetadata": true,
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"lib": ["es2015", "dom"],
|
|
||||||
"noImplicitAny": true,
|
|
||||||
"suppressImplicitAnyIndexErrors": true
|
|
||||||
},
|
|
||||||
meta: {
|
|
||||||
'typescript': {
|
|
||||||
"exports": "ts"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
paths: {
|
|
||||||
// paths serve as alias
|
|
||||||
'npm:': 'https://unpkg.com/'
|
|
||||||
},
|
|
||||||
// map tells the System loader where to look for things
|
|
||||||
map: {
|
|
||||||
// our app is within the app folder
|
|
||||||
'app': 'app',
|
|
||||||
|
|
||||||
// angular bundles
|
|
||||||
'@angular/animations': 'npm:@angular/animations/bundles/animations.umd.js',
|
|
||||||
'@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.js',
|
|
||||||
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
|
|
||||||
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
|
|
||||||
'@angular/common/http': 'npm:@angular/common/bundles/common-http.umd.js',
|
|
||||||
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
|
|
||||||
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
|
|
||||||
'@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
|
|
||||||
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
|
|
||||||
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
|
|
||||||
'@angular/router/upgrade': 'npm:@angular/router/bundles/router-upgrade.umd.js',
|
|
||||||
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
|
|
||||||
'@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js',
|
|
||||||
'@angular/upgrade/static': 'npm:@angular/upgrade/bundles/upgrade-static.umd.js',
|
|
||||||
|
|
||||||
// other libraries
|
|
||||||
'rxjs': 'npm:rxjs@5.5.2',
|
|
||||||
'rxjs/operators': 'npm:rxjs@5.5.2/operators/index.js',
|
|
||||||
'tslib': 'npm:tslib/tslib.js',
|
|
||||||
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api@0.4/bundles/in-memory-web-api.umd.js',
|
|
||||||
'ts': 'npm:plugin-typescript@5.2.7/lib/plugin.js',
|
|
||||||
'typescript': 'npm:typescript@2.4.2/lib/typescript.js',
|
|
||||||
|
|
||||||
},
|
|
||||||
// packages tells the System loader how to load when no filename and/or no extension
|
|
||||||
packages: {
|
|
||||||
app: {
|
|
||||||
main: './main.ts',
|
|
||||||
defaultExtension: 'ts',
|
|
||||||
meta: {
|
|
||||||
'./*.ts': {
|
|
||||||
loader: 'systemjs-angular-loader.js'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'rxjs/ajax': {main: 'index.js', defaultExtension: 'js' },
|
|
||||||
'rxjs/operators': {main: 'index.js', defaultExtension: 'js' },
|
|
||||||
'rxjs/testing': {main: 'index.js', defaultExtension: 'js' },
|
|
||||||
'rxjs/websocket': {main: 'index.js', defaultExtension: 'js' },
|
|
||||||
'rxjs': { main: 'index.js', defaultExtension: 'js' },
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
})(this);
|
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "angular.io-example",
|
"name": "angular.io-example",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
|
"description": "Example project from an angular.io guide.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
var CIconfiguration = {
|
var CIconfiguration = {
|
||||||
'Chrome': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
|
'Chrome': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
|
||||||
'Firefox': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
|
'Firefox': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
|
||||||
// Set ESR as a not required browser as it fails for Ivy acceptance tests.
|
'FirefoxESR': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
|
||||||
'FirefoxESR': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
|
|
||||||
// Disabled because using the "beta" channel of Chrome can cause non-deterministic CI results.
|
// Disabled because using the "beta" channel of Chrome can cause non-deterministic CI results.
|
||||||
// e.g. a new chrome beta version has been released, but the Saucelabs selenium server does
|
// e.g. a new chrome beta version has been released, but the Saucelabs selenium server does
|
||||||
// not provide a chromedriver version that is compatible with the new beta.
|
// not provide a chromedriver version that is compatible with the new beta.
|
||||||
|
@ -132,7 +132,7 @@ def component_benchmark(
|
|||||||
# The server for our application.
|
# The server for our application.
|
||||||
ts_devserver(
|
ts_devserver(
|
||||||
name = server,
|
name = server,
|
||||||
bootstrap = ["//packages/zone.js/bundles:zone.umd.js"],
|
bootstrap = ["//packages/zone.js/dist:zone.js"],
|
||||||
port = 4200,
|
port = 4200,
|
||||||
static_files = assets + styles,
|
static_files = assets + styles,
|
||||||
deps = [":" + app_main + ".min_debug.js"],
|
deps = [":" + app_main + ".min_debug.js"],
|
||||||
|
@ -16,6 +16,9 @@ import {isPullRequest, loadAndValidatePullRequest,} from './pull-request';
|
|||||||
import {GithubApiMergeStrategy} from './strategies/api-merge';
|
import {GithubApiMergeStrategy} from './strategies/api-merge';
|
||||||
import {AutosquashMergeStrategy} from './strategies/autosquash-merge';
|
import {AutosquashMergeStrategy} from './strategies/autosquash-merge';
|
||||||
|
|
||||||
|
/** Github OAuth scopes required for the merge task. */
|
||||||
|
const REQUIRED_SCOPES = ['repo'];
|
||||||
|
|
||||||
/** Describes the status of a pull request merge. */
|
/** Describes the status of a pull request merge. */
|
||||||
export const enum MergeStatus {
|
export const enum MergeStatus {
|
||||||
UNKNOWN_GIT_ERROR,
|
UNKNOWN_GIT_ERROR,
|
||||||
@ -53,19 +56,8 @@ export class PullRequestMergeTask {
|
|||||||
* @param force Whether non-critical pull request failures should be ignored.
|
* @param force Whether non-critical pull request failures should be ignored.
|
||||||
*/
|
*/
|
||||||
async merge(prNumber: number, force = false): Promise<MergeResult> {
|
async merge(prNumber: number, force = false): Promise<MergeResult> {
|
||||||
// Check whether the given Github token has sufficient permissions for writing
|
// Assert the authenticated GitClient has access on the required scopes.
|
||||||
// to the configured repository. If the repository is not private, only the
|
const hasOauthScopes = await this.git.hasOauthScopes(...REQUIRED_SCOPES);
|
||||||
// reduced `public_repo` OAuth scope is sufficient for performing merges.
|
|
||||||
const hasOauthScopes = await this.git.hasOauthScopes((scopes, missing) => {
|
|
||||||
if (!scopes.includes('repo')) {
|
|
||||||
if (this.config.remote.private) {
|
|
||||||
missing.push('repo');
|
|
||||||
} else if (!scopes.includes('public_repo')) {
|
|
||||||
missing.push('public_repo');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (hasOauthScopes !== true) {
|
if (hasOauthScopes !== true) {
|
||||||
return {
|
return {
|
||||||
status: MergeStatus.GITHUB_ERROR,
|
status: MergeStatus.GITHUB_ERROR,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
load("@npm_bazel_typescript//:index.bzl", "ts_library")
|
load("@npm_bazel_typescript//:index.bzl", "ts_library")
|
||||||
|
load("//tools:defaults.bzl", "jasmine_node_test")
|
||||||
|
|
||||||
ts_library(
|
ts_library(
|
||||||
name = "pullapprove",
|
name = "pullapprove",
|
||||||
@ -8,6 +9,8 @@ ts_library(
|
|||||||
"group.ts",
|
"group.ts",
|
||||||
"logging.ts",
|
"logging.ts",
|
||||||
"parse-yaml.ts",
|
"parse-yaml.ts",
|
||||||
|
"pullapprove_arrays.ts",
|
||||||
|
"utils.ts",
|
||||||
"verify.ts",
|
"verify.ts",
|
||||||
],
|
],
|
||||||
module_name = "@angular/dev-infra-private/pullapprove",
|
module_name = "@angular/dev-infra-private/pullapprove",
|
||||||
@ -25,3 +28,24 @@ ts_library(
|
|||||||
"@npm//yargs",
|
"@npm//yargs",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ts_library(
|
||||||
|
name = "pullapprove_test_lib",
|
||||||
|
testonly = True,
|
||||||
|
srcs = glob(
|
||||||
|
["*.spec.ts"],
|
||||||
|
),
|
||||||
|
visibility = ["//visibility:private"],
|
||||||
|
deps = [
|
||||||
|
":pullapprove",
|
||||||
|
"@npm//@types/jasmine",
|
||||||
|
"@npm//@types/node",
|
||||||
|
"@npm//typescript",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
jasmine_node_test(
|
||||||
|
name = "pullapprove_test",
|
||||||
|
srcs = [":pullapprove_test_lib"],
|
||||||
|
visibility = ["//visibility:private"],
|
||||||
|
)
|
||||||
|
@ -6,10 +6,9 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {IMinimatch, Minimatch} from 'minimatch';
|
import {PullApproveGroup} from './group';
|
||||||
|
import {PullApproveGroupArray, PullApproveStringArray} from './pullapprove_arrays';
|
||||||
/** Map that holds patterns and their corresponding Minimatch globs. */
|
import {getOrCreateGlob} from './utils';
|
||||||
const patternCache = new Map<string, IMinimatch>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Context that is provided to conditions. Conditions can use various helpers
|
* Context that is provided to conditions. Conditions can use various helpers
|
||||||
@ -18,30 +17,34 @@ const patternCache = new Map<string, IMinimatch>();
|
|||||||
*/
|
*/
|
||||||
const conditionContext = {
|
const conditionContext = {
|
||||||
'len': (value: any[]) => value.length,
|
'len': (value: any[]) => value.length,
|
||||||
'contains_any_globs': (files: PullApproveArray, patterns: string[]) => {
|
'contains_any_globs': (files: PullApproveStringArray, patterns: string[]) => {
|
||||||
// Note: Do not always create globs for the same pattern again. This method
|
// Note: Do not always create globs for the same pattern again. This method
|
||||||
// could be called for each source file. Creating glob's is expensive.
|
// could be called for each source file. Creating glob's is expensive.
|
||||||
return files.some(f => patterns.some(pattern => getOrCreateGlob(pattern).match(f)));
|
return files.some(f => patterns.some(pattern => getOrCreateGlob(pattern).match(f)));
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a given condition to a function that accepts a set of files. The returned
|
* Converts a given condition to a function that accepts a set of files. The returned
|
||||||
* function can be called to check if the set of files matches the condition.
|
* function can be called to check if the set of files matches the condition.
|
||||||
*/
|
*/
|
||||||
export function convertConditionToFunction(expr: string): (files: string[]) => boolean {
|
export function convertConditionToFunction(expr: string): (
|
||||||
// Creates a dynamic function with the specified expression. The first parameter will
|
files: string[], groups: PullApproveGroup[]) => boolean {
|
||||||
// be `files` as that corresponds to the supported `files` variable that can be accessed
|
// Creates a dynamic function with the specified expression.
|
||||||
// in PullApprove condition expressions. The followed parameters correspond to other
|
// The first parameter will be `files` as that corresponds to the supported `files` variable that
|
||||||
// context variables provided by PullApprove for conditions.
|
// can be accessed in PullApprove condition expressions. The second parameter is the list of
|
||||||
const evaluateFn = new Function('files', ...Object.keys(conditionContext), `
|
// PullApproveGroups that are accessible in the condition expressions. The followed parameters
|
||||||
|
// correspond to other context variables provided by PullApprove for conditions.
|
||||||
|
const evaluateFn = new Function('files', 'groups', ...Object.keys(conditionContext), `
|
||||||
return (${transformExpressionToJs(expr)});
|
return (${transformExpressionToJs(expr)});
|
||||||
`);
|
`);
|
||||||
|
|
||||||
// Create a function that calls the dynamically constructed function which mimics
|
// Create a function that calls the dynamically constructed function which mimics
|
||||||
// the condition expression that is usually evaluated with Python in PullApprove.
|
// the condition expression that is usually evaluated with Python in PullApprove.
|
||||||
return files => {
|
return (files, groups) => {
|
||||||
const result = evaluateFn(new PullApproveArray(...files), ...Object.values(conditionContext));
|
const result = evaluateFn(
|
||||||
|
new PullApproveStringArray(...files), new PullApproveGroupArray(...groups),
|
||||||
|
...Object.values(conditionContext));
|
||||||
// If an array is returned, we consider the condition as active if the array is not
|
// If an array is returned, we consider the condition as active if the array is not
|
||||||
// empty. This matches PullApprove's condition evaluation that is based on Python.
|
// empty. This matches PullApprove's condition evaluation that is based on Python.
|
||||||
if (Array.isArray(result)) {
|
if (Array.isArray(result)) {
|
||||||
@ -59,41 +62,3 @@ export function convertConditionToFunction(expr: string): (files: string[]) => b
|
|||||||
function transformExpressionToJs(expression: string): string {
|
function transformExpressionToJs(expression: string): string {
|
||||||
return expression.replace(/not\s+/g, '!');
|
return expression.replace(/not\s+/g, '!');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Superset of a native array. The superset provides methods which mimic the
|
|
||||||
* list data structure used in PullApprove for files in conditions.
|
|
||||||
*/
|
|
||||||
class PullApproveArray extends Array<string> {
|
|
||||||
constructor(...elements: string[]) {
|
|
||||||
super(...elements);
|
|
||||||
|
|
||||||
// Set the prototype explicitly because in ES5, the prototype is accidentally
|
|
||||||
// lost due to a limitation in down-leveling.
|
|
||||||
// https://github.com/Microsoft/TypeScript/wiki/FAQ#why-doesnt-extending-built-ins-like-error-array-and-map-work.
|
|
||||||
Object.setPrototypeOf(this, PullApproveArray.prototype);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Returns a new array which only includes files that match the given pattern. */
|
|
||||||
include(pattern: string): PullApproveArray {
|
|
||||||
return new PullApproveArray(...this.filter(s => getOrCreateGlob(pattern).match(s)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Returns a new array which only includes files that did not match the given pattern. */
|
|
||||||
exclude(pattern: string): PullApproveArray {
|
|
||||||
return new PullApproveArray(...this.filter(s => !getOrCreateGlob(pattern).match(s)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a glob for the given pattern. The cached glob will be returned
|
|
||||||
* if available. Otherwise a new glob will be created and cached.
|
|
||||||
*/
|
|
||||||
function getOrCreateGlob(pattern: string) {
|
|
||||||
if (patternCache.has(pattern)) {
|
|
||||||
return patternCache.get(pattern)!;
|
|
||||||
}
|
|
||||||
const glob = new Minimatch(pattern, {dot: true});
|
|
||||||
patternCache.set(pattern, glob);
|
|
||||||
return glob;
|
|
||||||
}
|
|
||||||
|
@ -9,12 +9,14 @@
|
|||||||
import {error} from '../utils/console';
|
import {error} from '../utils/console';
|
||||||
import {convertConditionToFunction} from './condition_evaluator';
|
import {convertConditionToFunction} from './condition_evaluator';
|
||||||
import {PullApproveGroupConfig} from './parse-yaml';
|
import {PullApproveGroupConfig} from './parse-yaml';
|
||||||
|
import {PullApproveGroupStateDependencyError} from './pullapprove_arrays';
|
||||||
|
|
||||||
/** A condition for a group. */
|
/** A condition for a group. */
|
||||||
interface GroupCondition {
|
interface GroupCondition {
|
||||||
expression: string;
|
expression: string;
|
||||||
checkFn: (files: string[]) => boolean;
|
checkFn: (files: string[], groups: PullApproveGroup[]) => boolean;
|
||||||
matchedFiles: Set<string>;
|
matchedFiles: Set<string>;
|
||||||
|
unverifiable: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Result of testing files against the group. */
|
/** Result of testing files against the group. */
|
||||||
@ -24,6 +26,7 @@ export interface PullApproveGroupResult {
|
|||||||
matchedCount: number;
|
matchedCount: number;
|
||||||
unmatchedConditions: GroupCondition[];
|
unmatchedConditions: GroupCondition[];
|
||||||
unmatchedCount: number;
|
unmatchedCount: number;
|
||||||
|
unverifiableConditions: GroupCondition[];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regular expression that matches conditions for the global approval.
|
// Regular expression that matches conditions for the global approval.
|
||||||
@ -39,7 +42,9 @@ export class PullApproveGroup {
|
|||||||
/** List of conditions for the group. */
|
/** List of conditions for the group. */
|
||||||
conditions: GroupCondition[] = [];
|
conditions: GroupCondition[] = [];
|
||||||
|
|
||||||
constructor(public groupName: string, config: PullApproveGroupConfig) {
|
constructor(
|
||||||
|
public groupName: string, config: PullApproveGroupConfig,
|
||||||
|
readonly precedingGroups: PullApproveGroup[] = []) {
|
||||||
this._captureConditions(config);
|
this._captureConditions(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,6 +63,7 @@ export class PullApproveGroup {
|
|||||||
expression,
|
expression,
|
||||||
checkFn: convertConditionToFunction(expression),
|
checkFn: convertConditionToFunction(expression),
|
||||||
matchedFiles: new Set(),
|
matchedFiles: new Set(),
|
||||||
|
unverifiable: false,
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error(`Could not parse condition in group: ${this.groupName}`);
|
error(`Could not parse condition in group: ${this.groupName}`);
|
||||||
@ -76,33 +82,47 @@ export class PullApproveGroup {
|
|||||||
* the pull approve group's conditions.
|
* the pull approve group's conditions.
|
||||||
*/
|
*/
|
||||||
testFile(filePath: string): boolean {
|
testFile(filePath: string): boolean {
|
||||||
return this.conditions.every(({matchedFiles, checkFn, expression}) => {
|
return this.conditions.every((condition) => {
|
||||||
|
const {matchedFiles, checkFn, expression} = condition;
|
||||||
try {
|
try {
|
||||||
const matchesFile = checkFn([filePath]);
|
const matchesFile = checkFn([filePath], this.precedingGroups);
|
||||||
if (matchesFile) {
|
if (matchesFile) {
|
||||||
matchedFiles.add(filePath);
|
matchedFiles.add(filePath);
|
||||||
}
|
}
|
||||||
return matchesFile;
|
return matchesFile;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const errMessage = `Condition could not be evaluated: \n\n` +
|
// In the case of a condition that depends on the state of groups we want to
|
||||||
`From the [${this.groupName}] group:\n` +
|
// ignore that the verification can't accurately evaluate the condition and then
|
||||||
` - ${expression}` +
|
// continue processing. Other types of errors fail the verification, as conditions
|
||||||
`\n\n${e.message} ${e.stack}\n\n`;
|
// should otherwise be able to execute without throwing.
|
||||||
error(errMessage);
|
if (e instanceof PullApproveGroupStateDependencyError) {
|
||||||
process.exit(1);
|
condition.unverifiable = true;
|
||||||
|
// Return true so that `this.conditions.every` can continue evaluating.
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
const errMessage = `Condition could not be evaluated: \n\n` +
|
||||||
|
`From the [${this.groupName}] group:\n` +
|
||||||
|
` - ${expression}` +
|
||||||
|
`\n\n${e.message} ${e.stack}\n\n`;
|
||||||
|
error(errMessage);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Retrieve the results for the Group, all matched and unmatched conditions. */
|
/** Retrieve the results for the Group, all matched and unmatched conditions. */
|
||||||
getResults(): PullApproveGroupResult {
|
getResults(): PullApproveGroupResult {
|
||||||
const matchedConditions = this.conditions.filter(c => !!c.matchedFiles.size);
|
const matchedConditions = this.conditions.filter(c => c.matchedFiles.size > 0);
|
||||||
const unmatchedConditions = this.conditions.filter(c => !c.matchedFiles.size);
|
const unmatchedConditions =
|
||||||
|
this.conditions.filter(c => c.matchedFiles.size === 0 && !c.unverifiable);
|
||||||
|
const unverifiableConditions = this.conditions.filter(c => c.unverifiable);
|
||||||
return {
|
return {
|
||||||
matchedConditions,
|
matchedConditions,
|
||||||
matchedCount: matchedConditions.length,
|
matchedCount: matchedConditions.length,
|
||||||
unmatchedConditions,
|
unmatchedConditions,
|
||||||
unmatchedCount: unmatchedConditions.length,
|
unmatchedCount: unmatchedConditions.length,
|
||||||
|
unverifiableConditions,
|
||||||
groupName: this.groupName,
|
groupName: this.groupName,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user