Compare commits
413 Commits
merge_pr_m
...
6.0.0-rc.4
Author | SHA1 | Date | |
---|---|---|---|
01975ff021 | |||
77c4b82938 | |||
1fc72e53f5 | |||
bbfa1d31a4 | |||
58faa0c7e7 | |||
aae437cb1e | |||
fa11d7822c | |||
1619160c8a | |||
7a8c58162c | |||
e0ae74d40e | |||
af46d097ff | |||
7e8cee6b61 | |||
37d2cb4553 | |||
ce40e85cbb | |||
5706810af2 | |||
a4ac8728cb | |||
d1e33d2df7 | |||
0d516f1658 | |||
de3ca56769 | |||
764760ba63 | |||
b3a10e0a42 | |||
0cb4f12a7a | |||
4b96a58c5a | |||
ee145790d7 | |||
c973830d9a | |||
8555a3a3cd | |||
f1db789450 | |||
50030f650b | |||
3fb4e190a8 | |||
4f7fac0e03 | |||
50ab8d8ad4 | |||
f544635014 | |||
c059670792 | |||
9a2479d423 | |||
720031b5f6 | |||
10ecdb13bf | |||
bb3f0e5ed2 | |||
37c1634276 | |||
58143555bc | |||
60e8392722 | |||
f4c56f4931 | |||
30a6861fd0 | |||
5a298b1c5e | |||
3e8eef6015 | |||
1fac5f4eb1 | |||
33f8120164 | |||
2cc2389fc6 | |||
da58a55ece | |||
11ea3a3f33 | |||
195193b9be | |||
0fba9a6e57 | |||
3a9d916632 | |||
eb9968ab2a | |||
b5f41f2c35 | |||
629629d1bd | |||
ae8a0092bd | |||
628303d2cb | |||
d80e9304c6 | |||
5cd36c7764 | |||
f3d2623f0f | |||
083474e429 | |||
fc813f67f4 | |||
3b607e60e9 | |||
b874501025 | |||
ce43e96d49 | |||
524e5d8ae7 | |||
79cecf9a5e | |||
ac316be79b | |||
b8053f1d4f | |||
9d9fb607cd | |||
5dc50e4688 | |||
9141424ac6 | |||
31b90436b4 | |||
f66f408b04 | |||
92821e338b | |||
1aef4df127 | |||
0a065bbdcf | |||
8ea15b4f12 | |||
7dc150c1e8 | |||
5bb14a68d2 | |||
381da1af45 | |||
cdd05bd2ca | |||
079d8e57d5 | |||
46ba7f69dd | |||
5db9ab12c0 | |||
7c039613dd | |||
dae4689b1c | |||
bf88c5c9f8 | |||
1aebee42eb | |||
6699fb5d77 | |||
6dd8f6efe4 | |||
5b6e59cfb3 | |||
f48e215305 | |||
32a41bc738 | |||
f99cb5c995 | |||
aaefd51a88 | |||
4a426696c9 | |||
5c8340aae0 | |||
c560423b52 | |||
46eadb5cfb | |||
1678423619 | |||
412b85ba89 | |||
d37064ce28 | |||
cae48df25b | |||
23cc3ef2eb | |||
550433a128 | |||
4506230fbb | |||
5671ae6a58 | |||
fab6b39c3d | |||
18ac228a27 | |||
7ca772060b | |||
580f05bd9c | |||
d284404060 | |||
92724b396b | |||
62e6e21895 | |||
fa2c9a81dd | |||
a4bf5621ed | |||
55c9fb298f | |||
60065935be | |||
5266ffe04a | |||
4290ea4bb9 | |||
e7f1af3c54 | |||
a2330ff2db | |||
ff34d5ea7a | |||
ad9ce5cb41 | |||
7a1c43733b | |||
85d3b591b6 | |||
43d62029f0 | |||
3df811767e | |||
9c7805be2f | |||
d6bf71ae95 | |||
9cd446565c | |||
6e5fb99304 | |||
6cb1adf105 | |||
a9e05ac82f | |||
120673a3ac | |||
8c10df30d7 | |||
0c4e3718f5 | |||
6880766fb7 | |||
a30728ca5a | |||
aebf04e32c | |||
15278784fc | |||
22cb2c9441 | |||
88a93e730e | |||
dc95e7bc33 | |||
7fdc24db72 | |||
3603a10ea2 | |||
6f7d14064c | |||
a5f0939eae | |||
193737a1ea | |||
be10bf538b | |||
439030fb57 | |||
481b22ecb0 | |||
45e090b614 | |||
0d9140cdce | |||
9fb08e2377 | |||
de0b13d41d | |||
07d33d4e5a | |||
9f7bd8f618 | |||
28058b784b | |||
7de13b60d6 | |||
00497437a6 | |||
4e004f3783 | |||
d9dc46e651 | |||
9e9b8dd494 | |||
12665a749c | |||
e2e80ec61c | |||
5a86f7144f | |||
bd024c02e2 | |||
884bf0ef09 | |||
0b348c8ffe | |||
e1ea7ed019 | |||
ed53c5ccdd | |||
d28ce50067 | |||
ab348ee2be | |||
0ebdb3d12f | |||
de90314304 | |||
f739f756ce | |||
910a16a1ff | |||
2aabbc51fa | |||
2388f24256 | |||
27e14b2fb3 | |||
7a406a32fa | |||
bf6a416bce | |||
7b7757dd3d | |||
4bd3a65764 | |||
6f0191744c | |||
4f0cae0676 | |||
65f296a676 | |||
b9cbe83104 | |||
60d99839de | |||
7966744a44 | |||
d9a0a8ff3e | |||
bcaa07b0ac | |||
d98e9e7c7f | |||
16f021c319 | |||
3a30f5d937 | |||
0f88fc73db | |||
01d2dd2a3a | |||
da76db9601 | |||
91503e538e | |||
53227abe7b | |||
768100516f | |||
328511be8e | |||
56e545735c | |||
07e9969cb7 | |||
5ab9d4d437 | |||
129bb1800b | |||
49396ca2ae | |||
34981063ec | |||
8ca26a9ebb | |||
e44f69c387 | |||
99711b12f9 | |||
204ba9d413 | |||
e5e1b0da33 | |||
d77bb460b0 | |||
bb58664b13 | |||
bfe35dac85 | |||
c84817970e | |||
b524e4b142 | |||
f88fba020b | |||
32105c8012 | |||
4a075e885f | |||
838a610197 | |||
f461f43d72 | |||
64efcf103c | |||
b12ea30a66 | |||
8c2a57878b | |||
4f2c51fe56 | |||
061564394f | |||
7cd8e8dbd1 | |||
73261a8b70 | |||
f285cff10b | |||
8768665587 | |||
623d769858 | |||
17fb9832f4 | |||
3cc5c2e4d0 | |||
fad86a67ca | |||
5f1be9b89b | |||
e6c731f791 | |||
7d095b96cd | |||
67f570caeb | |||
689f351092 | |||
4648597d14 | |||
b43f8bc7d3 | |||
c445314239 | |||
4a7be487da | |||
5caad5fe93 | |||
e5fcf650f8 | |||
2b3de6390f | |||
5c387a7f3c | |||
fc50c77bd3 | |||
bfe077ad64 | |||
1a0cb21538 | |||
0bede54b2d | |||
243c86cd04 | |||
9054e357d6 | |||
0b68a35ff2 | |||
e27cfd6236 | |||
1612985e48 | |||
4f21d373b7 | |||
ce63dc6f95 | |||
d54615d555 | |||
912fe08756 | |||
99408d0445 | |||
f258ec67bf | |||
5d82d8da6d | |||
6ef9f2278f | |||
688096b7a3 | |||
2e450f6fda | |||
fe21437232 | |||
cf3ff7d219 | |||
d72f44556d | |||
0b45dfac29 | |||
167fdf745c | |||
39a12d2c3d | |||
87f60bccfd | |||
46efd4b938 | |||
19368085aa | |||
d2be675acc | |||
44f637a88b | |||
863aff1a77 | |||
400460cc93 | |||
4d506acba0 | |||
7c9b411777 | |||
22b96b9690 | |||
cedc04c320 | |||
bafdad9083 | |||
9220521149 | |||
b149424b11 | |||
269c3a1908 | |||
f9247e4b2e | |||
44de10e2db | |||
0ebd577db4 | |||
4e6ac185e5 | |||
e55bf8fa79 | |||
3b167be069 | |||
02e6ac2117 | |||
04ca77e38e | |||
a011654c71 | |||
88b3198c80 | |||
6e5e819e80 | |||
19e6b8dad5 | |||
f256c02b5e | |||
dd20898bd5 | |||
d509bd6849 | |||
cd2ebd22fd | |||
112431db69 | |||
a0a01f1e1e | |||
ae19d071bb | |||
f5a98f41fe | |||
c09bd67aee | |||
9df13add5d | |||
049757b237 | |||
1f9734315d | |||
6f0dad1710 | |||
37fedd001c | |||
b1365d1fa8 | |||
4ac606b419 | |||
51027d73cc | |||
48636f3e85 | |||
bd9d4df735 | |||
34e355a3b0 | |||
58b94e6f5e | |||
db56836425 | |||
21e44c6ba9 | |||
f5d75d8efd | |||
6e00410e1c | |||
f95730b8e2 | |||
cd58c0a6d9 | |||
38fef1588d | |||
3f70aba272 | |||
eb6fb2d8f9 | |||
c602563589 | |||
8449eb8d62 | |||
a225b48482 | |||
129d1e0fb1 | |||
aa7dba244b | |||
0bf6fa5b32 | |||
40315bef3d | |||
123efba388 | |||
fa451bcd19 | |||
0d8deb0795 | |||
e8326e600d | |||
b5be18f405 | |||
1e6cc42a01 | |||
b26a90567c | |||
b0b9ca3386 | |||
5412e10bcd | |||
489fec1299 | |||
2fee5cc095 | |||
f13f4db9dc | |||
2ca77d80ec | |||
73c203fda9 | |||
c499c8f4db | |||
4c089c1d93 | |||
d485346d3c | |||
8407fcc979 | |||
f64ee15487 | |||
5d4fa7f0c8 | |||
8fb34bcd43 | |||
6d1367d297 | |||
538f1d980f | |||
065bcc5aad | |||
8ad4ae0a07 | |||
ffc6ee0086 | |||
78167915ee | |||
ad8fb8484f | |||
ce649f725f | |||
fcb8c492d6 | |||
4f744cc66f | |||
505ae752b6 | |||
363dfa5437 | |||
b3d1761825 | |||
d0db9ded90 | |||
4c40812b71 | |||
fa974c7d4e | |||
2c75acc5b3 | |||
f86d8ae0fd | |||
94bc277b1b | |||
8ea4c57174 | |||
53b0fe8144 | |||
2a1e3d191f | |||
2c2b62f45f | |||
58932c7f38 | |||
5bb9f64218 | |||
405d97431f | |||
41064fcb36 | |||
b80fd6be58 | |||
3aea8fd5f3 | |||
b64139650c | |||
1d2bdcb4d0 | |||
12be311618 | |||
51ca643c27 | |||
69d359bb51 | |||
4f60968704 | |||
25faf808a5 | |||
d7e5d45f43 | |||
ba8df8a3f1 | |||
0451fd93df | |||
49f074f61d | |||
ec445b5c73 | |||
ab790f3c84 | |||
dd534471ec | |||
8bb2f5c71d | |||
0e311e3918 | |||
997b30a093 | |||
94707fe795 | |||
2f0ab7ee98 | |||
b8fe121a16 | |||
e751a0a2bb | |||
288851c41e | |||
9eaf1bbe67 |
@ -8,6 +8,15 @@ build --noshow_progress
|
|||||||
# Don't run manual tests
|
# Don't run manual tests
|
||||||
test --test_tag_filters=-manual
|
test --test_tag_filters=-manual
|
||||||
|
|
||||||
|
# Print all the options that apply to the build.
|
||||||
|
# This helps us diagnose which options override others
|
||||||
|
# (e.g. /etc/bazel.bazelrc vs. tools/bazel.rc)
|
||||||
|
build --announce_rc
|
||||||
|
|
||||||
|
# Create dist/bin symlink to $(bazel info bazel-bin)
|
||||||
|
# We use this when uploading artifacts after the build finishes
|
||||||
|
build --symlink_prefix=dist/
|
||||||
|
|
||||||
# Enable experimental CircleCI bazel remote cache proxy
|
# Enable experimental CircleCI bazel remote cache proxy
|
||||||
# See remote cache documentation in /docs/BAZEL.md
|
# See remote cache documentation in /docs/BAZEL.md
|
||||||
build --experimental_remote_spawn_cache --remote_rest_cache=http://localhost:7643
|
build --experimental_remote_spawn_cache --remote_rest_cache=http://localhost:7643
|
||||||
@ -15,11 +24,16 @@ build --experimental_remote_spawn_cache --remote_rest_cache=http://localhost:764
|
|||||||
# Prevent unstable environment variables from tainting cache keys
|
# Prevent unstable environment variables from tainting cache keys
|
||||||
build --experimental_strict_action_env
|
build --experimental_strict_action_env
|
||||||
|
|
||||||
|
# Save downloaded repositories such as the go toolchain
|
||||||
|
# This directory can then be included in the CircleCI cache
|
||||||
|
# It should save time running the first build
|
||||||
|
build --experimental_repository_cache=/home/circleci/bazel_repository_cache
|
||||||
|
|
||||||
# Workaround https://github.com/bazelbuild/bazel/issues/3645
|
# Workaround https://github.com/bazelbuild/bazel/issues/3645
|
||||||
# Bazel doesn't calculate the memory ceiling correctly when running under Docker.
|
# Bazel doesn't calculate the memory ceiling correctly when running under Docker.
|
||||||
# Limit Bazel to consuming resources that fit in CircleCI "medium" class which is the default:
|
# Limit Bazel to consuming resources that fit in CircleCI "xlarge" class
|
||||||
# https://circleci.com/docs/2.0/configuration-reference/#resource_class
|
# https://circleci.com/docs/2.0/configuration-reference/#resource_class
|
||||||
build --local_resources=3072,2.0,1.0
|
build --local_resources=14336,8.0,1.0
|
||||||
|
|
||||||
# Retry in the event of flakes, eg. https://circleci.com/gh/angular/angular/31309
|
# Retry in the event of flakes, eg. https://circleci.com/gh/angular/angular/31309
|
||||||
test --flaky_test_attempts=2
|
test --flaky_test_attempts=2
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
## IMPORTANT
|
## IMPORTANT
|
||||||
# If you change the `docker_image` version, also change the `cache_key` suffix and the version of
|
# If you change the `docker_image` version, also change the `cache_key` suffix and the version of
|
||||||
# `com_github_bazelbuild_buildtools` in the `/WORKSPACE` file.
|
# `com_github_bazelbuild_buildtools` in the `/WORKSPACE` file.
|
||||||
var_1: &docker_image angular/ngcontainer:0.1.0
|
var_1: &docker_image angular/ngcontainer:0.2.0
|
||||||
var_2: &cache_key angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.1.0
|
var_2: &cache_key v2-angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.2.0
|
||||||
|
|
||||||
# See remote cache documentation in /docs/BAZEL.md
|
# See remote cache documentation in /docs/BAZEL.md
|
||||||
var_3: &setup-bazel-remote-cache
|
var_3: &setup-bazel-remote-cache
|
||||||
@ -41,14 +41,16 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- checkout:
|
- checkout:
|
||||||
<<: *post_checkout
|
<<: *post_checkout
|
||||||
# See remote cache documentation in /docs/BAZEL.md
|
|
||||||
- run: .circleci/setup_cache.sh
|
|
||||||
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
|
|
||||||
- *setup-bazel-remote-cache
|
|
||||||
|
|
||||||
- run: 'yarn buildifier -mode=check ||
|
# Check BUILD.bazel formatting before we have a node_modules directory
|
||||||
(echo -e "\nBUILD files not formatted. Please run ''yarn buildifier''" ; exit 1)'
|
# Then we don't need any exclude pattern to avoid checking those files
|
||||||
- run: 'yarn skylint ||
|
- run: 'buildifier -mode=check $(find . -type f \( -name BUILD.bazel -or -name BUILD \)) ||
|
||||||
|
(echo "BUILD files not formatted. Please run ''yarn buildifier''" ; exit 1)'
|
||||||
|
# Run the skylark linter to check our Bazel rules
|
||||||
|
# deprecated-api is disabled because we use actions.new_file(genfiles_dir)
|
||||||
|
# which has no replacement, see https://github.com/bazelbuild/bazel/issues/4858
|
||||||
|
- run: 'find . -type f -name "*.bzl" |
|
||||||
|
xargs java -jar /usr/local/bin/Skylint_deploy.jar --disable-checks=deprecated-api ||
|
||||||
(echo -e "\n.bzl files have lint errors. Please run ''yarn skylint''"; exit 1)'
|
(echo -e "\n.bzl files have lint errors. Please run ''yarn skylint''"; exit 1)'
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
@ -59,7 +61,7 @@ jobs:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
<<: *job_defaults
|
<<: *job_defaults
|
||||||
resource_class: large
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- checkout:
|
- checkout:
|
||||||
<<: *post_checkout
|
<<: *post_checkout
|
||||||
@ -71,26 +73,44 @@ jobs:
|
|||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: *cache_key
|
key: *cache_key
|
||||||
|
|
||||||
|
- run: ls /home/circleci/bazel_repository_cache || true
|
||||||
- run: bazel info release
|
- run: bazel info release
|
||||||
- run: bazel run @yarn//:yarn
|
- run: bazel run @yarn//:yarn
|
||||||
# Use bazel query so that we explicitly ask for all buildable targets to be built as well
|
# Use bazel query so that we explicitly ask for all buildable targets to be built as well
|
||||||
# This avoids waiting for a build command to finish before running the first test
|
# This avoids waiting for the slowest build target to finish before running the first test
|
||||||
# See https://github.com/bazelbuild/bazel/issues/4257
|
# See https://github.com/bazelbuild/bazel/issues/4257
|
||||||
- run: bazel query --output=label '//modules/... union //packages/... union //tools/...' | xargs bazel test
|
# NOTE: Angular developers should typically just bazel build //packages/... or bazel test //packages/...
|
||||||
|
- run: bazel query --output=label //... | xargs bazel test
|
||||||
|
|
||||||
# CircleCI will allow us to go back and view/download these artifacts from past builds.
|
# CircleCI will allow us to go back and view/download these artifacts from past builds.
|
||||||
# Also we can use a service like https://buildsize.org/ to automatically track binary size of these artifacts.
|
# Also we can use a service like https://buildsize.org/ to automatically track binary size of these artifacts.
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: dist/bin/packages/core/test/bundling/hello_world/bundle.min.js
|
path: dist/bin/packages/core/test/bundling/hello_world/bundle.min.js
|
||||||
destination: packages/core/test/bundling/hello_world/bundle.min.js
|
destination: packages/core/test/bundling/hello_world/bundle.min.js
|
||||||
|
- store_artifacts:
|
||||||
|
path: dist/bin/packages/core/test/bundling/todo/bundle.min.js
|
||||||
|
destination: packages/core/test/bundling/todo/bundle.min.js
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: dist/bin/packages/core/test/bundling/hello_world/bundle.min.js.brotli
|
path: dist/bin/packages/core/test/bundling/hello_world/bundle.min.js.brotli
|
||||||
destination: packages/core/test/bundling/hello_world/bundle.min.js.brotli
|
destination: packages/core/test/bundling/hello_world/bundle.min.js.brotli
|
||||||
|
- store_artifacts:
|
||||||
|
path: dist/bin/packages/core/test/bundling/todo/bundle.min.js.brotli
|
||||||
|
destination: packages/core/test/bundling/todo/bundle.min.js.brotli
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: *cache_key
|
key: *cache_key
|
||||||
paths:
|
paths:
|
||||||
- "node_modules"
|
- "node_modules"
|
||||||
|
- "~/bazel_repository_cache"
|
||||||
|
|
||||||
|
aio_monitoring:
|
||||||
|
<<: *job_defaults
|
||||||
|
steps:
|
||||||
|
- checkout:
|
||||||
|
<<: *post_checkout
|
||||||
|
- restore_cache:
|
||||||
|
key: *cache_key
|
||||||
|
- run: xvfb-run --auto-servernum ./aio/scripts/test-production.sh
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
@ -98,3 +118,13 @@ workflows:
|
|||||||
jobs:
|
jobs:
|
||||||
- lint
|
- lint
|
||||||
- build
|
- build
|
||||||
|
aio_monitoring:
|
||||||
|
jobs:
|
||||||
|
- aio_monitoring
|
||||||
|
triggers:
|
||||||
|
- schedule:
|
||||||
|
cron: "0 0 * * *"
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
2
.github/ISSUE_TEMPLATE.md
vendored
2
.github/ISSUE_TEMPLATE.md
vendored
@ -9,9 +9,11 @@ ISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.
|
|||||||
<pre><code>
|
<pre><code>
|
||||||
[ ] Regression (a behavior that used to work and stopped working in a new release)
|
[ ] Regression (a behavior that used to work and stopped working in a new release)
|
||||||
[ ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting -->
|
[ ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting -->
|
||||||
|
[ ] Performance issue
|
||||||
[ ] Feature request
|
[ ] Feature request
|
||||||
[ ] Documentation issue or request
|
[ ] Documentation issue or request
|
||||||
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
|
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
|
||||||
|
[ ] Other... Please describe:
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
## Current behavior
|
## Current behavior
|
||||||
|
27
.github/angular-robot.yml
vendored
27
.github/angular-robot.yml
vendored
@ -19,16 +19,16 @@ merge:
|
|||||||
disabled: false
|
disabled: false
|
||||||
# the name of the status
|
# the name of the status
|
||||||
context: "google3"
|
context: "google3"
|
||||||
# text to show when the status is pending
|
# text to show when the status is pending, {{PRNumber}} will be replaced by the PR number
|
||||||
pendingDesc: "Googler: test this change in google3 http://go/angular-g3sync"
|
pendingDesc: "Googler: run g3sync presubmit {{PRNumber}}"
|
||||||
# text to show when the status is success
|
# text to show when the status is success
|
||||||
successDesc: "Does not affect google3"
|
successDesc: "Does not affect google3"
|
||||||
|
# link to use for the details
|
||||||
|
url: "http://go/angular-g3sync"
|
||||||
# list of patterns to check for the files changed by the PR
|
# list of patterns to check for the files changed by the PR
|
||||||
# this list must be manually kept in sync with google3/third_party/javascript/angular2/copy.bara.sky
|
# this list must be manually kept in sync with google3/third_party/javascript/angular2/copy.bara.sky
|
||||||
include:
|
include:
|
||||||
- "BUILD.bazel"
|
|
||||||
- "LICENSE"
|
- "LICENSE"
|
||||||
- "WORKSPACE"
|
|
||||||
- "modules/**"
|
- "modules/**"
|
||||||
- "packages/**"
|
- "packages/**"
|
||||||
# list of patterns to ignore for the files changed by the PR
|
# list of patterns to ignore for the files changed by the PR
|
||||||
@ -36,6 +36,11 @@ merge:
|
|||||||
- "packages/language-service/**"
|
- "packages/language-service/**"
|
||||||
- "**/.gitignore"
|
- "**/.gitignore"
|
||||||
- "**/.gitkeep"
|
- "**/.gitkeep"
|
||||||
|
- "**/tsconfig-build.json"
|
||||||
|
- "**/tsconfig.json"
|
||||||
|
- "**/rollup.config.js"
|
||||||
|
- "**/BUILD.bazel"
|
||||||
|
- "packages/**/test/**"
|
||||||
|
|
||||||
# comment that will be added to a PR when there is a conflict, leave empty or set to false to disable
|
# comment that will be added to a PR when there is a conflict, leave empty or set to false to disable
|
||||||
mergeConflictComment: "Hi @{{PRAuthor}}! This PR has merge conflicts due to recent upstream merges.
|
mergeConflictComment: "Hi @{{PRAuthor}}! This PR has merge conflicts due to recent upstream merges.
|
||||||
@ -68,9 +73,9 @@ merge:
|
|||||||
- "ci/circleci: build"
|
- "ci/circleci: build"
|
||||||
- "ci/circleci: lint"
|
- "ci/circleci: lint"
|
||||||
|
|
||||||
# the comment that will be added when the merge label is added despite failing checks, leave empty or set to false to disable
|
# the comment that will be added when the merge label is added despite failing checks, leave empty or set to false to disable
|
||||||
# {{MERGE_LABEL}} will be replaced by the value of the mergeLabel option
|
# {{MERGE_LABEL}} will be replaced by the value of the mergeLabel option
|
||||||
# {{PLACEHOLDER}} will be replaced by the list of failing checks
|
# {{PLACEHOLDER}} will be replaced by the list of failing checks
|
||||||
mergeRemovedComment: "I see that you just added the `{{MERGE_LABEL}}` label, but the following checks are still failing:
|
mergeRemovedComment: "I see that you just added the `{{MERGE_LABEL}}` label, but the following checks are still failing:
|
||||||
\n{{PLACEHOLDER}}
|
\n{{PLACEHOLDER}}
|
||||||
\n
|
\n
|
||||||
@ -84,8 +89,12 @@ triage:
|
|||||||
needsTriageMilestone: 83,
|
needsTriageMilestone: 83,
|
||||||
# number of the milestone to apply when the issue is triaged
|
# number of the milestone to apply when the issue is triaged
|
||||||
defaultMilestone: 82,
|
defaultMilestone: 82,
|
||||||
# arrays of labels that determine if an issue is triaged
|
# arrays of labels that determine if an issue has been triaged by the caretaker
|
||||||
triagedLabels:
|
l1TriageLabels:
|
||||||
|
-
|
||||||
|
- "comp: *"
|
||||||
|
# arrays of labels that determine if an issue has been fully triaged
|
||||||
|
l2TriageLabels:
|
||||||
-
|
-
|
||||||
- "type: bug/fix"
|
- "type: bug/fix"
|
||||||
- "severity*"
|
- "severity*"
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,6 +14,7 @@ pubspec.lock
|
|||||||
.settings/
|
.settings/
|
||||||
*.swo
|
*.swo
|
||||||
modules/.settings
|
modules/.settings
|
||||||
|
.bazelrc
|
||||||
.vscode
|
.vscode
|
||||||
modules/.vscode
|
modules/.vscode
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#
|
#
|
||||||
# alexeagle - Alex Eagle
|
# alexeagle - Alex Eagle
|
||||||
# alxhub - Alex Rickabaugh
|
# alxhub - Alex Rickabaugh
|
||||||
|
# andrewseguin - Andrew Seguin
|
||||||
# brocco - Mike Brocchi
|
# brocco - Mike Brocchi
|
||||||
# chuckjaz - Chuck Jazdzewski
|
# chuckjaz - Chuck Jazdzewski
|
||||||
# filipesilva - Filipe Silva
|
# filipesilva - Filipe Silva
|
||||||
@ -68,6 +69,7 @@ groups:
|
|||||||
- "packages/*"
|
- "packages/*"
|
||||||
- "tools/*"
|
- "tools/*"
|
||||||
users:
|
users:
|
||||||
|
- alexeagle
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
- mhevery
|
- mhevery
|
||||||
|
|
||||||
@ -301,6 +303,16 @@ groups:
|
|||||||
- IgorMinar #fallback
|
- IgorMinar #fallback
|
||||||
- mhevery #fallback
|
- mhevery #fallback
|
||||||
|
|
||||||
|
elements:
|
||||||
|
conditions:
|
||||||
|
files:
|
||||||
|
- "packages/elements/*"
|
||||||
|
users:
|
||||||
|
- andrewseguin #primary
|
||||||
|
- gkalpak
|
||||||
|
- IgorMinar #fallback
|
||||||
|
- mhevery #fallback
|
||||||
|
|
||||||
benchpress:
|
benchpress:
|
||||||
conditions:
|
conditions:
|
||||||
files:
|
files:
|
||||||
|
61
BUILD.bazel
61
BUILD.bazel
@ -1,43 +1,39 @@
|
|||||||
package(default_visibility = ["//visibility:public"])
|
package(default_visibility = ["//visibility:public"])
|
||||||
|
|
||||||
|
load("@build_bazel_rules_nodejs//:defs.bzl", "node_modules_filegroup")
|
||||||
|
|
||||||
exports_files([
|
exports_files([
|
||||||
"tsconfig.json",
|
"tsconfig.json",
|
||||||
|
"LICENSE",
|
||||||
])
|
])
|
||||||
|
|
||||||
# This rule belongs in node_modules/BUILD
|
# Developers should always run `bazel run :install`
|
||||||
# It's here as a workaround for
|
# This ensures that package.json in subdirectories get installed as well.
|
||||||
# https://github.com/bazelbuild/bazel/issues/374#issuecomment-296217940
|
alias(
|
||||||
filegroup(
|
name = "install",
|
||||||
|
actual = "@yarn//:yarn",
|
||||||
|
)
|
||||||
|
|
||||||
|
node_modules_filegroup(
|
||||||
name = "node_modules",
|
name = "node_modules",
|
||||||
# Performance workaround: list individual files
|
packages = [
|
||||||
# Reduces the number of files as inputs to nodejs_binary:
|
|
||||||
# bazel query "deps(:node_modules)" | wc -l
|
|
||||||
# This won't scale in the general case.
|
|
||||||
# TODO(alexeagle): figure out what to do
|
|
||||||
srcs = glob(["/".join([
|
|
||||||
"node_modules",
|
|
||||||
pkg,
|
|
||||||
"**",
|
|
||||||
ext,
|
|
||||||
]) for pkg in [
|
|
||||||
"jasmine",
|
|
||||||
"typescript",
|
|
||||||
"zone.js",
|
|
||||||
"tsutils",
|
|
||||||
"@types",
|
|
||||||
"tsickle",
|
|
||||||
"hammerjs",
|
|
||||||
"protobufjs",
|
|
||||||
"bytebuffer",
|
"bytebuffer",
|
||||||
|
"hammerjs",
|
||||||
|
"jasmine",
|
||||||
|
"minimist",
|
||||||
|
"protobufjs",
|
||||||
"reflect-metadata",
|
"reflect-metadata",
|
||||||
"source-map-support",
|
"source-map-support",
|
||||||
"minimist",
|
"tsickle",
|
||||||
"tslib",
|
"tslib",
|
||||||
] for ext in [
|
"tsutils",
|
||||||
"*.js",
|
"typescript",
|
||||||
"*.json",
|
"zone.js",
|
||||||
"*.d.ts",
|
"@angular-devkit/core",
|
||||||
]]),
|
"@angular-devkit/schematics",
|
||||||
|
"@types",
|
||||||
|
"@webcomponents/custom-elements",
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
filegroup(
|
filegroup(
|
||||||
@ -46,11 +42,8 @@ filegroup(
|
|||||||
srcs = [
|
srcs = [
|
||||||
"//:node_modules/reflect-metadata/Reflect.js",
|
"//:node_modules/reflect-metadata/Reflect.js",
|
||||||
"//:node_modules/zone.js/dist/zone.js",
|
"//:node_modules/zone.js/dist/zone.js",
|
||||||
"//:node_modules/zone.js/dist/async-test.js",
|
"//:node_modules/zone.js/dist/zone-testing.js",
|
||||||
"//:node_modules/zone.js/dist/sync-test.js",
|
"//:node_modules/zone.js/dist/task-tracking.js",
|
||||||
"//:node_modules/zone.js/dist/fake-async-test.js",
|
|
||||||
"//:node_modules/zone.js/dist/proxy.js",
|
|
||||||
"//:node_modules/zone.js/dist/jasmine-patch.js",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
327
CHANGELOG.md
327
CHANGELOG.md
@ -1,3 +1,316 @@
|
|||||||
|
<a name="6.0.0-rc.4"></a>
|
||||||
|
# [6.0.0-rc.4](https://github.com/angular/angular/compare/6.0.0-rc.3...6.0.0-rc.4) (2018-04-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **bazel:** set rollup output.name and amd.id ([#23274](https://github.com/angular/angular/issues/23274)) ([3e8eef6](https://github.com/angular/angular/commit/3e8eef6)), closes [#23238](https://github.com/angular/angular/issues/23238)
|
||||||
|
* **common:** replace i18n locale undefined values by a const ([#23265](https://github.com/angular/angular/issues/23265)) ([5706810](https://github.com/angular/angular/commit/5706810)), closes [#22988](https://github.com/angular/angular/issues/22988)
|
||||||
|
* **common:** workaround UMD/webpack limitation ([#23271](https://github.com/angular/angular/issues/23271)) ([5a298b1](https://github.com/angular/angular/commit/5a298b1)), closes [#23217](https://github.com/angular/angular/issues/23217)
|
||||||
|
* **compiler:** Pretty print object instead of [Object object] ([#22689](https://github.com/angular/angular/issues/22689)) ([8555a3a](https://github.com/angular/angular/commit/8555a3a))
|
||||||
|
* **compiler-cli:** strictMetadataEmit should not break on non-compliant libraries ([#23275](https://github.com/angular/angular/issues/23275)) ([5814355](https://github.com/angular/angular/commit/5814355)), closes [#22210](https://github.com/angular/angular/issues/22210)
|
||||||
|
* **elements:** avoid exception when window is undefined ([#23324](https://github.com/angular/angular/issues/23324)) ([af46d09](https://github.com/angular/angular/commit/af46d09))
|
||||||
|
* **platform-server:** require node v8+ ([#23331](https://github.com/angular/angular/issues/23331)) ([bbfa1d3](https://github.com/angular/angular/commit/bbfa1d3))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **elements:** add schematics ([#23298](https://github.com/angular/angular/issues/23298)) ([37d2cb4](https://github.com/angular/angular/commit/37d2cb4))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="6.0.0-rc.3"></a>
|
||||||
|
# [6.0.0-rc.3](https://github.com/angular/angular/compare/6.0.0-rc.2...6.0.0-rc.3) (2018-04-06)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **bazel:** don't produce ngfactory files for ng_packages ([#23237](https://github.com/angular/angular/issues/23237)) ([da58a55](https://github.com/angular/angular/commit/da58a55))
|
||||||
|
* **compiler-cli:** don't lower expressions in flat module metadata ([#23226](https://github.com/angular/angular/issues/23226)) ([11ea3a3](https://github.com/angular/angular/commit/11ea3a3))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="6.0.0-rc.2"></a>
|
||||||
|
# [6.0.0-rc.2](https://github.com/angular/angular/compare/6.0.0-rc.1...6.0.0-rc.2) (2018-04-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **common:** `locales` are not being shipped ([#23136](https://github.com/angular/angular/issues/23136)) ([7ca7720](https://github.com/angular/angular/commit/7ca7720))
|
||||||
|
* **common:** properly take className changes into account ([#21937](https://github.com/angular/angular/issues/21937)) ([4a42669](https://github.com/angular/angular/commit/4a42669)), closes [#21932](https://github.com/angular/angular/issues/21932)
|
||||||
|
* **compiler-cli:** flat module index metadata should be transformed ([#23129](https://github.com/angular/angular/issues/23129)) ([f99cb5c](https://github.com/angular/angular/commit/f99cb5c))
|
||||||
|
* **core:** inject() should always work in an NgModule injection scope ([#23148](https://github.com/angular/angular/issues/23148)) ([fab6b39](https://github.com/angular/angular/commit/fab6b39)), closes [angular/material2#10586](https://github.com/angular/material2/issues/10586)
|
||||||
|
* **forms:** improve error message for invalid value accessors ([#22731](https://github.com/angular/angular/issues/22731)) ([23cc3ef](https://github.com/angular/angular/commit/23cc3ef))
|
||||||
|
* **upgrade:** correctly handle downgraded `OnPush` components ([#22209](https://github.com/angular/angular/issues/22209)) ([ad9ce5c](https://github.com/angular/angular/commit/ad9ce5c)), closes [#14286](https://github.com/angular/angular/issues/14286)
|
||||||
|
* **upgrade:** propagate return value of resumeBootstrap ([#22754](https://github.com/angular/angular/issues/22754)) ([a2330ff](https://github.com/angular/angular/commit/a2330ff)), closes [#22723](https://github.com/angular/angular/issues/22723)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **compiler-cli:** lower loadChildren fields to allow dynamic module paths ([#23088](https://github.com/angular/angular/issues/23088)) ([550433a](https://github.com/angular/angular/commit/550433a))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="6.0.0-rc.1"></a>
|
||||||
|
# [6.0.0-rc.1](https://github.com/angular/angular/compare/6.0.0-rc.0...6.0.0-rc.1) (2018-03-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **animations:** avoid animation insertions during router back/refresh ([#21977](https://github.com/angular/angular/issues/21977)) ([f88fba0](https://github.com/angular/angular/commit/f88fba0)), closes [#19712](https://github.com/angular/angular/issues/19712)
|
||||||
|
* **animations:** treat numeric state name values as strings ([#22923](https://github.com/angular/angular/issues/22923)) ([e5e1b0d](https://github.com/angular/angular/commit/e5e1b0d))
|
||||||
|
* **bazel:** complete the rollup globals list for all angular entrypoints ([#23080](https://github.com/angular/angular/issues/23080)) ([439030f](https://github.com/angular/angular/commit/439030f))
|
||||||
|
* **bazel:** don't inline tslib into fesms ([#23044](https://github.com/angular/angular/issues/23044)) ([0049743](https://github.com/angular/angular/commit/0049743))
|
||||||
|
* **bazel:** don't try to do flatmoduleindex under Blaze ([#23083](https://github.com/angular/angular/issues/23083)) ([be10bf5](https://github.com/angular/angular/commit/be10bf5))
|
||||||
|
* **bazel:** downlevel decorators in fesm5 files ([#23078](https://github.com/angular/angular/issues/23078)) ([481b22e](https://github.com/angular/angular/commit/481b22e))
|
||||||
|
* **bazel:** ng_package packages attr not forwarded to npm_package ([#22967](https://github.com/angular/angular/issues/22967)) ([2aabbc5](https://github.com/angular/angular/commit/2aabbc5))
|
||||||
|
* **bazel:** ng_package should include private exports in fesms ([#23054](https://github.com/angular/angular/issues/23054)) ([0d9140c](https://github.com/angular/angular/commit/0d9140c))
|
||||||
|
* **bazel:** pass --global option to rollup ([#23073](https://github.com/angular/angular/issues/23073)) ([45e090b](https://github.com/angular/angular/commit/45e090b))
|
||||||
|
* **common:** titlecase pipe ([#22600](https://github.com/angular/angular/issues/22600)) ([7966744](https://github.com/angular/angular/commit/7966744))
|
||||||
|
* **compiler:** don't typecheck all inputs ([#22899](https://github.com/angular/angular/issues/22899)) ([838a610](https://github.com/angular/angular/commit/838a610))
|
||||||
|
* consistently rewrite Injector to INJECTOR ([#23008](https://github.com/angular/angular/issues/23008)) ([884bf0e](https://github.com/angular/angular/commit/884bf0e))
|
||||||
|
* **compiler:** fix support for html-like text in translatable attributes ([#23053](https://github.com/angular/angular/issues/23053)) ([28058b7](https://github.com/angular/angular/commit/28058b7))
|
||||||
|
* **compiler:** take quoting into account when determining if object literals can be shared ([#22942](https://github.com/angular/angular/issues/22942)) ([d98e9e7](https://github.com/angular/angular/commit/d98e9e7))
|
||||||
|
* **compiler-cli:** use numeric comparison for TypeScript version ([#22705](https://github.com/angular/angular/issues/22705)) ([193737a](https://github.com/angular/angular/commit/193737a)), closes [#22593](https://github.com/angular/angular/issues/22593)
|
||||||
|
* **core:** don't override ngInjectableDef in the decorator if present on the type ([#22943](https://github.com/angular/angular/issues/22943)) ([6f01917](https://github.com/angular/angular/commit/6f01917))
|
||||||
|
* **service-worker:** do not enter degraded mode when offline ([#22883](https://github.com/angular/angular/issues/22883)) ([9e9b8dd](https://github.com/angular/angular/commit/9e9b8dd)), closes [#21636](https://github.com/angular/angular/issues/21636)
|
||||||
|
* **service-worker:** fix LruList bugs ([#22769](https://github.com/angular/angular/issues/22769)) ([8c2a578](https://github.com/angular/angular/commit/8c2a578)), closes [#22218](https://github.com/angular/angular/issues/22218) [#22768](https://github.com/angular/angular/issues/22768)
|
||||||
|
* **service-worker:** ignore invalid `only-if-cached` requests ([#22883](https://github.com/angular/angular/issues/22883)) ([d9dc46e](https://github.com/angular/angular/commit/d9dc46e)), closes [#22362](https://github.com/angular/angular/issues/22362)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **bazel:** prefix private-export (barred-latin-o) symbols ([#23007](https://github.com/angular/angular/issues/23007)) ([27e14b2](https://github.com/angular/angular/commit/27e14b2))
|
||||||
|
* **compiler:** lower @NgModule ids if needed ([#23031](https://github.com/angular/angular/issues/23031)) ([bd024c0](https://github.com/angular/angular/commit/bd024c0))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="6.0.0-rc.0"></a>
|
||||||
|
# [6.0.0-rc.0](https://github.com/angular/angular/compare/6.0.0-beta.8...6.0.0-rc.0) (2018-03-21)
|
||||||
|
|
||||||
|
v6 framework is now feature complete, the cli and material/cdk parts of the v6 release and other integrations are still
|
||||||
|
in works and will be completed by the time we cut v6.0.0.
|
||||||
|
|
||||||
|
Please [file new issues](https://github.com/angular/angular/issues/new) at our issue tracker with as many details as
|
||||||
|
possible, and ideally also a include a good reproduction of the problem.
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **bazel:** correct expected outs for external sources in ng_module ([#22755](https://github.com/angular/angular/issues/22755)) ([bfe077a](https://github.com/angular/angular/commit/bfe077a))
|
||||||
|
* **compiler:** do not emit line/char in ngsummary files. ([#22840](https://github.com/angular/angular/issues/22840)) ([5c387a7](https://github.com/angular/angular/commit/5c387a7))
|
||||||
|
* correct several esm2015 entry-points in package.jsons ([#22892](https://github.com/angular/angular/issues/22892)) ([7d095b9](https://github.com/angular/angular/commit/7d095b9))
|
||||||
|
* **router:** don't use spread operator to workaround an issue in closure compiler ([#22884](https://github.com/angular/angular/issues/22884)) ([e6c731f](https://github.com/angular/angular/commit/e6c731f))
|
||||||
|
* **router:** make locationSyncBootstrapListener public due to change in output after TS 2.7 update in [#22669](https://github.com/angular/angular/issues/22669) ([#22896](https://github.com/angular/angular/issues/22896)) ([623d769](https://github.com/angular/angular/commit/623d769))
|
||||||
|
* **upgrade:** two-way binding and listening for event ([#22772](https://github.com/angular/angular/issues/22772)) ([2b3de63](https://github.com/angular/angular/commit/2b3de63)), closes [#22734](https://github.com/angular/angular/issues/22734)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **core:** update the package output of build.sh to [APF v6](https://goo.gl/jB3GVv) ([#22808](https://github.com/angular/angular/issues/22808)) ([ce63dc6](https://github.com/angular/angular/commit/ce63dc6))
|
||||||
|
* **core:** upgrade rxjs to 6.0.0-beta.0, please see this [RxJS Upgrade Guide](https://goo.gl/osWFzo) for more info ([#22573](https://github.com/angular/angular/issues/22573)) ([b43f8bc](https://github.com/angular/angular/commit/b43f8bc))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="6.0.0-beta.8"></a>
|
||||||
|
# [6.0.0-beta.8](https://github.com/angular/angular/compare/6.0.0-beta.7...6.0.0-beta.8) (2018-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **aio:** constrain error logging to improve reporting ([#22713](https://github.com/angular/angular/issues/22713)) ([049757b](https://github.com/angular/angular/commit/049757b))
|
||||||
|
* **compiler-cli:** annotate Ivy fields as [@nocollapse](https://github.com/nocollapse) in closure mode ([#22691](https://github.com/angular/angular/issues/22691)) ([6e00410](https://github.com/angular/angular/commit/6e00410))
|
||||||
|
* **compiler-cli:** disableTypeScriptVersionCheck should be applied even for older tsc versions ([#22669](https://github.com/angular/angular/issues/22669)) ([3f70aba](https://github.com/angular/angular/commit/3f70aba))
|
||||||
|
* **compiler-cli:** emit correct css string escape sequences ([#22776](https://github.com/angular/angular/issues/22776)) ([6e5e819](https://github.com/angular/angular/commit/6e5e819))
|
||||||
|
* **compiler-cli:** enableResourceInlining handles both styles and styleUrls ([#22688](https://github.com/angular/angular/issues/22688)) ([40315be](https://github.com/angular/angular/commit/40315be))
|
||||||
|
* **compiler-cli:** generate proper exports.* identifiers in cjs output ([#22564](https://github.com/angular/angular/issues/22564)) ([0d8deb0](https://github.com/angular/angular/commit/0d8deb0))
|
||||||
|
* **compiler-cli:** resolve resource URLs before loading them under enableResourceInlining ([#22688](https://github.com/angular/angular/issues/22688)) ([123efba](https://github.com/angular/angular/commit/123efba))
|
||||||
|
* **core:** remove core animation import symbols ([#22692](https://github.com/angular/angular/issues/22692)) ([f5a98f4](https://github.com/angular/angular/commit/f5a98f4))
|
||||||
|
* **elements:** fix elements test bootstrap ([#22839](https://github.com/angular/angular/issues/22839)) ([5d82d8d](https://github.com/angular/angular/commit/5d82d8d))
|
||||||
|
* overloading a function doesn't generate all of the signatures ([#22569](https://github.com/angular/angular/issues/22569)) ([e8326e6](https://github.com/angular/angular/commit/e8326e6))
|
||||||
|
* **platform-server:** add styles to elements correctly ([#22527](https://github.com/angular/angular/issues/22527)) ([cd2ebd2](https://github.com/angular/angular/commit/cd2ebd2))
|
||||||
|
* **router:** correct over-encoding of URL fragment ([#22687](https://github.com/angular/angular/issues/22687)) ([0bf6fa5](https://github.com/angular/angular/commit/0bf6fa5))
|
||||||
|
|
||||||
|
|
||||||
|
### Code Refactoring
|
||||||
|
|
||||||
|
* **compiler:** Drop support for the deprecated `<template>`. Use `<ng-template>` instead ([#22783](https://github.com/angular/angular/issues/22783)) ([0ebd577](https://github.com/angular/angular/commit/0ebd577))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **aio:** add hack, remove me ([#22413](https://github.com/angular/angular/issues/22413)) ([4d506ac](https://github.com/angular/angular/commit/4d506ac))
|
||||||
|
* **aio:** migrate embedded comp to elements ([#22413](https://github.com/angular/angular/issues/22413)) ([7c9b411](https://github.com/angular/angular/commit/7c9b411))
|
||||||
|
* **aio:** update payload size ([#22413](https://github.com/angular/angular/issues/22413)) ([400460c](https://github.com/angular/angular/commit/400460c))
|
||||||
|
* **animations:** expose `element` and `params` within transition matchers ([#22693](https://github.com/angular/angular/issues/22693)) ([58b94e6](https://github.com/angular/angular/commit/58b94e6))
|
||||||
|
* **bazel:** change ng_package rule to APF v6 ([#22782](https://github.com/angular/angular/issues/22782)) ([88b3198](https://github.com/angular/angular/commit/88b3198))
|
||||||
|
* **compiler:** support for singleline, multiline & jsdoc comments ([#22715](https://github.com/angular/angular/issues/22715)) ([3b167be](https://github.com/angular/angular/commit/3b167be))
|
||||||
|
* **compiler-cli:** add resource inlining to ngc ([#22615](https://github.com/angular/angular/issues/22615)) ([b5be18f](https://github.com/angular/angular/commit/b5be18f))
|
||||||
|
* **compiler-cli:** require node 8 as runtime engine ([#22669](https://github.com/angular/angular/issues/22669)) ([c602563](https://github.com/angular/angular/commit/c602563))
|
||||||
|
* **core:** add task tracking to Testability ([#16863](https://github.com/angular/angular/issues/16863)) ([37fedd0](https://github.com/angular/angular/commit/37fedd0))
|
||||||
|
* **elements:** add polyfill for elements es5 shim ([#22413](https://github.com/angular/angular/issues/22413)) ([863aff1](https://github.com/angular/angular/commit/863aff1))
|
||||||
|
* **elements:** add support for creating custom elements ([#22413](https://github.com/angular/angular/issues/22413)) ([22b96b9](https://github.com/angular/angular/commit/22b96b9))
|
||||||
|
* **elements:** add tests for component factory strategy ([#22413](https://github.com/angular/angular/issues/22413)) ([d2be675](https://github.com/angular/angular/commit/d2be675))
|
||||||
|
* **elements:** another polyfill solution ([#22413](https://github.com/angular/angular/issues/22413)) ([cf3ff7d](https://github.com/angular/angular/commit/cf3ff7d))
|
||||||
|
* **elements:** fix lint ([#22413](https://github.com/angular/angular/issues/22413)) ([0b45dfa](https://github.com/angular/angular/commit/0b45dfa))
|
||||||
|
* **elements:** fix payload size ([#22413](https://github.com/angular/angular/issues/22413)) ([fe21437](https://github.com/angular/angular/commit/fe21437))
|
||||||
|
* **elements:** fix test ([#22413](https://github.com/angular/angular/issues/22413)) ([44f637a](https://github.com/angular/angular/commit/44f637a))
|
||||||
|
* **elements:** George's comments ([#22413](https://github.com/angular/angular/issues/22413)) ([46efd4b](https://github.com/angular/angular/commit/46efd4b))
|
||||||
|
* **elements:** injector create ([#22413](https://github.com/angular/angular/issues/22413)) ([87f60bc](https://github.com/angular/angular/commit/87f60bc))
|
||||||
|
* **elements:** make bazel happy ([#22413](https://github.com/angular/angular/issues/22413)) ([39a12d2](https://github.com/angular/angular/commit/39a12d2))
|
||||||
|
* **elements:** provide type, not factory; remove config need ([#22413](https://github.com/angular/angular/issues/22413)) ([1936808](https://github.com/angular/angular/commit/1936808))
|
||||||
|
* **elements:** rebase ([#22413](https://github.com/angular/angular/issues/22413)) ([d72f445](https://github.com/angular/angular/commit/d72f445))
|
||||||
|
* **elements:** remove attribute/input from config ([#22413](https://github.com/angular/angular/issues/22413)) ([688096b](https://github.com/angular/angular/commit/688096b))
|
||||||
|
* **elements:** rename API to createCustomElement ([#22413](https://github.com/angular/angular/issues/22413)) ([167fdf7](https://github.com/angular/angular/commit/167fdf7))
|
||||||
|
* **elements:** update package.json with latest ([#22413](https://github.com/angular/angular/issues/22413)) ([2e450f6](https://github.com/angular/angular/commit/2e450f6))
|
||||||
|
* mark angular packages as side-effect free ([#22785](https://github.com/angular/angular/issues/22785)) ([44de10e](https://github.com/angular/angular/commit/44de10e))
|
||||||
|
* tree-shakeable providers API updates ([#22655](https://github.com/angular/angular/issues/22655)) ([db56836](https://github.com/angular/angular/commit/db56836))
|
||||||
|
* update tslib to 1.9.0 ([#22667](https://github.com/angular/angular/issues/22667)) ([489fec1](https://github.com/angular/angular/commit/489fec1))
|
||||||
|
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
* **compiler:** The `<template>` tag was deprecated in Angular v4 to avoid collisions (i.e. when
|
||||||
|
using Web Components).
|
||||||
|
|
||||||
|
This commit removes support for `<template>`. `<ng-template>` should be used
|
||||||
|
instead.
|
||||||
|
|
||||||
|
BEFORE:
|
||||||
|
|
||||||
|
<!-- html template -->
|
||||||
|
<template>some template content</template>
|
||||||
|
|
||||||
|
# tsconfig.json
|
||||||
|
{
|
||||||
|
# ...
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
# ...
|
||||||
|
# This option is no more supported and will have no effect
|
||||||
|
"enableLegacyTemplate": [true|false]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AFTER:
|
||||||
|
|
||||||
|
<!-- html template -->
|
||||||
|
<ng-template>some template content</ng-template>
|
||||||
|
* **core:** it is no longer possible to import
|
||||||
|
animation-related functions from @angular/core. All
|
||||||
|
animation symbols must now be imported from @angular/animations.
|
||||||
|
* after this change, npm and yarn will issue incompatible peerDependencies warning
|
||||||
|
|
||||||
|
We don't expect this to actually break an application, but the application/library package.json
|
||||||
|
will need to be updated to provide tslib 1.9.0 or higher.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="5.2.9"></a>
|
||||||
|
## [5.2.9](https://github.com/angular/angular/compare/5.2.8...5.2.9) (2018-03-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **platform-server:** add styles to elements correctly ([#22527](https://github.com/angular/angular/issues/22527)) ([fc6dfc2](https://github.com/angular/angular/commit/fc6dfc2))
|
||||||
|
* **router:** correct over-encoding of URL fragment ([#22687](https://github.com/angular/angular/issues/22687)) ([86517f2](https://github.com/angular/angular/commit/86517f2))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="6.0.0-beta.7"></a>
|
||||||
|
# [6.0.0-beta.7](https://github.com/angular/angular/compare/6.0.0-beta.6...6.0.0-beta.7) (2018-03-07)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **bazel:** fixes for ng_package on Windows ([#22597](https://github.com/angular/angular/issues/22597)) ([4c40812](https://github.com/angular/angular/commit/4c40812))
|
||||||
|
* **compiler:** allow tree-shakeable injectables to depend on string tokens ([#22376](https://github.com/angular/angular/issues/22376)) ([dd53447](https://github.com/angular/angular/commit/dd53447))
|
||||||
|
* **router:** fix URL serialization so special characters are only encoded where needed ([#22337](https://github.com/angular/angular/issues/22337)) ([fa974c7](https://github.com/angular/angular/commit/fa974c7)), closes [#10280](https://github.com/angular/angular/issues/10280)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="5.2.8"></a>
|
||||||
|
## [5.2.8](https://github.com/angular/angular/compare/5.2.7...5.2.8) (2018-03-07)
|
||||||
|
|
||||||
|
|
||||||
|
### 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)
|
||||||
|
* **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](https://github.com/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)
|
||||||
|
|
||||||
|
|
||||||
|
<a name="6.0.0-beta.6"></a>
|
||||||
|
# [6.0.0-beta.6](https://github.com/angular/angular/compare/6.0.0-beta.5...6.0.0-beta.6) (2018-02-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **animations:** only use the WA-polyfill alongside AnimationBuilder ([#22143](https://github.com/angular/angular/issues/22143)) ([b2f366b](https://github.com/angular/angular/commit/b2f366b)), closes [#17496](https://github.com/angular/angular/issues/17496)
|
||||||
|
* **animations:** report correct totalTime value even during noOp animations ([#22225](https://github.com/angular/angular/issues/22225)) ([e1bf067](https://github.com/angular/angular/commit/e1bf067))
|
||||||
|
* **bazel:** ng_package includes transitive .d.ts and flatModuleMetadata ([#22499](https://github.com/angular/angular/issues/22499)) ([aabe16c](https://github.com/angular/angular/commit/aabe16c)), closes [#22419](https://github.com/angular/angular/issues/22419)
|
||||||
|
* **common:** correct mapping of Observable methods ([#20518](https://github.com/angular/angular/issues/20518)) ([2639b4b](https://github.com/angular/angular/commit/2639b4b)), closes [#20516](https://github.com/angular/angular/issues/20516)
|
||||||
|
* **common:** then and else template might be set to null ([#22298](https://github.com/angular/angular/issues/22298)) ([8115edc](https://github.com/angular/angular/commit/8115edc))
|
||||||
|
* **compiler-cli:** add missing entry point to package, update tsickle ([#22295](https://github.com/angular/angular/issues/22295)) ([28ac244](https://github.com/angular/angular/commit/28ac244))
|
||||||
|
* **core:** export inject() from [@angular](https://github.com/angular)/core ([#22389](https://github.com/angular/angular/issues/22389)) ([f8749bf](https://github.com/angular/angular/commit/f8749bf)), closes [#22388](https://github.com/angular/angular/issues/22388)
|
||||||
|
* **core:** properly handle function without prototype in reflector ([#22284](https://github.com/angular/angular/issues/22284)) ([a7ebf5a](https://github.com/angular/angular/commit/a7ebf5a)), closes [#19978](https://github.com/angular/angular/issues/19978)
|
||||||
|
* **core:** require factory to be provided for shakeable InjectionToken ([#22207](https://github.com/angular/angular/issues/22207)) ([f755db7](https://github.com/angular/angular/commit/f755db7)), closes [#22205](https://github.com/angular/angular/issues/22205)
|
||||||
|
* **forms:** set state before emitting a value from ngModelChange ([#21514](https://github.com/angular/angular/issues/21514)) ([3e6a86f](https://github.com/angular/angular/commit/3e6a86f)), closes [#21513](https://github.com/angular/angular/issues/21513)
|
||||||
|
* **platform-server:** generate correct stylings for camel case names ([#22263](https://github.com/angular/angular/issues/22263)) ([40ba009](https://github.com/angular/angular/commit/40ba009)), closes [#19235](https://github.com/angular/angular/issues/19235)
|
||||||
|
* **router:** don't mutate route configs ([#22358](https://github.com/angular/angular/issues/22358)) ([45eff4c](https://github.com/angular/angular/commit/45eff4c)), 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)) ([094666d](https://github.com/angular/angular/commit/094666d)), closes [#10280](https://github.com/angular/angular/issues/10280)
|
||||||
|
* **upgrade:** correctly destroy nested downgraded component ([#22400](https://github.com/angular/angular/issues/22400)) ([8a85888](https://github.com/angular/angular/commit/8a85888)), closes [#22392](https://github.com/angular/angular/issues/22392)
|
||||||
|
* **upgrade:** correctly handle `=` bindings in `[@angular](https://github.com/angular)/upgrade` ([#22167](https://github.com/angular/angular/issues/22167)) ([f089bf5](https://github.com/angular/angular/commit/f089bf5))
|
||||||
|
* **upgrade:** fix empty transclusion content with AngularJS@>=1.5.8 ([#22167](https://github.com/angular/angular/issues/22167)) ([13ab91e](https://github.com/angular/angular/commit/13ab91e)), closes [#22175](https://github.com/angular/angular/issues/22175)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **bazel:** add an ng_package rule ([#22221](https://github.com/angular/angular/issues/22221)) ([b43b164](https://github.com/angular/angular/commit/b43b164))
|
||||||
|
* **bazel:** introduce a binary stamping feature ([#22176](https://github.com/angular/angular/issues/22176)) ([bba65e0](https://github.com/angular/angular/commit/bba65e0))
|
||||||
|
* **bazel:** ng_module produces bundle index ([#22176](https://github.com/angular/angular/issues/22176)) ([029dbf0](https://github.com/angular/angular/commit/029dbf0))
|
||||||
|
* **bazel:** ng_package adds package.json props ([#22499](https://github.com/angular/angular/issues/22499)) ([b6c9410](https://github.com/angular/angular/commit/b6c9410)), closes [#22416](https://github.com/angular/angular/issues/22416)
|
||||||
|
* **common:** better error message when non-template element used in NgIf ([#22274](https://github.com/angular/angular/issues/22274)) ([67cf11d](https://github.com/angular/angular/commit/67cf11d)), closes [#16410](https://github.com/angular/angular/issues/16410)
|
||||||
|
* **common:** export functions to format numbers, percents, currencies & dates ([#22423](https://github.com/angular/angular/issues/22423)) ([4180912](https://github.com/angular/angular/commit/4180912)), closes [#20536](https://github.com/angular/angular/issues/20536)
|
||||||
|
* **compiler-cli:** Check unvalidated combination of ngc and TypeScript ([#22293](https://github.com/angular/angular/issues/22293)) ([3ceee99](https://github.com/angular/angular/commit/3ceee99)), closes [#20669](https://github.com/angular/angular/issues/20669)
|
||||||
|
* **core:** set preserveWhitespaces to false by default ([#22046](https://github.com/angular/angular/issues/22046)) ([f1a0632](https://github.com/angular/angular/commit/f1a0632)), closes [#22027](https://github.com/angular/angular/issues/22027)
|
||||||
|
* **core:** support metadata reflection for native class types ([#22356](https://github.com/angular/angular/issues/22356)) ([5c89d6b](https://github.com/angular/angular/commit/5c89d6b)), closes [#21731](https://github.com/angular/angular/issues/21731)
|
||||||
|
* **core:** support metadata reflection for native class types ([#22356](https://github.com/angular/angular/issues/22356)) ([b7544cc](https://github.com/angular/angular/commit/b7544cc)), closes [#21731](https://github.com/angular/angular/issues/21731)
|
||||||
|
* **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)
|
||||||
|
* allow direct scoping of @Injectables to the root injector ([#22185](https://github.com/angular/angular/issues/22185)) ([7ac34e4](https://github.com/angular/angular/commit/7ac34e4))
|
||||||
|
* **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))
|
||||||
|
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
* **platform-server:** * Bump the dependency on Domino to 2.0 to resolve issues with
|
||||||
|
namespacing
|
||||||
|
* **forms:** - `AbstractControl#statusChanges` now emits an event of `'PENDING'` when you call `AbstractControl#markAsPending`
|
||||||
|
- Previously it did not emit an event when you called `markAsPending`
|
||||||
|
- To migrate you would need to ensure that if you are filtering or checking events from `statusChanges` that you account for the new event when calling `markAsPending`
|
||||||
|
* **animations:** When animation is trigged within a disabled zone, the
|
||||||
|
associated event (which an instance of AnimationEvent) will no longer
|
||||||
|
report the totalTime as 0 (it will emit the actual time of the
|
||||||
|
animation). To detect if an animation event is reporting a disabled
|
||||||
|
animation then the `event.disabled` property can be used instead.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="5.2.7"></a>
|
||||||
|
## [5.2.7](https://github.com/angular/angular/compare/5.2.6...5.2.7) (2018-02-28)
|
||||||
|
|
||||||
|
|
||||||
|
### 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)
|
||||||
|
* **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](https://github.com/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)
|
||||||
|
|
||||||
<a name="6.0.0-beta.5"></a>
|
<a name="6.0.0-beta.5"></a>
|
||||||
# [6.0.0-beta.5](https://github.com/angular/angular/compare/6.0.0-beta.4...6.0.0-beta.5) (2018-02-22)
|
# [6.0.0-beta.5](https://github.com/angular/angular/compare/6.0.0-beta.4...6.0.0-beta.5) (2018-02-22)
|
||||||
|
|
||||||
@ -130,7 +443,7 @@ If that is the case, you should be able to track the old value directly by savin
|
|||||||
* **common:** don't convert null to a string when flushing a mock request ([#21417](https://github.com/angular/angular/issues/21417)) ([8b14488](https://github.com/angular/angular/commit/8b14488)), closes [#20744](https://github.com/angular/angular/issues/20744)
|
* **common:** don't convert null to a string when flushing a mock request ([#21417](https://github.com/angular/angular/issues/21417)) ([8b14488](https://github.com/angular/angular/commit/8b14488)), closes [#20744](https://github.com/angular/angular/issues/20744)
|
||||||
* **core:** fix [#20582](https://github.com/angular/angular/issues/20582), don't need to wrap zone in location change listener ([#20640](https://github.com/angular/angular/issues/20640)) ([f791e9f](https://github.com/angular/angular/commit/f791e9f))
|
* **core:** fix [#20582](https://github.com/angular/angular/issues/20582), don't need to wrap zone in location change listener ([#20640](https://github.com/angular/angular/issues/20640)) ([f791e9f](https://github.com/angular/angular/commit/f791e9f))
|
||||||
* **core:** fix proper propagation of subscriptions in EventEmitter ([#22016](https://github.com/angular/angular/issues/22016)) ([e81606c](https://github.com/angular/angular/commit/e81606c)), closes [#21999](https://github.com/angular/angular/issues/21999)
|
* **core:** fix proper propagation of subscriptions in EventEmitter ([#22016](https://github.com/angular/angular/issues/22016)) ([e81606c](https://github.com/angular/angular/commit/e81606c)), closes [#21999](https://github.com/angular/angular/issues/21999)
|
||||||
* **core:** should check Zone existance when scheduleMicroTask ([#20656](https://github.com/angular/angular/issues/20656)) ([3a86940](https://github.com/angular/angular/commit/3a86940))
|
* **core:** should check Zone existence when scheduleMicroTask ([#20656](https://github.com/angular/angular/issues/20656)) ([3a86940](https://github.com/angular/angular/commit/3a86940))
|
||||||
* **forms:** publish missing types ([#19941](https://github.com/angular/angular/issues/19941)) ([2707012](https://github.com/angular/angular/commit/2707012))
|
* **forms:** publish missing types ([#19941](https://github.com/angular/angular/issues/19941)) ([2707012](https://github.com/angular/angular/commit/2707012))
|
||||||
* **ivy:** generate correct interpolations ([#21946](https://github.com/angular/angular/issues/21946)) ([3cc1d76](https://github.com/angular/angular/commit/3cc1d76))
|
* **ivy:** generate correct interpolations ([#21946](https://github.com/angular/angular/issues/21946)) ([3cc1d76](https://github.com/angular/angular/commit/3cc1d76))
|
||||||
* **ivy:** generate lifecycle pattern ([#21865](https://github.com/angular/angular/issues/21865)) ([f816666](https://github.com/angular/angular/commit/f816666))
|
* **ivy:** generate lifecycle pattern ([#21865](https://github.com/angular/angular/issues/21865)) ([f816666](https://github.com/angular/angular/commit/f816666))
|
||||||
@ -161,7 +474,7 @@ If that is the case, you should be able to track the old value directly by savin
|
|||||||
* **common:** don't convert null to a string when flushing a mock request ([#21417](https://github.com/angular/angular/issues/21417)) ([c4fb696](https://github.com/angular/angular/commit/c4fb696)), closes [#20744](https://github.com/angular/angular/issues/20744)
|
* **common:** don't convert null to a string when flushing a mock request ([#21417](https://github.com/angular/angular/issues/21417)) ([c4fb696](https://github.com/angular/angular/commit/c4fb696)), closes [#20744](https://github.com/angular/angular/issues/20744)
|
||||||
* **core:** fix [#20582](https://github.com/angular/angular/issues/20582), don't need to wrap zone in location change listener ([#22007](https://github.com/angular/angular/issues/22007)) ([ce51ea9](https://github.com/angular/angular/commit/ce51ea9))
|
* **core:** fix [#20582](https://github.com/angular/angular/issues/20582), don't need to wrap zone in location change listener ([#22007](https://github.com/angular/angular/issues/22007)) ([ce51ea9](https://github.com/angular/angular/commit/ce51ea9))
|
||||||
* **core:** fix proper propagation of subscriptions in EventEmitter ([#22016](https://github.com/angular/angular/issues/22016)) ([c6645e7](https://github.com/angular/angular/commit/c6645e7)), closes [#21999](https://github.com/angular/angular/issues/21999)
|
* **core:** fix proper propagation of subscriptions in EventEmitter ([#22016](https://github.com/angular/angular/issues/22016)) ([c6645e7](https://github.com/angular/angular/commit/c6645e7)), closes [#21999](https://github.com/angular/angular/issues/21999)
|
||||||
* **core:** should check Zone existance when scheduleMicroTask ([#20656](https://github.com/angular/angular/issues/20656)) ([aa9ba7f](https://github.com/angular/angular/commit/aa9ba7f))
|
* **core:** should check Zone existence when scheduleMicroTask ([#20656](https://github.com/angular/angular/issues/20656)) ([aa9ba7f](https://github.com/angular/angular/commit/aa9ba7f))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1582,7 +1895,7 @@ From 4.0.0 @angular/core uses a [`WeakMap`](https://github.com/angular/angular/c
|
|||||||
* **compiler:** make sourcemaps work in AOT mode ([492153a](https://github.com/angular/angular/commit/492153a))
|
* **compiler:** make sourcemaps work in AOT mode ([492153a](https://github.com/angular/angular/commit/492153a))
|
||||||
* **compiler:** only warn for `[@Injectable](https://github.com/Injectable)` classes with invalid args. ([5c34066](https://github.com/angular/angular/commit/5c34066)), closes [#15003](https://github.com/angular/angular/issues/15003)
|
* **compiler:** only warn for `[@Injectable](https://github.com/Injectable)` classes with invalid args. ([5c34066](https://github.com/angular/angular/commit/5c34066)), closes [#15003](https://github.com/angular/angular/issues/15003)
|
||||||
* **compiler:** shouldn't throw when Symbol is used as DI token ([#13701](https://github.com/angular/angular/issues/13701)) ([8b5c6b2](https://github.com/angular/angular/commit/8b5c6b2)), closes [#13314](https://github.com/angular/angular/issues/13314)
|
* **compiler:** shouldn't throw when Symbol is used as DI token ([#13701](https://github.com/angular/angular/issues/13701)) ([8b5c6b2](https://github.com/angular/angular/commit/8b5c6b2)), closes [#13314](https://github.com/angular/angular/issues/13314)
|
||||||
* **compiler:** support interface types in injectable constuctors ([#14894](https://github.com/angular/angular/issues/14894)) ([b00fe20](https://github.com/angular/angular/commit/b00fe20)), closes [#12631](https://github.com/angular/angular/issues/12631)
|
* **compiler:** support interface types in injectable constructors ([#14894](https://github.com/angular/angular/issues/14894)) ([b00fe20](https://github.com/angular/angular/commit/b00fe20)), closes [#12631](https://github.com/angular/angular/issues/12631)
|
||||||
* **compiler:** warning prints "WARNING" instead of "ERROR" ([#15125](https://github.com/angular/angular/issues/15125)) ([3b1956b](https://github.com/angular/angular/commit/3b1956b))
|
* **compiler:** warning prints "WARNING" instead of "ERROR" ([#15125](https://github.com/angular/angular/issues/15125)) ([3b1956b](https://github.com/angular/angular/commit/3b1956b))
|
||||||
* **core:** don’t recreate `TemplateRef` when used as a reference. ([#15066](https://github.com/angular/angular/issues/15066)) ([df914ef](https://github.com/angular/angular/commit/df914ef)), closes [#14873](https://github.com/angular/angular/issues/14873)
|
* **core:** don’t recreate `TemplateRef` when used as a reference. ([#15066](https://github.com/angular/angular/issues/15066)) ([df914ef](https://github.com/angular/angular/commit/df914ef)), closes [#14873](https://github.com/angular/angular/issues/14873)
|
||||||
* **core:** don’t throw if queries change during change detection. ([06fc42b](https://github.com/angular/angular/commit/06fc42b)), closes [#14925](https://github.com/angular/angular/issues/14925)
|
* **core:** don’t throw if queries change during change detection. ([06fc42b](https://github.com/angular/angular/commit/06fc42b)), closes [#14925](https://github.com/angular/angular/issues/14925)
|
||||||
@ -1622,7 +1935,7 @@ From 4.0.0 @angular/core uses a [`WeakMap`](https://github.com/angular/angular/c
|
|||||||
|
|
||||||
### BREAKING CHANGES
|
### BREAKING CHANGES
|
||||||
|
|
||||||
* Perviously, any provider that had an ngOnDestroy lifecycle hook would be created eagerly.
|
* Previously, any provider that had an ngOnDestroy lifecycle hook would be created eagerly.
|
||||||
|
|
||||||
Now, only classes that are annotated with @Component, @Directive, @Pipe, @NgModule are eager. Providers only become eager if they are either directly or transitively injected into one of the above.
|
Now, only classes that are annotated with @Component, @Directive, @Pipe, @NgModule are eager. Providers only become eager if they are either directly or transitively injected into one of the above.
|
||||||
|
|
||||||
@ -1890,7 +2203,7 @@ Note: the 4.0.0-rc.0 release on npm accidentally omitted one bug fix, so we cut
|
|||||||
* **compiler:** improve error message for unknown elements ([#14373](https://github.com/angular/angular/issues/14373)) ([2c6dab9](https://github.com/angular/angular/commit/2c6dab9))
|
* **compiler:** improve error message for unknown elements ([#14373](https://github.com/angular/angular/issues/14373)) ([2c6dab9](https://github.com/angular/angular/commit/2c6dab9))
|
||||||
* **compiler:** improve error messages in aot compiler ([#14333](https://github.com/angular/angular/issues/14333)) ([a696f4a](https://github.com/angular/angular/commit/a696f4a))
|
* **compiler:** improve error messages in aot compiler ([#14333](https://github.com/angular/angular/issues/14333)) ([a696f4a](https://github.com/angular/angular/commit/a696f4a))
|
||||||
* **compiler:** improve error msg for unknown properties on ([#14373](https://github.com/angular/angular/issues/14373)) ([e5a144d](https://github.com/angular/angular/commit/e5a144d)), closes [#14070](https://github.com/angular/angular/issues/14070)
|
* **compiler:** improve error msg for unknown properties on ([#14373](https://github.com/angular/angular/issues/14373)) ([e5a144d](https://github.com/angular/angular/commit/e5a144d)), closes [#14070](https://github.com/angular/angular/issues/14070)
|
||||||
* **core:** Remove ChangeDetectorRef Paramter from KeyValueDifferFactory and IterableDifferFactory ([#14311](https://github.com/angular/angular/issues/14311)) ([45cc444](https://github.com/angular/angular/commit/45cc444))
|
* **core:** Remove ChangeDetectorRef Parameter from KeyValueDifferFactory and IterableDifferFactory ([#14311](https://github.com/angular/angular/issues/14311)) ([45cc444](https://github.com/angular/angular/commit/45cc444))
|
||||||
* **core:** suppress a Closure Compiler warning ([#14484](https://github.com/angular/angular/issues/14484)) ([2f2b65b](https://github.com/angular/angular/commit/2f2b65b))
|
* **core:** suppress a Closure Compiler warning ([#14484](https://github.com/angular/angular/issues/14484)) ([2f2b65b](https://github.com/angular/angular/commit/2f2b65b))
|
||||||
* **forms:** getRawValue should correctly work with nested FormGroups/Arrays ([#12964](https://github.com/angular/angular/issues/12964)) ([1ece736](https://github.com/angular/angular/commit/1ece736)), closes [#12963](https://github.com/angular/angular/issues/12963)
|
* **forms:** getRawValue should correctly work with nested FormGroups/Arrays ([#12964](https://github.com/angular/angular/issues/12964)) ([1ece736](https://github.com/angular/angular/commit/1ece736)), closes [#12963](https://github.com/angular/angular/issues/12963)
|
||||||
* **http:** REVERT: remove dots from jsonp callback name ([#13219](https://github.com/angular/angular/issues/13219)) ([4676df5](https://github.com/angular/angular/commit/4676df5))
|
* **http:** REVERT: remove dots from jsonp callback name ([#13219](https://github.com/angular/angular/issues/13219)) ([4676df5](https://github.com/angular/angular/commit/4676df5))
|
||||||
@ -2075,7 +2388,7 @@ returned value being an array.
|
|||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **common:** add PopStateEvent interface ([#13400](https://github.com/angular/angular/issues/13400)) ([71567d1](https://github.com/angular/angular/commit/71567d1)), closes [#13378](https://github.com/angular/angular/issues/13378)
|
* **common:** add PopStateEvent interface ([#13400](https://github.com/angular/angular/issues/13400)) ([71567d1](https://github.com/angular/angular/commit/71567d1)), closes [#13378](https://github.com/angular/angular/issues/13378)
|
||||||
* **common:** DatePipe does't throw for NaN ([#14117](https://github.com/angular/angular/issues/14117)) ([32cc675](https://github.com/angular/angular/commit/32cc675)), closes [#14103](https://github.com/angular/angular/issues/14103)
|
* **common:** DatePipe doesn't throw for NaN ([#14117](https://github.com/angular/angular/issues/14117)) ([32cc675](https://github.com/angular/angular/commit/32cc675)), closes [#14103](https://github.com/angular/angular/issues/14103)
|
||||||
* **common:** DatePipe parses input string if it's not a valid date in browser ([#13895](https://github.com/angular/angular/issues/13895)) ([e641636](https://github.com/angular/angular/commit/e641636)), closes [#12334](https://github.com/angular/angular/issues/12334) [#13874](https://github.com/angular/angular/issues/13874)
|
* **common:** DatePipe parses input string if it's not a valid date in browser ([#13895](https://github.com/angular/angular/issues/13895)) ([e641636](https://github.com/angular/angular/commit/e641636)), closes [#12334](https://github.com/angular/angular/issues/12334) [#13874](https://github.com/angular/angular/issues/13874)
|
||||||
* **common:** introduce isObservable method ([#14067](https://github.com/angular/angular/issues/14067)) ([109f0d1](https://github.com/angular/angular/commit/109f0d1)), closes [#8848](https://github.com/angular/angular/issues/8848)
|
* **common:** introduce isObservable method ([#14067](https://github.com/angular/angular/issues/14067)) ([109f0d1](https://github.com/angular/angular/commit/109f0d1)), closes [#8848](https://github.com/angular/angular/issues/8848)
|
||||||
* **compiler:** allow empty translations for attributes ([#14085](https://github.com/angular/angular/issues/14085)) ([f3d5506](https://github.com/angular/angular/commit/f3d5506)), closes [#13897](https://github.com/angular/angular/issues/13897)
|
* **compiler:** allow empty translations for attributes ([#14085](https://github.com/angular/angular/issues/14085)) ([f3d5506](https://github.com/angular/angular/commit/f3d5506)), closes [#13897](https://github.com/angular/angular/issues/13897)
|
||||||
@ -2493,7 +2806,7 @@ We are adding more tests to our test suite to catch these kinds of problems befo
|
|||||||
* **common:** make sure the plural category exists ([#13169](https://github.com/angular/angular/issues/13169)) ([82c81cd](https://github.com/angular/angular/commit/82c81cd)), closes [#12379](https://github.com/angular/angular/issues/12379)
|
* **common:** make sure the plural category exists ([#13169](https://github.com/angular/angular/issues/13169)) ([82c81cd](https://github.com/angular/angular/commit/82c81cd)), closes [#12379](https://github.com/angular/angular/issues/12379)
|
||||||
* **compiler:** include the summaries of reexported modules / directives / pipes ([#13196](https://github.com/angular/angular/issues/13196)) ([75d1617](https://github.com/angular/angular/commit/75d1617))
|
* **compiler:** include the summaries of reexported modules / directives / pipes ([#13196](https://github.com/angular/angular/issues/13196)) ([75d1617](https://github.com/angular/angular/commit/75d1617))
|
||||||
* **compiler:** serialize any `StaticSymbol` correctly, not matter in which context ([5614c4f](https://github.com/angular/angular/commit/5614c4f))
|
* **compiler:** serialize any `StaticSymbol` correctly, not matter in which context ([5614c4f](https://github.com/angular/angular/commit/5614c4f))
|
||||||
* **compiler:** short-circut expressions with an index ([#13263](https://github.com/angular/angular/issues/13263)) ([f31c947](https://github.com/angular/angular/commit/f31c947)), closes [#13254](https://github.com/angular/angular/issues/13254)
|
* **compiler:** short-circuit expressions with an index ([#13263](https://github.com/angular/angular/issues/13263)) ([f31c947](https://github.com/angular/angular/commit/f31c947)), closes [#13254](https://github.com/angular/angular/issues/13254)
|
||||||
* **core:** display framework version on bootstrapped component ([#13252](https://github.com/angular/angular/issues/13252)) ([16efb13](https://github.com/angular/angular/commit/16efb13))
|
* **core:** display framework version on bootstrapped component ([#13252](https://github.com/angular/angular/issues/13252)) ([16efb13](https://github.com/angular/angular/commit/16efb13))
|
||||||
* **facade:** cache original format string ([#12764](https://github.com/angular/angular/issues/12764)) ([a132287](https://github.com/angular/angular/commit/a132287))
|
* **facade:** cache original format string ([#12764](https://github.com/angular/angular/issues/12764)) ([a132287](https://github.com/angular/angular/commit/a132287))
|
||||||
* **http:** set the default Accept header ([#12989](https://github.com/angular/angular/issues/12989)) ([986abbe](https://github.com/angular/angular/commit/986abbe)), closes [#6354](https://github.com/angular/angular/issues/6354)
|
* **http:** set the default Accept header ([#12989](https://github.com/angular/angular/issues/12989)) ([986abbe](https://github.com/angular/angular/commit/986abbe)), closes [#6354](https://github.com/angular/angular/issues/6354)
|
||||||
|
@ -212,6 +212,7 @@ The following is the list of supported scopes:
|
|||||||
* **compiler**
|
* **compiler**
|
||||||
* **compiler-cli**
|
* **compiler-cli**
|
||||||
* **core**
|
* **core**
|
||||||
|
* **elements**
|
||||||
* **forms**
|
* **forms**
|
||||||
* **http**
|
* **http**
|
||||||
* **language-service**
|
* **language-service**
|
||||||
|
53
WORKSPACE
53
WORKSPACE
@ -1,28 +1,28 @@
|
|||||||
workspace(name = "angular")
|
workspace(name = "angular")
|
||||||
|
|
||||||
# Using a pre-release snapshot to pick up a commit that makes all nodejs_binary
|
|
||||||
# programs produce source-mapped stack traces and uglify sourcemaps.
|
|
||||||
RULES_NODEJS_VERSION = "4303cbef12e5e252ad66cc35cff1123e3a44ee83"
|
|
||||||
|
|
||||||
http_archive(
|
http_archive(
|
||||||
name = "build_bazel_rules_nodejs",
|
name = "build_bazel_rules_nodejs",
|
||||||
url = "https://github.com/bazelbuild/rules_nodejs/archive/%s.zip" % RULES_NODEJS_VERSION,
|
url = "https://github.com/bazelbuild/rules_nodejs/archive/1931156c232a08356dfda02e9c8b0275c2e63c00.zip",
|
||||||
strip_prefix = "rules_nodejs-%s" % RULES_NODEJS_VERSION,
|
strip_prefix = "rules_nodejs-1931156c232a08356dfda02e9c8b0275c2e63c00",
|
||||||
sha256 = "fccb9a7122f339d89c9994dc0fea33c737dd76e66281d0da0cb841da5f1edec7",
|
sha256 = "9cfe33276a6ac0076ee9ee159c4a2576f9851c0f437435b5ac19b2e592493078",
|
||||||
)
|
)
|
||||||
|
|
||||||
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories")
|
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install")
|
||||||
|
|
||||||
check_bazel_version("0.9.0")
|
check_bazel_version("0.11.1")
|
||||||
node_repositories(package_json = ["//:package.json"])
|
node_repositories(package_json = ["//:package.json"])
|
||||||
|
|
||||||
RULES_TYPESCRIPT_VERSION = "d3cc5cd72d89aee0e4c2553ae1b99c707ecbef4e"
|
yarn_install(
|
||||||
|
name = "ts-api-guardian_runtime_deps",
|
||||||
|
package_json = "//tools/ts-api-guardian:package.json",
|
||||||
|
yarn_lock = "//tools/ts-api-guardian:yarn.lock",
|
||||||
|
)
|
||||||
|
|
||||||
http_archive(
|
http_archive(
|
||||||
name = "build_bazel_rules_typescript",
|
name = "build_bazel_rules_typescript",
|
||||||
url = "https://github.com/bazelbuild/rules_typescript/archive/%s.zip" % RULES_TYPESCRIPT_VERSION,
|
url = "https://github.com/bazelbuild/rules_typescript/archive/0.11.1.zip",
|
||||||
strip_prefix = "rules_typescript-%s" % RULES_TYPESCRIPT_VERSION,
|
strip_prefix = "rules_typescript-0.11.1",
|
||||||
sha256 = "a233fcca41c3e59f639ac71c396edb30e9e9716cf8ed5fb20b51ff8910d5d895",
|
sha256 = "7406bea7954e1c906f075115dfa176551a881119f6820b126ea1eacb09f34a1a",
|
||||||
)
|
)
|
||||||
|
|
||||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace")
|
load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace")
|
||||||
@ -34,22 +34,29 @@ local_repository(
|
|||||||
path = "node_modules/rxjs/src",
|
path = "node_modules/rxjs/src",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Point to the integration test workspace just so that Bazel doesn't descend into it
|
||||||
|
# when expanding the //... pattern
|
||||||
|
local_repository(
|
||||||
|
name = "bazel_integration_test",
|
||||||
|
path = "integration/bazel",
|
||||||
|
)
|
||||||
|
|
||||||
# This commit matches the version of buildifier in angular/ngcontainer
|
# This commit matches the version of buildifier in angular/ngcontainer
|
||||||
# If you change this, also check if it matches the version in the angular/ngcontainer
|
# If you change this, also check if it matches the version in the angular/ngcontainer
|
||||||
# version in /.circleci/config.yml
|
# version in /.circleci/config.yml
|
||||||
BAZEL_BUILDTOOLS_VERSION = "b3b620e8bcff18ed3378cd3f35ebeb7016d71f71"
|
BAZEL_BUILDTOOLS_VERSION = "70bc7843bb9950fece2bc014ed16de03419e36e2"
|
||||||
|
|
||||||
http_archive(
|
http_archive(
|
||||||
name = "com_github_bazelbuild_buildtools",
|
name = "com_github_bazelbuild_buildtools",
|
||||||
url = "https://github.com/bazelbuild/buildtools/archive/%s.zip" % BAZEL_BUILDTOOLS_VERSION,
|
url = "https://github.com/bazelbuild/buildtools/archive/%s.zip" % BAZEL_BUILDTOOLS_VERSION,
|
||||||
strip_prefix = "buildtools-%s" % BAZEL_BUILDTOOLS_VERSION,
|
strip_prefix = "buildtools-%s" % BAZEL_BUILDTOOLS_VERSION,
|
||||||
sha256 = "dad19224258ed67cbdbae9b7befb785c3b966e5a33b04b3ce58ddb7824b97d73",
|
sha256 = "367c23a5fe7fc2a7cb57863d3718b4149f0e57426c48c8ad54c45348a0b53cc1",
|
||||||
)
|
)
|
||||||
|
|
||||||
http_archive(
|
http_archive(
|
||||||
name = "io_bazel_rules_go",
|
name = "io_bazel_rules_go",
|
||||||
url = "https://github.com/bazelbuild/rules_go/releases/download/0.7.1/rules_go-0.7.1.tar.gz",
|
url = "https://github.com/bazelbuild/rules_go/releases/download/0.10.3/rules_go-0.10.3.tar.gz",
|
||||||
sha256 = "341d5eacef704415386974bc82a1783a8b7ffbff2ab6ba02375e1ca20d9b031c",
|
sha256 = "feba3278c13cde8d67e341a837f69a029f698d7a27ddbb2a202be7a10b22142a",
|
||||||
)
|
)
|
||||||
|
|
||||||
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
|
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
|
||||||
@ -61,9 +68,9 @@ go_register_toolchains()
|
|||||||
# Fetching the Bazel source code allows us to compile the Skylark linter
|
# Fetching the Bazel source code allows us to compile the Skylark linter
|
||||||
http_archive(
|
http_archive(
|
||||||
name = "io_bazel",
|
name = "io_bazel",
|
||||||
url = "https://github.com/bazelbuild/bazel/archive/9755c72b48866ed034bd28aa033e9abd27431b1e.zip",
|
url = "https://github.com/bazelbuild/bazel/archive/5a35e72f9e97c06540c479f8c31512fb4656202f.zip",
|
||||||
strip_prefix = "bazel-9755c72b48866ed034bd28aa033e9abd27431b1e",
|
strip_prefix = "bazel-5a35e72f9e97c06540c479f8c31512fb4656202f",
|
||||||
sha256 = "5b8443fc3481b5fcd9e7f348e1dd93c1397f78b223623c39eb56494c55f41962",
|
sha256 = "ed33a52874c14e3b487fb50f390c541fab9c81a33d986d38fb01766a66dbcd21",
|
||||||
)
|
)
|
||||||
|
|
||||||
# We have a source dependency on the Devkit repository, because it's built with
|
# We have a source dependency on the Devkit repository, because it's built with
|
||||||
@ -81,7 +88,7 @@ http_archive(
|
|||||||
|
|
||||||
http_archive(
|
http_archive(
|
||||||
name = "org_brotli",
|
name = "org_brotli",
|
||||||
url = "https://github.com/google/brotli/archive/v1.0.2.zip",
|
url = "https://github.com/google/brotli/archive/c6333e1e79fb62ea088443f192293f964409b04e.zip",
|
||||||
strip_prefix = "brotli-1.0.2",
|
strip_prefix = "brotli-c6333e1e79fb62ea088443f192293f964409b04e",
|
||||||
sha256 = "b43d5d6bc40f2fa6c785b738d86c6bbe022732fe25196ebbe43b9653a025920d",
|
sha256 = "3f781988dee7dd3bcce2bf238294663cfaaf3b6433505bdb762e24d0a284d1dc",
|
||||||
)
|
)
|
||||||
|
@ -13,7 +13,9 @@
|
|||||||
"app/search/search-worker.js",
|
"app/search/search-worker.js",
|
||||||
"favicon.ico",
|
"favicon.ico",
|
||||||
"pwa-manifest.json",
|
"pwa-manifest.json",
|
||||||
"google385281288605d160.html"
|
"google385281288605d160.html",
|
||||||
|
{ "glob": "custom-elements.min.js", "input": "../node_modules/@webcomponents/custom-elements", "output": "./assets/js" },
|
||||||
|
{ "glob": "native-shim.js", "input": "../node_modules/@webcomponents/custom-elements/src", "output": "./assets/js" }
|
||||||
],
|
],
|
||||||
"index": "index.html",
|
"index": "index.html",
|
||||||
"main": "main.ts",
|
"main": "main.ts",
|
||||||
@ -66,5 +68,6 @@
|
|||||||
"build": {
|
"build": {
|
||||||
"namedChunks": true
|
"namedChunks": true
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"packageManager": "yarn"
|
||||||
}
|
}
|
||||||
|
3
aio/.gitignore
vendored
3
aio/.gitignore
vendored
@ -30,6 +30,7 @@
|
|||||||
/connect.lock
|
/connect.lock
|
||||||
/coverage
|
/coverage
|
||||||
/libpeerconnection.log
|
/libpeerconnection.log
|
||||||
|
debug.log
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
testem.log
|
testem.log
|
||||||
/typings
|
/typings
|
||||||
@ -45,4 +46,4 @@ protractor-results*.txt
|
|||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
# copied dependencies
|
# copied dependencies
|
||||||
src/assets/js/lunr*
|
src/assets/js/lunr*
|
||||||
|
@ -19,8 +19,8 @@ ARG AIO_DOMAIN_NAME=ngbuilds.io
|
|||||||
ARG TEST_AIO_DOMAIN_NAME=$AIO_DOMAIN_NAME.localhost
|
ARG TEST_AIO_DOMAIN_NAME=$AIO_DOMAIN_NAME.localhost
|
||||||
ARG AIO_GITHUB_ORGANIZATION=angular
|
ARG AIO_GITHUB_ORGANIZATION=angular
|
||||||
ARG TEST_AIO_GITHUB_ORGANIZATION=angular
|
ARG TEST_AIO_GITHUB_ORGANIZATION=angular
|
||||||
ARG AIO_GITHUB_TEAM_SLUGS=angular-core,aio-contributors
|
ARG AIO_GITHUB_TEAM_SLUGS=team,aio-contributors
|
||||||
ARG TEST_AIO_GITHUB_TEAM_SLUGS=angular-core,aio-contributors
|
ARG TEST_AIO_GITHUB_TEAM_SLUGS=team,aio-contributors
|
||||||
ARG AIO_NGINX_HOSTNAME=$AIO_DOMAIN_NAME
|
ARG AIO_NGINX_HOSTNAME=$AIO_DOMAIN_NAME
|
||||||
ARG TEST_AIO_NGINX_HOSTNAME=$TEST_AIO_DOMAIN_NAME
|
ARG TEST_AIO_NGINX_HOSTNAME=$TEST_AIO_DOMAIN_NAME
|
||||||
ARG AIO_NGINX_PORT_HTTP=80
|
ARG AIO_NGINX_PORT_HTTP=80
|
||||||
|
@ -9,7 +9,7 @@ Necessary secrets:
|
|||||||
- Used for:
|
- Used for:
|
||||||
- Retrieving open PRs without rate-limiting.
|
- Retrieving open PRs without rate-limiting.
|
||||||
- Retrieving PR author.
|
- Retrieving PR author.
|
||||||
- Retrieving members of the `angular-core` team.
|
- Retrieving members of the trusted GitHub teams.
|
||||||
- Posting comments with preview links on PRs.
|
- Posting comments with preview links on PRs.
|
||||||
|
|
||||||
2. `PREVIEW_DEPLOYMENT_TOKEN`
|
2. `PREVIEW_DEPLOYMENT_TOKEN`
|
||||||
|
@ -74,7 +74,7 @@ sudo docker run \
|
|||||||
## Example
|
## Example
|
||||||
The following command would start a docker container based on the previously created `foobar-builds`
|
The following command would start a docker container based on the previously created `foobar-builds`
|
||||||
docker image, alias it as 'foobar-builds-1' and map predefined directories on the host VM to be used
|
docker image, alias it as 'foobar-builds-1' and map predefined directories on the host VM to be used
|
||||||
by the container for accesing secrets and SSL certificates and keeping the build artifacts and logs.
|
by the container for accessing secrets and SSL certificates and keeping the build artifacts and logs.
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo docker run \
|
sudo docker run \
|
||||||
|
@ -1,20 +1,19 @@
|
|||||||
<!--The content below is only a placeholder and can be replaced.-->
|
<!--The content below is only a placeholder and can be replaced.-->
|
||||||
<div style="text-align:center">
|
<div style="text-align:center">
|
||||||
<h1>
|
<h1>
|
||||||
Welcome to {{title}}!!
|
Welcome to {{ title }}!
|
||||||
</h1>
|
</h1>
|
||||||
<img width="300" alt="Angular logo" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAyNTAgMjUwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNTAgMjUwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDojREQwMDMxO30NCgkuc3Qxe2ZpbGw6I0MzMDAyRjt9DQoJLnN0MntmaWxsOiNGRkZGRkY7fQ0KPC9zdHlsZT4NCjxnPg0KCTxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iMTI1LDMwIDEyNSwzMCAxMjUsMzAgMzEuOSw2My4yIDQ2LjEsMTg2LjMgMTI1LDIzMCAxMjUsMjMwIDEyNSwyMzAgMjAzLjksMTg2LjMgMjE4LjEsNjMuMiAJIi8+DQoJPHBvbHlnb24gY2xhc3M9InN0MSIgcG9pbnRzPSIxMjUsMzAgMTI1LDUyLjIgMTI1LDUyLjEgMTI1LDE1My40IDEyNSwxNTMuNCAxMjUsMjMwIDEyNSwyMzAgMjAzLjksMTg2LjMgMjE4LjEsNjMuMiAxMjUsMzAgCSIvPg0KCTxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik0xMjUsNTIuMUw2Ni44LDE4Mi42aDBoMjEuN2gwbDExLjctMjkuMmg0OS40bDExLjcsMjkuMmgwaDIxLjdoMEwxMjUsNTIuMUwxMjUsNTIuMUwxMjUsNTIuMUwxMjUsNTIuMQ0KCQlMMTI1LDUyLjF6IE0xNDIsMTM1LjRIMTA4bDE3LTQwLjlMMTQyLDEzNS40eiIvPg0KPC9nPg0KPC9zdmc+DQo=">
|
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
|
||||||
</div>
|
</div>
|
||||||
<h2>Here are some links to help you start: </h2>
|
<h2>Here are some links to help you start: </h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<h2><a target="_blank" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
|
<h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<h2><a target="_blank" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
|
<h2><a target="_blank" rel="noopener" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<h2><a target="_blank" href="http://angularjs.blogspot.ca/">Angular blog</a></h2>
|
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import { TestBed, async } from '@angular/core/testing';
|
import { TestBed, async } from '@angular/core/testing';
|
||||||
|
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
|
|
||||||
describe('AppComponent', () => {
|
describe('AppComponent', () => {
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
@ -20,13 +18,13 @@ describe('AppComponent', () => {
|
|||||||
it(`should have as title 'app'`, async(() => {
|
it(`should have as title 'app'`, async(() => {
|
||||||
const fixture = TestBed.createComponent(AppComponent);
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
const app = fixture.debugElement.componentInstance;
|
const app = fixture.debugElement.componentInstance;
|
||||||
expect(app.title).toEqual('app');
|
expect(app.title).toMatch(/app/i);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should render title in a h1 tag', async(() => {
|
it('should render title in a h1 tag', async(() => {
|
||||||
const fixture = TestBed.createComponent(AppComponent);
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const compiled = fixture.debugElement.nativeElement;
|
const compiled = fixture.debugElement.nativeElement;
|
||||||
expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!!');
|
expect(compiled.querySelector('h1').textContent).toMatch(/app/i);
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
@ -11,6 +11,6 @@ import { Component } from '@angular/core';
|
|||||||
// #enddocregion metadata
|
// #enddocregion metadata
|
||||||
// #docregion title, class
|
// #docregion title, class
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
title = 'My First Angular App';
|
title = 'My First Angular App!';
|
||||||
}
|
}
|
||||||
// #enddocregion title, class
|
// #enddocregion title, class
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import { Component, Input, OnDestroy } from '@angular/core';
|
import { Component, Input, OnDestroy } from '@angular/core';
|
||||||
|
|
||||||
import { MissionService } from './mission.service';
|
import { MissionService } from './mission.service';
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
import { Subscription } from 'rxjs';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-astronaut',
|
selector: 'app-astronaut',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// #docregion
|
// #docregion
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Subject } from 'rxjs/Subject';
|
import { Subject } from 'rxjs';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MissionService {
|
export class MissionService {
|
||||||
|
@ -178,6 +178,11 @@ describe('Dependency Injection Tests', function () {
|
|||||||
expect(heroes.count()).toBeGreaterThan(0);
|
expect(heroes.count()).toBeGreaterThan(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('authorized user should have multiple authorized heroes with tree-shakeable HeroesService', function () {
|
||||||
|
let heroes = element.all(by.css('#tspAuthorized app-hero-list div'));
|
||||||
|
expect(heroes.count()).toBeGreaterThan(0);
|
||||||
|
});
|
||||||
|
|
||||||
it('authorized user should have secret heroes', function () {
|
it('authorized user should have secret heroes', function () {
|
||||||
let heroes = element.all(by.css('#authorized app-hero-list div'));
|
let heroes = element.all(by.css('#authorized app-hero-list div'));
|
||||||
expect(heroes.count()).toBeGreaterThan(0);
|
expect(heroes.count()).toBeGreaterThan(0);
|
||||||
|
@ -21,6 +21,7 @@ import { UserService } from './user.service';
|
|||||||
<p>
|
<p>
|
||||||
<app-heroes id="authorized" *ngIf="isAuthorized"></app-heroes>
|
<app-heroes id="authorized" *ngIf="isAuthorized"></app-heroes>
|
||||||
<app-heroes id="unauthorized" *ngIf="!isAuthorized"></app-heroes>
|
<app-heroes id="unauthorized" *ngIf="!isAuthorized"></app-heroes>
|
||||||
|
<app-heroes-tsp id="tspAuthorized" *ngIf="isAuthorized"></app-heroes-tsp>
|
||||||
<app-providers></app-providers>
|
<app-providers></app-providers>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
@ -6,6 +6,7 @@ import { APP_CONFIG, HERO_DI_CONFIG } from './app.config';
|
|||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { CarComponent } from './car/car.component';
|
import { CarComponent } from './car/car.component';
|
||||||
import { HeroesComponent } from './heroes/heroes.component';
|
import { HeroesComponent } from './heroes/heroes.component';
|
||||||
|
import { HeroesTspComponent } from './heroes/heroes-tsp.component';
|
||||||
import { HeroListComponent } from './heroes/hero-list.component';
|
import { HeroListComponent } from './heroes/hero-list.component';
|
||||||
import { InjectorComponent } from './injector.component';
|
import { InjectorComponent } from './injector.component';
|
||||||
import { Logger } from './logger.service';
|
import { Logger } from './logger.service';
|
||||||
@ -25,6 +26,7 @@ import { ProvidersModule } from './providers.module';
|
|||||||
CarComponent,
|
CarComponent,
|
||||||
HeroesComponent,
|
HeroesComponent,
|
||||||
// #enddocregion ngmodule
|
// #enddocregion ngmodule
|
||||||
|
HeroesTspComponent,
|
||||||
HeroListComponent,
|
HeroListComponent,
|
||||||
InjectorComponent,
|
InjectorComponent,
|
||||||
TestComponent
|
TestComponent
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
// #docregion
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
|
||||||
|
@NgModule({})
|
||||||
|
export class HeroModule {
|
||||||
|
}
|
@ -1,6 +1,8 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
})
|
||||||
export class HeroService {
|
export class HeroService {
|
||||||
constructor() { }
|
constructor() { }
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HEROES } from './mock-heroes';
|
import { HEROES } from './mock-heroes';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
})
|
||||||
export class HeroService {
|
export class HeroService {
|
||||||
getHeroes() { return HEROES; }
|
getHeroes() { return HEROES; }
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,9 @@ import { Injectable } from '@angular/core';
|
|||||||
import { HEROES } from './mock-heroes';
|
import { HEROES } from './mock-heroes';
|
||||||
import { Logger } from '../logger.service';
|
import { Logger } from '../logger.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
})
|
||||||
export class HeroService {
|
export class HeroService {
|
||||||
|
|
||||||
// #docregion ctor
|
// #docregion ctor
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
// #docregion
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { HEROES } from './mock-heroes';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
// we declare that this service should be created
|
||||||
|
// by the root application injector.
|
||||||
|
|
||||||
|
providedIn: 'root',
|
||||||
|
})
|
||||||
|
export class HeroService {
|
||||||
|
getHeroes() { return HEROES; }
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
// #docregion
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { HeroModule } from './hero.module';
|
||||||
|
import { HEROES } from './mock-heroes';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
// we declare that this service should be created
|
||||||
|
// by any injector that includes HeroModule.
|
||||||
|
|
||||||
|
providedIn: HeroModule,
|
||||||
|
})
|
||||||
|
export class HeroService {
|
||||||
|
getHeroes() { return HEROES; }
|
||||||
|
}
|
@ -2,8 +2,14 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HEROES } from './mock-heroes';
|
import { HEROES } from './mock-heroes';
|
||||||
import { Logger } from '../logger.service';
|
import { Logger } from '../logger.service';
|
||||||
|
import { UserService } from '../user.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
useFactory: (logger: Logger, userService: UserService) =>
|
||||||
|
new HeroService(logger, userService.user.isAuthorized),
|
||||||
|
deps: [Logger, UserService],
|
||||||
|
})
|
||||||
export class HeroService {
|
export class HeroService {
|
||||||
// #docregion internals
|
// #docregion internals
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A version of `HeroesComponent` that does not provide the `HeroService` (and thus relies on its
|
||||||
|
* `Injectable`-declared provider) in order to function.
|
||||||
|
*
|
||||||
|
* TSP stands for Tree-Shakeable Provider.
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
selector: 'app-heroes-tsp',
|
||||||
|
template: `
|
||||||
|
<h2>Heroes</h2>
|
||||||
|
<app-hero-list></app-hero-list>
|
||||||
|
`
|
||||||
|
})
|
||||||
|
export class HeroesTspComponent { }
|
@ -0,0 +1,15 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
import { ServiceModule } from './service-and-module';
|
||||||
|
|
||||||
|
// #docregion
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
BrowserModule,
|
||||||
|
RouterModule.forRoot([]),
|
||||||
|
ServiceModule,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class AppModule {
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
// #docregion
|
||||||
|
import { Injectable, NgModule } from '@angular/core';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class Service {
|
||||||
|
doSomething(): void {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
providers: [Service],
|
||||||
|
})
|
||||||
|
export class ServiceModule {
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
// #docregion
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
useFactory: () => new Service('dependency'),
|
||||||
|
})
|
||||||
|
export class Service {
|
||||||
|
constructor(private dep: string) {
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
// #docregion
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
})
|
||||||
|
export class Service {
|
||||||
|
}
|
@ -3,7 +3,7 @@
|
|||||||
"files":[
|
"files":[
|
||||||
"!**/*.d.ts",
|
"!**/*.d.ts",
|
||||||
"!**/*.js",
|
"!**/*.js",
|
||||||
"!**/*.[0,1,2].*",
|
"!**/*.[0,1,2,3,4].*",
|
||||||
"!**/dummy.module.ts"
|
"!**/dummy.module.ts"
|
||||||
],
|
],
|
||||||
"tags": ["dependency", "di"]
|
"tags": ["dependency", "di"]
|
||||||
|
26
aio/content/examples/elements/src/app/app.component.ts
Normal file
26
aio/content/examples/elements/src/app/app.component.ts
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// #docregion
|
||||||
|
import { Component, Injector } from '@angular/core';
|
||||||
|
import { createNgElementConstructor } from '../elements-dist';
|
||||||
|
import { PopupService } from './popup.service';
|
||||||
|
import { PopupComponent } from './popup.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-root',
|
||||||
|
template: `
|
||||||
|
<input #input value="Message">
|
||||||
|
<button (click)="popup.showAsComponent(input.value)">
|
||||||
|
Show as component </button>
|
||||||
|
<button (click)="popup.showAsElement(input.value)">
|
||||||
|
Show as element </button>
|
||||||
|
`
|
||||||
|
})
|
||||||
|
|
||||||
|
export class AppComponent {
|
||||||
|
constructor(private injector: Injector, public popup: PopupService) {
|
||||||
|
// on init, convert PopupComponent to a custom element
|
||||||
|
const PopupElement =
|
||||||
|
createNgElementConstructor(PopupComponent, {injector: this.injector});
|
||||||
|
// register the custom element with the browser.
|
||||||
|
customElements.define('popup-element', PopupElement);
|
||||||
|
}
|
||||||
|
}
|
22
aio/content/examples/elements/src/app/app.module.ts
Normal file
22
aio/content/examples/elements/src/app/app.module.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// #docregion
|
||||||
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
|
||||||
|
import { AppComponent } from './app.component';
|
||||||
|
import { PopupService } from './popup.service';
|
||||||
|
import { PopupComponent } from './popup.component';
|
||||||
|
|
||||||
|
// include the PopupService provider,
|
||||||
|
// but exclude PopupComponent from compilation,
|
||||||
|
// because it will be added dynamically
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [AppComponent, PopupComponent],
|
||||||
|
imports: [BrowserModule, BrowserAnimationsModule],
|
||||||
|
providers: [PopupService],
|
||||||
|
bootstrap: [AppComponent],
|
||||||
|
entryComponents: [PopupComponent],
|
||||||
|
})
|
||||||
|
|
||||||
|
export class AppModule {}
|
58
aio/content/examples/elements/src/app/popup.component.ts
Normal file
58
aio/content/examples/elements/src/app/popup.component.ts
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
// #docregion
|
||||||
|
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||||
|
import { AnimationEvent } from '@angular/animations';
|
||||||
|
import { animate, state, style, transition, trigger } from '@angular/animations';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'my-popup',
|
||||||
|
template: 'Popup: {{message}}',
|
||||||
|
host: {
|
||||||
|
'[@state]': 'state',
|
||||||
|
'(@state.done)': 'onAnimationDone($event)',
|
||||||
|
},
|
||||||
|
animations: [
|
||||||
|
trigger('state', [
|
||||||
|
state('opened', style({transform: 'translateY(0%)'})),
|
||||||
|
state('void, closed', style({transform: 'translateY(100%)', opacity: 0})),
|
||||||
|
transition('* => *', animate('100ms ease-in')),
|
||||||
|
])
|
||||||
|
],
|
||||||
|
styles: [`
|
||||||
|
:host {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
background: #009cff;
|
||||||
|
height: 48px;
|
||||||
|
padding: 16px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border-top: 1px solid black;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
`]
|
||||||
|
})
|
||||||
|
|
||||||
|
export class PopupComponent {
|
||||||
|
private state: 'opened' | 'closed' = 'closed';
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
set message(message: string) {
|
||||||
|
this._message = message;
|
||||||
|
this.state = 'opened';
|
||||||
|
|
||||||
|
setTimeout(() => this.state = 'closed', 2000);
|
||||||
|
}
|
||||||
|
get message(): string { return this._message; }
|
||||||
|
_message: string;
|
||||||
|
|
||||||
|
@Output()
|
||||||
|
closed = new EventEmitter();
|
||||||
|
|
||||||
|
onAnimationDone(e: AnimationEvent) {
|
||||||
|
if (e.toState === 'closed') {
|
||||||
|
this.closed.next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
54
aio/content/examples/elements/src/app/popup.service.ts
Normal file
54
aio/content/examples/elements/src/app/popup.service.ts
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
|
||||||
|
// #docregion
|
||||||
|
import { ApplicationRef, ComponentFactoryResolver, Injectable, Injector } from '@angular/core';
|
||||||
|
|
||||||
|
import { PopupComponent } from './popup.component';
|
||||||
|
import { NgElementConstructor } from '../elements-dist';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class PopupService {
|
||||||
|
constructor(private injector: Injector,
|
||||||
|
private applicationRef: ApplicationRef,
|
||||||
|
private componentFactoryResolver: ComponentFactoryResolver) {}
|
||||||
|
|
||||||
|
// Previous dynamic-loading method required you to set up infrastructure
|
||||||
|
// before adding the popup to the DOM.
|
||||||
|
showAsComponent(message: string) {
|
||||||
|
// Create element
|
||||||
|
const popup = document.createElement('popup-component');
|
||||||
|
|
||||||
|
// Create the component and wire it up with the element
|
||||||
|
const factory = this.componentFactoryResolver.resolveComponentFactory(PopupComponent);
|
||||||
|
const popupComponentRef = factory.create(this.injector, [], popup);
|
||||||
|
|
||||||
|
// Attach to the view so that the change detector knows to run
|
||||||
|
this.applicationRef.attachView(popupComponentRef.hostView);
|
||||||
|
|
||||||
|
// Listen to the close event
|
||||||
|
popupComponentRef.instance.closed.subscribe(() => {
|
||||||
|
document.body.removeChild(popup);
|
||||||
|
this.applicationRef.detachView(popupComponentRef.hostView);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Set the message
|
||||||
|
popupComponentRef.instance.message = message;
|
||||||
|
|
||||||
|
// Add to the DOM
|
||||||
|
document.body.appendChild(popup);
|
||||||
|
}
|
||||||
|
|
||||||
|
// This uses the new custom-element method to add the popup to the DOM.
|
||||||
|
showAsElement(message: string) {
|
||||||
|
// Create element
|
||||||
|
const popupEl = document.createElement('popup-element');
|
||||||
|
|
||||||
|
// Listen to the close event
|
||||||
|
popupEl.addEventListener('closed', () => document.body.removeChild(popupEl));
|
||||||
|
|
||||||
|
// Set the message
|
||||||
|
popupEl.message = message;
|
||||||
|
|
||||||
|
// Add to the DOM
|
||||||
|
document.body.appendChild(popupEl);
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
// #docregion
|
// #docregion
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
import { Hero, HeroTaxReturn } from './hero';
|
import { Hero, HeroTaxReturn } from './hero';
|
||||||
import { HeroesService } from './heroes.service';
|
import { HeroesService } from './heroes.service';
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable, Observer } from 'rxjs';
|
||||||
import { Observer } from 'rxjs/Observer';
|
|
||||||
|
|
||||||
import { Hero, HeroTaxReturn } from './hero';
|
import { Hero, HeroTaxReturn } from './hero';
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// #docregion
|
// #docregion
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
import { Villain, VillainsService } from './villains.service';
|
import { Villain, VillainsService } from './villains.service';
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
import { of } from 'rxjs/observable/of';
|
import { of } from 'rxjs';
|
||||||
|
|
||||||
export interface Villain { id: number; name: string; }
|
export interface Villain { id: number; name: string; }
|
||||||
|
|
||||||
|
@ -28,7 +28,10 @@ let checkLogForMessage = (message: string) => {
|
|||||||
expect(page.logList.getText()).toContain(message);
|
expect(page.logList.getText()).toContain(message);
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('Http Tests', function() {
|
// TODO(i): temorarily disable these tests because angular-in-memory-web-api is not compatible with rxjs v6 yet
|
||||||
|
// and we don't have the backwards compatibility package yet.
|
||||||
|
// Reenable after rxjs v6 compatibility package is out or angular-in-memory-web-api is compatible with rxjs v6
|
||||||
|
xdescribe('Http Tests', function() {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
browser.get('');
|
browser.get('');
|
||||||
});
|
});
|
||||||
|
@ -30,7 +30,7 @@ export class ConfigComponent {
|
|||||||
this.configService.getConfig()
|
this.configService.getConfig()
|
||||||
// #enddocregion v1, v2
|
// #enddocregion v1, v2
|
||||||
.subscribe(
|
.subscribe(
|
||||||
data => this.config = { ...data }, // success path
|
(data: Config) => this.config = { ...data }, // success path
|
||||||
error => this.error = error // error path
|
error => this.error = error // error path
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@ export class ConfigComponent {
|
|||||||
showConfig_v1() {
|
showConfig_v1() {
|
||||||
this.configService.getConfig_1()
|
this.configService.getConfig_1()
|
||||||
// #docregion v1, v1_callback
|
// #docregion v1, v1_callback
|
||||||
.subscribe(data => this.config = {
|
.subscribe((data: Config) => this.config = {
|
||||||
heroesUrl: data['heroesUrl'],
|
heroesUrl: data['heroesUrl'],
|
||||||
textfile: data['textfile']
|
textfile: data['textfile']
|
||||||
});
|
});
|
||||||
@ -51,7 +51,7 @@ export class ConfigComponent {
|
|||||||
this.configService.getConfig()
|
this.configService.getConfig()
|
||||||
// #docregion v2, v2_callback
|
// #docregion v2, v2_callback
|
||||||
// clone the data object, using its known Config shape
|
// clone the data object, using its known Config shape
|
||||||
.subscribe(data => this.config = { ...data });
|
.subscribe((data: Config) => this.config = { ...data });
|
||||||
// #enddocregion v2_callback
|
// #enddocregion v2_callback
|
||||||
}
|
}
|
||||||
// #enddocregion v2
|
// #enddocregion v2
|
||||||
|
@ -6,8 +6,7 @@ import { HttpClient } from '@angular/common/http';
|
|||||||
import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
|
import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
|
||||||
|
|
||||||
// #docregion rxjs-imports
|
// #docregion rxjs-imports
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable, throwError } from 'rxjs';
|
||||||
import { ErrorObservable } from 'rxjs/observable/ErrorObservable';
|
|
||||||
import { catchError, retry } from 'rxjs/operators';
|
import { catchError, retry } from 'rxjs/operators';
|
||||||
// #enddocregion rxjs-imports
|
// #enddocregion rxjs-imports
|
||||||
|
|
||||||
@ -82,8 +81,8 @@ export class ConfigService {
|
|||||||
`Backend returned code ${error.status}, ` +
|
`Backend returned code ${error.status}, ` +
|
||||||
`body was: ${error.error}`);
|
`body was: ${error.error}`);
|
||||||
}
|
}
|
||||||
// return an ErrorObservable with a user-facing error message
|
// return an observable with a user-facing error message
|
||||||
return new ErrorObservable(
|
return throwError(
|
||||||
'Something bad happened; please try again later.');
|
'Something bad happened; please try again later.');
|
||||||
};
|
};
|
||||||
// #enddocregion handleError
|
// #enddocregion handleError
|
||||||
|
@ -6,8 +6,7 @@ import { HttpHeaders } from '@angular/common/http';
|
|||||||
|
|
||||||
// #enddocregion http-options
|
// #enddocregion http-options
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
import { of } from 'rxjs/observable/of';
|
|
||||||
import { catchError } from 'rxjs/operators';
|
import { catchError } from 'rxjs/operators';
|
||||||
|
|
||||||
import { Hero } from './hero';
|
import { Hero } from './hero';
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpErrorResponse } from '@angular/common/http';
|
import { HttpErrorResponse } from '@angular/common/http';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable, of } from 'rxjs';
|
||||||
import { of } from 'rxjs/observable/of';
|
|
||||||
|
|
||||||
import { MessageService } from './message.service';
|
import { MessageService } from './message.service';
|
||||||
|
|
||||||
|
@ -4,8 +4,6 @@ import {
|
|||||||
HttpEvent, HttpInterceptor, HttpHandler, HttpRequest
|
HttpEvent, HttpInterceptor, HttpHandler, HttpRequest
|
||||||
} from '@angular/common/http';
|
} from '@angular/common/http';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
|
|
||||||
// #docregion
|
// #docregion
|
||||||
import { AuthService } from '../auth.service';
|
import { AuthService } from '../auth.service';
|
||||||
|
|
||||||
|
@ -5,8 +5,7 @@ import {
|
|||||||
HttpInterceptor, HttpHandler
|
HttpInterceptor, HttpHandler
|
||||||
} from '@angular/common/http';
|
} from '@angular/common/http';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable, of } from 'rxjs';
|
||||||
import { of } from 'rxjs/observable/of';
|
|
||||||
import { startWith, tap } from 'rxjs/operators';
|
import { startWith, tap } from 'rxjs/operators';
|
||||||
|
|
||||||
import { RequestCache } from '../request-cache.service';
|
import { RequestCache } from '../request-cache.service';
|
||||||
|
@ -3,7 +3,7 @@ import {
|
|||||||
HttpEvent, HttpInterceptor, HttpHandler, HttpRequest
|
HttpEvent, HttpInterceptor, HttpHandler, HttpRequest
|
||||||
} from '@angular/common/http';
|
} from '@angular/common/http';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class EnsureHttpsInterceptor implements HttpInterceptor {
|
export class EnsureHttpsInterceptor implements HttpInterceptor {
|
||||||
|
@ -4,7 +4,6 @@ import {
|
|||||||
HttpRequest, HttpResponse
|
HttpRequest, HttpResponse
|
||||||
} from '@angular/common/http';
|
} from '@angular/common/http';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
// #docregion excerpt
|
// #docregion excerpt
|
||||||
import { finalize, tap } from 'rxjs/operators';
|
import { finalize, tap } from 'rxjs/operators';
|
||||||
import { MessageService } from '../message.service';
|
import { MessageService } from '../message.service';
|
||||||
|
@ -3,7 +3,7 @@ import {
|
|||||||
HttpEvent, HttpInterceptor, HttpHandler, HttpRequest
|
HttpEvent, HttpInterceptor, HttpHandler, HttpRequest
|
||||||
} from '@angular/common/http';
|
} from '@angular/common/http';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
/** Pass untouched request through to the next request handler. */
|
/** Pass untouched request through to the next request handler. */
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@ -3,7 +3,7 @@ import {
|
|||||||
HttpEvent, HttpInterceptor, HttpHandler, HttpRequest
|
HttpEvent, HttpInterceptor, HttpHandler, HttpRequest
|
||||||
} from '@angular/common/http';
|
} from '@angular/common/http';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class TrimNameInterceptor implements HttpInterceptor {
|
export class TrimNameInterceptor implements HttpInterceptor {
|
||||||
|
@ -5,8 +5,7 @@ import {
|
|||||||
HttpEventType, HttpProgressEvent
|
HttpEventType, HttpProgressEvent
|
||||||
} from '@angular/common/http';
|
} from '@angular/common/http';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
import { of } from 'rxjs/observable/of';
|
|
||||||
|
|
||||||
/** Simulate server replying to file upload request */
|
/** Simulate server replying to file upload request */
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable, Subject } from 'rxjs';
|
||||||
import { Subject } from 'rxjs/Subject';
|
|
||||||
import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators';
|
import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators';
|
||||||
|
|
||||||
import { NpmPackageInfo, PackageSearchService } from './package-search.service';
|
import { NpmPackageInfo, PackageSearchService } from './package-search.service';
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable, of } from 'rxjs';
|
||||||
import { of } from 'rxjs/observable/of';
|
|
||||||
import { catchError, map } from 'rxjs/operators';
|
import { catchError, map } from 'rxjs/operators';
|
||||||
|
|
||||||
import { HttpErrorHandler, HandleError } from '../http-error-handler.service';
|
import { HttpErrorHandler, HandleError } from '../http-error-handler.service';
|
||||||
|
@ -4,7 +4,7 @@ import {
|
|||||||
HttpRequest, HttpResponse, HttpErrorResponse
|
HttpRequest, HttpResponse, HttpErrorResponse
|
||||||
} from '@angular/common/http';
|
} from '@angular/common/http';
|
||||||
|
|
||||||
import { of } from 'rxjs/observable/of';
|
import { of } from 'rxjs';
|
||||||
import { catchError, last, map, tap } from 'rxjs/operators';
|
import { catchError, last, map, tap } from 'rxjs/operators';
|
||||||
|
|
||||||
import { MessageService } from '../message.service';
|
import { MessageService } from '../message.service';
|
||||||
|
@ -6,12 +6,7 @@ declare var jasmine;
|
|||||||
|
|
||||||
import './polyfills';
|
import './polyfills';
|
||||||
|
|
||||||
import 'zone.js/dist/async-test';
|
import 'zone.js/dist/zone-testing';
|
||||||
import 'zone.js/dist/fake-async-test';
|
|
||||||
import 'zone.js/dist/long-stack-trace-zone';
|
|
||||||
import 'zone.js/dist/proxy.js';
|
|
||||||
import 'zone.js/dist/sync-test';
|
|
||||||
import 'zone.js/dist/jasmine-patch';
|
|
||||||
|
|
||||||
import { getTestBed } from '@angular/core/testing';
|
import { getTestBed } from '@angular/core/testing';
|
||||||
import {
|
import {
|
||||||
|
@ -43,6 +43,7 @@ export class PeekABooParentComponent {
|
|||||||
this.heroName = 'Windstorm';
|
this.heroName = 'Windstorm';
|
||||||
this.logger.clear(); // clear log on create
|
this.logger.clear(); // clear log on create
|
||||||
}
|
}
|
||||||
|
this.hookLog = this.logger.logs;
|
||||||
this.logger.tick();
|
this.logger.tick();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
// #docregion
|
// #docregion
|
||||||
import { Injectable, OnDestroy } from '@angular/core';
|
import { Injectable, OnDestroy } from '@angular/core';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable, of } from 'rxjs';
|
||||||
import { of } from 'rxjs/observable/of';
|
|
||||||
import { delay } from 'rxjs/operators';
|
import { delay } from 'rxjs/operators';
|
||||||
|
|
||||||
export class Contact {
|
export class Contact {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
import { Crisis,
|
import { Crisis,
|
||||||
CrisisService } from './crisis.service';
|
CrisisService } from './crisis.service';
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Injectable, OnDestroy } from '@angular/core';
|
import { Injectable, OnDestroy } from '@angular/core';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable, of } from 'rxjs';
|
||||||
import { of } from 'rxjs/observable/of';
|
|
||||||
import { delay } from 'rxjs/operators';
|
import { delay } from 'rxjs/operators';
|
||||||
|
|
||||||
export class Crisis {
|
export class Crisis {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
import { Hero,
|
import { Hero,
|
||||||
HeroService } from './hero.service';
|
HeroService } from './hero.service';
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Injectable, OnDestroy } from '@angular/core';
|
import { Injectable, OnDestroy } from '@angular/core';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable, of } from 'rxjs';
|
||||||
import { of } from 'rxjs/observable/of';
|
|
||||||
import { delay } from 'rxjs/operators';
|
import { delay } from 'rxjs/operators';
|
||||||
|
|
||||||
export class Hero {
|
export class Hero {
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import { Injectable, OnDestroy } from '@angular/core';
|
import { Injectable, OnDestroy } from '@angular/core';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable, of } from 'rxjs';
|
||||||
import { of } from 'rxjs/observable/of';
|
import { delay } from 'rxjs/operators';
|
||||||
import { delay } from 'rxjs/operator/delay';
|
|
||||||
|
|
||||||
export class Contact {
|
export class Contact {
|
||||||
constructor(public id: number, public name: string) { }
|
constructor(public id: number, public name: string) { }
|
||||||
@ -24,12 +23,12 @@ export class ContactService implements OnDestroy {
|
|||||||
ngOnDestroy() { console.log('ContactService instance destroyed.'); }
|
ngOnDestroy() { console.log('ContactService instance destroyed.'); }
|
||||||
|
|
||||||
getContacts(): Observable<Contact[]> {
|
getContacts(): Observable<Contact[]> {
|
||||||
return delay.call(of(CONTACTS), FETCH_LATENCY);
|
return of(CONTACTS).pipe(delay(FETCH_LATENCY));
|
||||||
}
|
}
|
||||||
|
|
||||||
getContact(id: number | string): Observable<Contact> {
|
getContact(id: number | string): Observable<Contact> {
|
||||||
const contact$ = of(CONTACTS.find(contact => contact.id === +id));
|
const contact$ = of(CONTACTS.find(contact => contact.id === +id));
|
||||||
return delay.call(contact$, FETCH_LATENCY);
|
return contact$.pipe(delay(FETCH_LATENCY));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
import { Customer,
|
import { Customer,
|
||||||
CustomersService } from './customers.service';
|
CustomersService } from './customers.service';
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import { Injectable, OnDestroy } from '@angular/core';
|
import { Injectable, OnDestroy } from '@angular/core';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable, of } from 'rxjs';
|
||||||
import { of } from 'rxjs/observable/of';
|
import { delay } from 'rxjs/operators';
|
||||||
import { delay } from 'rxjs/operator/delay';
|
|
||||||
|
|
||||||
export class Customer {
|
export class Customer {
|
||||||
constructor(public id: number, public name: string) { }
|
constructor(public id: number, public name: string) { }
|
||||||
@ -27,11 +26,11 @@ export class CustomersService implements OnDestroy {
|
|||||||
ngOnDestroy() { console.log('CustomersService instance destroyed.'); }
|
ngOnDestroy() { console.log('CustomersService instance destroyed.'); }
|
||||||
|
|
||||||
getCustomers(): Observable<Customer[]> {
|
getCustomers(): Observable<Customer[]> {
|
||||||
return delay.call(of(CUSTOMERS), FETCH_LATENCY);
|
return of(CUSTOMERS).pipe(delay(FETCH_LATENCY));
|
||||||
}
|
}
|
||||||
|
|
||||||
getCustomer(id: number | string): Observable<Customer> {
|
getCustomer(id: number | string): Observable<Customer> {
|
||||||
const customer$ = of(CUSTOMERS.find(customer => customer.id === +id));
|
const customer$ = of(CUSTOMERS.find(customer => customer.id === +id));
|
||||||
return delay.call(customer$, FETCH_LATENCY);
|
return customer$.pipe(delay(FETCH_LATENCY));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Observable }from 'rxjs/Observable';
|
import { Observable }from 'rxjs';
|
||||||
|
|
||||||
import { Item,
|
import { Item,
|
||||||
ItemService } from './items.service';
|
ItemService } from './items.service';
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
|
import { ItemsComponent } from './items.component';
|
||||||
import { ItemsListComponent } from './items-list.component';
|
import { ItemsListComponent } from './items-list.component';
|
||||||
import { ItemsDetailComponent } from './items-detail.component';
|
import { ItemsDetailComponent } from './items-detail.component';
|
||||||
import { ItemService } from './items.service';
|
import { ItemService } from './items.service';
|
||||||
@ -8,7 +9,7 @@ import { ItemsRoutingModule } from './items-routing.module';
|
|||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [ CommonModule, ItemsRoutingModule ],
|
imports: [ CommonModule, ItemsRoutingModule ],
|
||||||
declarations: [ ItemsDetailComponent, ItemsListComponent ],
|
declarations: [ ItemsComponent, ItemsDetailComponent, ItemsListComponent ],
|
||||||
providers: [ ItemService ]
|
providers: [ ItemService ]
|
||||||
})
|
})
|
||||||
export class ItemsModule {}
|
export class ItemsModule {}
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import { Injectable, OnDestroy } from '@angular/core';
|
import { Injectable, OnDestroy } from '@angular/core';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable, of } from 'rxjs';
|
||||||
import { of } from 'rxjs/observable/of';
|
import { delay } from 'rxjs/operators';
|
||||||
import { delay } from 'rxjs/operator/delay';
|
|
||||||
|
|
||||||
export class Item {
|
export class Item {
|
||||||
constructor(public id: number, public name: string) { }
|
constructor(public id: number, public name: string) { }
|
||||||
@ -25,12 +24,12 @@ export class ItemService implements OnDestroy {
|
|||||||
ngOnDestroy() { console.log('ItemService instance destroyed.'); }
|
ngOnDestroy() { console.log('ItemService instance destroyed.'); }
|
||||||
|
|
||||||
getItems(): Observable<Item[]> {
|
getItems(): Observable<Item[]> {
|
||||||
return delay.call(of(ITEMS), FETCH_LATENCY);
|
return of(ITEMS).pipe(delay(FETCH_LATENCY));
|
||||||
}
|
}
|
||||||
|
|
||||||
getItem(id: number | string): Observable<Item> {
|
getItem(id: number | string): Observable<Item> {
|
||||||
const item$ = of(ITEMS.find(item => item.id === +id));
|
const item$ = of(ITEMS.find(item => item.id === +id));
|
||||||
return delay.call(item$, FETCH_LATENCY);
|
return item$.pipe(delay(FETCH_LATENCY));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
import { Component, Output, OnInit, EventEmitter, NgModule } from '@angular/core';
|
import { Component, Output, OnInit, EventEmitter, NgModule } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
// #docregion eventemitter
|
// #docregion eventemitter
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
// #docregion subscriber
|
// #docregion subscriber
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
// #docregion
|
// #docregion
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
// #docregion delay_sequence
|
// #docregion delay_sequence
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable, of } from 'rxjs';
|
||||||
import 'rxjs/add/observable/of';
|
|
||||||
|
|
||||||
// #docregion observer
|
// #docregion observer
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { HttpModule } from '@angular/http';
|
import { HttpClientModule } from '@angular//common/http';
|
||||||
|
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import {
|
import {
|
||||||
@ -26,7 +26,7 @@ import { ExponentialStrengthPipe } from './exponential-strength.pipe';
|
|||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
HttpModule
|
HttpClientModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent,
|
AppComponent,
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
// #docregion
|
// #docregion
|
||||||
import { Pipe, PipeTransform } from '@angular/core';
|
import { Pipe, PipeTransform } from '@angular/core';
|
||||||
import { Http } from '@angular/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
|
||||||
import 'rxjs/add/operator/map';
|
|
||||||
|
|
||||||
// #docregion pipe-metadata
|
// #docregion pipe-metadata
|
||||||
@Pipe({
|
@Pipe({
|
||||||
name: 'fetch',
|
name: 'fetch',
|
||||||
@ -14,15 +11,13 @@ export class FetchJsonPipe implements PipeTransform {
|
|||||||
private cachedData: any = null;
|
private cachedData: any = null;
|
||||||
private cachedUrl = '';
|
private cachedUrl = '';
|
||||||
|
|
||||||
constructor(private http: Http) { }
|
constructor(private http: HttpClient) { }
|
||||||
|
|
||||||
transform(url: string): any {
|
transform(url: string): any {
|
||||||
if (url !== this.cachedUrl) {
|
if (url !== this.cachedUrl) {
|
||||||
this.cachedData = null;
|
this.cachedData = null;
|
||||||
this.cachedUrl = url;
|
this.cachedUrl = url;
|
||||||
this.http.get(url)
|
this.http.get(url).subscribe( result => this.cachedData = result );
|
||||||
.map( result => result.json() )
|
|
||||||
.subscribe( result => this.cachedData = result );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.cachedData;
|
return this.cachedData;
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
// #docregion
|
// #docregion
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable, interval } from 'rxjs';
|
||||||
import 'rxjs/add/observable/interval';
|
import { map, take } from 'rxjs/operators';
|
||||||
import 'rxjs/add/operator/map';
|
|
||||||
import 'rxjs/add/operator/take';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-hero-message',
|
selector: 'app-hero-message',
|
||||||
@ -25,14 +23,17 @@ export class HeroAsyncMessageComponent {
|
|||||||
constructor() { this.resend(); }
|
constructor() { this.resend(); }
|
||||||
|
|
||||||
resend() {
|
resend() {
|
||||||
this.message$ = Observable.interval(500)
|
this.message$ = interval(500).pipe(
|
||||||
.map(i => this.messages[i])
|
map(i => this.messages[i]),
|
||||||
.take(this.messages.length);
|
take(this.messages.length)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// #enddocregion
|
// #enddocregion
|
||||||
|
|
||||||
// Alternative message$ formula:
|
// Alternative message$ formula:
|
||||||
// this.message$ = Observable.fromArray(this.messages)
|
// this.message$ = fromArray(this.messages).pipe(
|
||||||
// .map(message => Observable.timer(500).map(() => message))
|
// map(message => timer(500),
|
||||||
// .concatAll();
|
// map(() => message)),
|
||||||
|
// concatAll()
|
||||||
|
// );
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
|
|
||||||
import { ajax } from 'rxjs/observable/dom/ajax';
|
import { pipe, range, timer, zip } from 'rxjs';
|
||||||
import { range } from 'rxjs/observable/range';
|
import { ajax } from 'rxjs/ajax';
|
||||||
import { timer } from 'rxjs/observable/timer';
|
import { retryWhen, map, mergeMap } from 'rxjs/operators';
|
||||||
import { pipe } from 'rxjs/util/pipe';
|
|
||||||
import { retryWhen, zip, map, mergeMap } from 'rxjs/operators';
|
|
||||||
|
|
||||||
function backoff(maxTries, ms) {
|
function backoff(maxTries, ms) {
|
||||||
return pipe(
|
return pipe(
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
import { fromEvent } from 'rxjs/observable/fromEvent';
|
import { fromEvent } from 'rxjs';
|
||||||
import { ajax } from 'rxjs/observable/dom/ajax';
|
import { ajax } from 'rxjs/ajax';
|
||||||
import { map, filter, debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators';
|
import { map, filter, debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators';
|
||||||
|
|
||||||
const searchBox = document.getElementById('search-box');
|
const searchBox = document.getElementById('search-box');
|
||||||
|
@ -6,7 +6,6 @@ import { UserService } from './user.service';
|
|||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [ BrowserModule ],
|
imports: [ BrowserModule ],
|
||||||
providers: [ UserService ],
|
|
||||||
declarations: [ AppComponent ],
|
declarations: [ AppComponent ],
|
||||||
bootstrap: [ AppComponent ]
|
bootstrap: [ AppComponent ]
|
||||||
})
|
})
|
||||||
|
9
aio/content/examples/providers/src/app/user.module.ts
Normal file
9
aio/content/examples/providers/src/app/user.module.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
|
||||||
|
import { UserService } from './user.service';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
providers: [UserService],
|
||||||
|
})
|
||||||
|
export class UserModule {
|
||||||
|
}
|
7
aio/content/examples/providers/src/app/user.service.0.ts
Normal file
7
aio/content/examples/providers/src/app/user.service.0.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
})
|
||||||
|
export class UserService {
|
||||||
|
}
|
8
aio/content/examples/providers/src/app/user.service.1.ts
Normal file
8
aio/content/examples/providers/src/app/user.service.1.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { UserModule } from './user.module';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: UserModule,
|
||||||
|
})
|
||||||
|
export class UserService {
|
||||||
|
}
|
@ -3,9 +3,7 @@ import { UserService } from './user.service';
|
|||||||
|
|
||||||
describe('UserService', () => {
|
describe('UserService', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({});
|
||||||
providers: [UserService]
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should ...', inject([UserService], (service: UserService) => {
|
it('should ...', inject([UserService], (service: UserService) => {
|
||||||
|
@ -5,7 +5,9 @@ export class User {
|
|||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
})
|
||||||
export class UserService {
|
export class UserService {
|
||||||
|
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"!**/*.d.ts",
|
"!**/*.d.ts",
|
||||||
"!**/*.js",
|
"!**/*.js",
|
||||||
"!**/*.[1,2].*"
|
"!**/*.[0,1,2].*"
|
||||||
],
|
],
|
||||||
"file": "src/app/app.component.ts",
|
"file": "src/app/app.component.ts",
|
||||||
"tags": ["providers"]
|
"tags": ["providers"]
|
||||||
|
@ -6,32 +6,38 @@ import { BrowserModule } from '@angular/platform-browser';
|
|||||||
import { ReactiveFormsModule } from '@angular/forms'; // <-- #1 import module
|
import { ReactiveFormsModule } from '@angular/forms'; // <-- #1 import module
|
||||||
|
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { HeroDetailComponent } from './hero-detail/hero-detail.component'; // <-- #1 import component
|
import { HeroDetailComponent } from './hero-detail/hero-detail.component';
|
||||||
// #enddocregion v1
|
// #enddocregion v1
|
||||||
|
// #docregion hero-service-list
|
||||||
|
// add JavaScript imports
|
||||||
import { HeroListComponent } from './hero-list/hero-list.component';
|
import { HeroListComponent } from './hero-list/hero-list.component';
|
||||||
|
import { HeroService } from './hero.service';
|
||||||
import { HeroService } from './hero.service'; // <-- #1 import service
|
|
||||||
// #docregion v1
|
// #docregion v1
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
|
||||||
BrowserModule,
|
|
||||||
ReactiveFormsModule // <-- #2 add to @NgModule imports
|
|
||||||
],
|
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent,
|
AppComponent,
|
||||||
HeroDetailComponent,
|
HeroDetailComponent,
|
||||||
// #enddocregion v1
|
// #enddocregion v1
|
||||||
HeroListComponent
|
HeroListComponent // <--declare HeroListComponent
|
||||||
// #docregion v1
|
// #docregion v1
|
||||||
],
|
],
|
||||||
// #enddocregion v1
|
// #enddocregion hero-service-list
|
||||||
exports: [ // export for the DemoModule
|
imports: [
|
||||||
|
BrowserModule,
|
||||||
|
ReactiveFormsModule // <-- #2 add to @NgModule imports
|
||||||
|
],
|
||||||
|
// #enddocregion v1
|
||||||
|
// export for the DemoModule
|
||||||
|
// #docregion hero-service-list
|
||||||
|
// ...
|
||||||
|
exports: [
|
||||||
AppComponent,
|
AppComponent,
|
||||||
HeroDetailComponent,
|
HeroDetailComponent,
|
||||||
HeroListComponent
|
HeroListComponent // <-- export HeroListComponent
|
||||||
],
|
],
|
||||||
providers: [ HeroService ], // <-- #4 provide HeroService
|
providers: [ HeroService ], // <-- provide HeroService
|
||||||
|
// #enddocregion hero-service-list
|
||||||
// #docregion v1
|
// #docregion v1
|
||||||
bootstrap: [ AppComponent ]
|
bootstrap: [ AppComponent ]
|
||||||
})
|
})
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/* tslint:disable:member-ordering */
|
/* tslint:disable:member-ordering */
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs';
|
||||||
|
import { finalize } from 'rxjs/operators';
|
||||||
|
|
||||||
import { Hero } from './data-model';
|
import { Hero } from './data-model';
|
||||||
import { HeroService } from './hero.service';
|
import { HeroService } from './hero.service';
|
||||||
@ -33,8 +34,9 @@ export class DemoComponent {
|
|||||||
|
|
||||||
getHeroes() {
|
getHeroes() {
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
this.heroes = this.heroService.getHeroes()
|
this.heroes = this.heroService.getHeroes().pipe(
|
||||||
.finally(() => this.isLoading = false);
|
finalize(() => this.isLoading = false)
|
||||||
|
);
|
||||||
this.selectedHero = undefined;
|
this.selectedHero = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!-- #docregion basic-form-->
|
<!-- #docregion basic-form-->
|
||||||
<h2>Hero Detail</h2>
|
<h2>Hero Detail</h2>
|
||||||
<h3><i>FormControl in a FormGroup</i></h3>
|
<h3><i>FormControl in a FormGroup</i></h3>
|
||||||
<form [formGroup]="heroForm" novalidate>
|
<form [formGroup]="heroForm">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="center-block">Name:
|
<label class="center-block">Name:
|
||||||
<input class="form-control" formControlName="name">
|
<input class="form-control" formControlName="name">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!-- #docregion basic-form-->
|
<!-- #docregion basic-form-->
|
||||||
<h2>Hero Detail</h2>
|
<h2>Hero Detail</h2>
|
||||||
<h3><i>A FormGroup with a single FormControl using FormBuilder</i></h3>
|
<h3><i>A FormGroup with a single FormControl using FormBuilder</i></h3>
|
||||||
<form [formGroup]="heroForm" novalidate>
|
<form [formGroup]="heroForm">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="center-block">Name:
|
<label class="center-block">Name:
|
||||||
<input class="form-control" formControlName="name">
|
<input class="form-control" formControlName="name">
|
||||||
@ -13,4 +13,4 @@
|
|||||||
<!-- #docregion form-value-json -->
|
<!-- #docregion form-value-json -->
|
||||||
<p>Form value: {{ heroForm.value | json }}</p>
|
<p>Form value: {{ heroForm.value | json }}</p>
|
||||||
<p>Form status: {{ heroForm.status | json }}</p>
|
<p>Form status: {{ heroForm.status | json }}</p>
|
||||||
<!-- #enddocregion form-value-json -->
|
<!-- #enddocregion form-value-json -->
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!-- #docregion -->
|
<!-- #docregion -->
|
||||||
<h2>Hero Detail</h2>
|
<h2>Hero Detail</h2>
|
||||||
<h3><i>A FormGroup with multiple FormControls</i></h3>
|
<h3><i>A FormGroup with multiple FormControls</i></h3>
|
||||||
<form [formGroup]="heroForm" novalidate>
|
<form [formGroup]="heroForm">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="center-block">Name:
|
<label class="center-block">Name:
|
||||||
<input class="form-control" formControlName="name">
|
<input class="form-control" formControlName="name">
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
<form [formGroup]="heroForm" novalidate>
|
<form [formGroup]="heroForm">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="center-block">Name:
|
<label class="center-block">Name:
|
||||||
<input class="form-control" formControlName="name">
|
<input class="form-control" formControlName="name">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!-- #docregion -->
|
<!-- #docregion -->
|
||||||
<h2>Hero Detail</h2>
|
<h2>Hero Detail</h2>
|
||||||
<h3><i>PatchValue to initialize a value</i></h3>
|
<h3><i>PatchValue to initialize a value</i></h3>
|
||||||
<form [formGroup]="heroForm" novalidate>
|
<form [formGroup]="heroForm">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="center-block">Name:
|
<label class="center-block">Name:
|
||||||
<input class="form-control" formControlName="name">
|
<input class="form-control" formControlName="name">
|
||||||
|
@ -44,7 +44,13 @@ export class HeroDetailComponent6 implements OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// #docregion patch-value-on-changes
|
// #docregion patch-value-on-changes
|
||||||
ngOnChanges() { // <-- wrap patchValue in ngOnChanges
|
ngOnChanges() { // <-- call rebuildForm in ngOnChanges
|
||||||
|
this.rebuildForm();
|
||||||
|
}
|
||||||
|
// #enddocregion patch-value-on-changes
|
||||||
|
|
||||||
|
// #docregion patch-value-rebuildform
|
||||||
|
rebuildForm() { // <-- wrap patchValue in rebuildForm
|
||||||
this.heroForm.reset();
|
this.heroForm.reset();
|
||||||
// #docregion patch-value
|
// #docregion patch-value
|
||||||
this.heroForm.patchValue({
|
this.heroForm.patchValue({
|
||||||
@ -52,7 +58,9 @@ export class HeroDetailComponent6 implements OnChanges {
|
|||||||
});
|
});
|
||||||
// #enddocregion patch-value
|
// #enddocregion patch-value
|
||||||
}
|
}
|
||||||
// #enddocregion patch-value-on-changes
|
// #enddocregion patch-value-rebuildform
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// #enddocregion v6
|
// #enddocregion v6
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!-- #docregion -->
|
<!-- #docregion -->
|
||||||
<h2>Hero Detail</h2>
|
<h2>Hero Detail</h2>
|
||||||
<h3><i>A FormGroup with multiple FormControls</i></h3>
|
<h3><i>A FormGroup with multiple FormControls</i></h3>
|
||||||
<form [formGroup]="heroForm" novalidate>
|
<form [formGroup]="heroForm">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="center-block">Name:
|
<label class="center-block">Name:
|
||||||
<input class="form-control" formControlName="name">
|
<input class="form-control" formControlName="name">
|
||||||
|
@ -38,32 +38,31 @@ export class HeroDetailComponent7 implements OnChanges {
|
|||||||
|
|
||||||
// #docregion ngOnChanges
|
// #docregion ngOnChanges
|
||||||
ngOnChanges() {
|
ngOnChanges() {
|
||||||
|
this.rebuildForm();
|
||||||
|
}
|
||||||
|
// #enddocregion ngOnChanges
|
||||||
|
|
||||||
|
// #docregion rebuildForm
|
||||||
|
rebuildForm() {
|
||||||
this.heroForm.reset({
|
this.heroForm.reset({
|
||||||
name: this.hero.name,
|
name: this.hero.name,
|
||||||
address: this.hero.addresses[0] || new Address()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// #enddocregion ngOnChanges
|
|
||||||
|
|
||||||
/* First version of ngOnChanges
|
|
||||||
// #docregion ngOnChanges-1
|
|
||||||
ngOnChanges()
|
|
||||||
// #enddocregion ngOnChanges-1
|
|
||||||
*/
|
|
||||||
ngOnChanges1() {
|
|
||||||
// #docregion reset
|
|
||||||
this.heroForm.reset();
|
|
||||||
// #enddocregion reset
|
|
||||||
// #docregion ngOnChanges-1
|
|
||||||
// #docregion set-value
|
|
||||||
this.heroForm.setValue({
|
|
||||||
name: this.hero.name,
|
|
||||||
// #docregion set-value-address
|
// #docregion set-value-address
|
||||||
address: this.hero.addresses[0] || new Address()
|
address: this.hero.addresses[0] || new Address()
|
||||||
// #enddocregion set-value-address
|
// #enddocregion set-value-address
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
// #enddocregion rebuildForm
|
||||||
|
|
||||||
|
/* First version of rebuildForm */
|
||||||
|
rebuildForm1() {
|
||||||
|
// #docregion reset
|
||||||
|
this.heroForm.reset();
|
||||||
|
// #enddocregion reset
|
||||||
|
// #docregion set-value
|
||||||
|
this.heroForm.setValue({
|
||||||
|
name: this.hero.name,
|
||||||
|
address: this.hero.addresses[0] || new Address()
|
||||||
|
});
|
||||||
// #enddocregion set-value
|
// #enddocregion set-value
|
||||||
}
|
}
|
||||||
// #enddocregion ngOnChanges-1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!-- #docplaster-->
|
<!-- #docplaster-->
|
||||||
<h3><i>Using FormArray to add groups</i></h3>
|
<h3><i>Using FormArray to add groups</i></h3>
|
||||||
|
|
||||||
<form [formGroup]="heroForm" novalidate>
|
<form [formGroup]="heroForm">
|
||||||
<p>Form Changed: {{ heroForm.dirty }}</p>
|
<p>Form Changed: {{ heroForm.dirty }}</p>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -11,7 +11,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- #docregion form-array-->
|
<!-- #docregion form-array-->
|
||||||
<!-- #docregion form-array-skeleton -->
|
<!-- #docregion form-array-skeleton -->
|
||||||
|
<!-- #docregion form-array-name -->
|
||||||
<div formArrayName="secretLairs" class="well well-lg">
|
<div formArrayName="secretLairs" class="well well-lg">
|
||||||
|
<!-- #enddocregion form-array-name -->
|
||||||
<div *ngFor="let address of secretLairs.controls; let i=index" [formGroupName]="i" >
|
<div *ngFor="let address of secretLairs.controls; let i=index" [formGroupName]="i" >
|
||||||
<!-- The repeated address template -->
|
<!-- The repeated address template -->
|
||||||
<!-- #enddocregion form-array-skeleton -->
|
<!-- #enddocregion form-array-skeleton -->
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user