Compare commits
552 Commits
patch_sync
...
5.1.0-beta
Author | SHA1 | Date | |
---|---|---|---|
78ba39bfe2 | |||
119034c642 | |||
6e8e3bd248 | |||
a460066972 | |||
05d96dc507 | |||
b489259a34 | |||
6b748835be | |||
d30ea61f0d | |||
0c47ea704e | |||
049c89645b | |||
bf22f2df88 | |||
880201681f | |||
63d26a1777 | |||
8b50ed083c | |||
3997d97806 | |||
200d92d030 | |||
dbec3ca716 | |||
f7c9b941cb | |||
f0764016f9 | |||
a99eb16320 | |||
e36bac9e90 | |||
196ce6d475 | |||
faa621218e | |||
169cedd43b | |||
567cc26b8e | |||
1d19d61970 | |||
03f080b7da | |||
26f82995f6 | |||
f1da1419fa | |||
5079d2d37c | |||
c7fd172ba7 | |||
dcf8840831 | |||
60c0b178af | |||
0899f4f8fc | |||
aed4a11d01 | |||
75cf70ae04 | |||
6b30fbf94e | |||
24f17f913a | |||
ebfa204af0 | |||
a28d616e10 | |||
613a9e3672 | |||
65d57a07e0 | |||
22946cfd40 | |||
9975486954 | |||
068348e9b1 | |||
1beab0da6a | |||
3a03ff6b2d | |||
feae55b264 | |||
0355142737 | |||
5b16ce9302 | |||
17ed14faea | |||
d156e72ad7 | |||
7186c9c839 | |||
a41558eb30 | |||
a91252a90c | |||
132c0719dc | |||
3db7112b89 | |||
2ea76cce31 | |||
b8bb2dd0f5 | |||
27ae0f9475 | |||
171dceb010 | |||
1ebc0d1e33 | |||
1d8e0758fa | |||
cd55643f85 | |||
486b8e6f69 | |||
215d373ebd | |||
4038b42396 | |||
9ab1f4a9c9 | |||
e9afc59a81 | |||
83c826c3f9 | |||
abfc41d661 | |||
11fd7eaf63 | |||
54eba606cb | |||
3337865913 | |||
f24397c5d0 | |||
9d52bf27de | |||
19fbfbc371 | |||
6578b30b77 | |||
10c1c2ba5a | |||
e18bfd1f3d | |||
3c2ddbe9ab | |||
a149605c9f | |||
b396029d39 | |||
040b376052 | |||
175c872514 | |||
71291aa2c0 | |||
415e75716a | |||
3216abee2e | |||
327ad02a28 | |||
1df0c9e1b0 | |||
280dadaaad | |||
c30eff898a | |||
ca129ba549 | |||
171ae154c2 | |||
4426c0f14e | |||
901436e46f | |||
6fbc2b3be0 | |||
93d23ddcc8 | |||
548a809a05 | |||
a161b4ab6d | |||
60b91656cd | |||
1858d99559 | |||
3a8665409d | |||
005a78bd83 | |||
7553ce9dfe | |||
42bfe4477f | |||
3bdbb18c8b | |||
13f8648a00 | |||
b6abcb2500 | |||
f1a9e1e361 | |||
54480f7dfc | |||
951bd33b09 | |||
bf57df3e04 | |||
420852e2f5 | |||
04eb80cc2b | |||
308fc8e328 | |||
9bb2939d68 | |||
2f63899be2 | |||
22c66f0e02 | |||
00bc80bb37 | |||
394d951883 | |||
98b26381f6 | |||
31797d3b50 | |||
957be960d2 | |||
18e9d86a3b | |||
a869aeecd2 | |||
eca822b756 | |||
17142a778a | |||
5adb7c9669 | |||
703fcda590 | |||
f16a7cd7e3 | |||
fde5f2fa14 | |||
d56724659f | |||
56b18ff063 | |||
7bfeac746e | |||
c92efc15fb | |||
b51d57deb8 | |||
c357b40dca | |||
a0ae120093 | |||
d3211a2468 | |||
adab4f3e49 | |||
82fed62af2 | |||
bde57016c6 | |||
b16f4bce98 | |||
6bed189e37 | |||
4abacb58f1 | |||
04200150d5 | |||
fc0b1d5b61 | |||
8d45fefc31 | |||
5da96c75a2 | |||
90d1423fb4 | |||
910735d732 | |||
fc86352adf | |||
441e01c568 | |||
14380ff086 | |||
820bb7bd8c | |||
230b98d4dd | |||
065ea926c0 | |||
9b9820858e | |||
b922743f6e | |||
04ab9f1917 | |||
25cbc98979 | |||
3861ba2929 | |||
3bcf0cf472 | |||
396c2417d9 | |||
fcfb1544e8 | |||
56774dfb79 | |||
c0cc6eeca1 | |||
6f2939da62 | |||
7d1abd9adb | |||
81173b0d29 | |||
b0c7ea8181 | |||
30ecb6e88a | |||
8d735da5d8 | |||
5a9ed2de27 | |||
41f57affb6 | |||
c569b75249 | |||
01e4aa5427 | |||
ad130d62d8 | |||
621f87b2bd | |||
64b36190de | |||
507290d30d | |||
15a8429b96 | |||
9723a362b6 | |||
d75a9fabdc | |||
9b264c5c78 | |||
60bdcd6f5f | |||
d035175cdb | |||
f42d317d2f | |||
405ccc7195 | |||
836c889baa | |||
43f9d917d9 | |||
62c7b7842b | |||
97969a85cd | |||
91fcfcb042 | |||
88c46feb20 | |||
c3f07b329f | |||
6121083ba5 | |||
717c68089d | |||
09b4244baf | |||
2e45267705 | |||
e81d1fc361 | |||
02394d2d80 | |||
653a211743 | |||
522ec9a25b | |||
0fdb7f7181 | |||
443ff33f63 | |||
6b7cead0c5 | |||
94a925a1b0 | |||
055b802713 | |||
41fec319c8 | |||
a22121d65d | |||
3acf9c7063 | |||
566606ef46 | |||
afa2bb246b | |||
dc038113a5 | |||
ad7e781a18 | |||
437e803f27 | |||
dbe6cdad7e | |||
46992b4bda | |||
d0af45c31a | |||
8b571309ed | |||
b0befd7376 | |||
dfa0973563 | |||
ac50bd678e | |||
9130505b57 | |||
931cf78057 | |||
6ade68cff1 | |||
d30ce19231 | |||
d7eac7ee56 | |||
d53b96f2a2 | |||
79deeacbd7 | |||
32ca6851af | |||
cff8c05442 | |||
0ea5f8b5ed | |||
555b1cdf29 | |||
0b0d25fa33 | |||
963a4d0dc8 | |||
f393d86c96 | |||
6651541230 | |||
43c5b638b9 | |||
c3a52697f5 | |||
c4704c8abc | |||
b1ca5d4ddf | |||
9fecd72f44 | |||
f4480d46b4 | |||
8e5b582b61 | |||
0cc87c5ba1 | |||
6aa7cc1d96 | |||
a8920eb774 | |||
fdfa31798b | |||
b67d574a95 | |||
1c77cdadaf | |||
f12e15e682 | |||
d5c9c5f183 | |||
f83989bb0d | |||
81167d9c4a | |||
0b06ea177a | |||
03227e65cf | |||
ca7f2f8c8f | |||
340d94afb9 | |||
9ef8d8b85a | |||
ab8ee4d0d9 | |||
d1a00459a8 | |||
9fe6363575 | |||
142a2b7341 | |||
6586265a0c | |||
d3fd088162 | |||
4b3f82a47e | |||
1279d75f7f | |||
81e9bdc010 | |||
6fa0929f3f | |||
f10f8db5fb | |||
b804d4bde5 | |||
01f711281c | |||
5b5108363d | |||
c80e02b881 | |||
fbc9537952 | |||
f580ffab4f | |||
696af79dc7 | |||
0833b59aab | |||
caa51950e8 | |||
f3f4c3d835 | |||
9ae3742565 | |||
0f432994b8 | |||
d4d9009696 | |||
7c5ecb5b5c | |||
1058b2a778 | |||
c4129137e7 | |||
e3a4ecef35 | |||
9783c92935 | |||
7cecaf2a4f | |||
eef7d8aa11 | |||
617b3d2ba5 | |||
546eb7d851 | |||
29dbc3b67c | |||
4e6aa9c2db | |||
745b59f49c | |||
b0868915ae | |||
0038712474 | |||
db74f44a97 | |||
30d5a2ca83 | |||
6d3487f1c1 | |||
d442b6855f | |||
7c1d3e0f5a | |||
2f6ae527d1 | |||
ec2be5dccb | |||
14e8e88022 | |||
6a9ce67714 | |||
bed8ac70f7 | |||
a9d32a3f89 | |||
ff5b050a92 | |||
b3db3f80ba | |||
2b84b86fc0 | |||
3aa3d5c548 | |||
2d2300e118 | |||
f24ea59f74 | |||
c1b029a413 | |||
82e49230ff | |||
f7199aa8c8 | |||
0e00265647 | |||
5406a49f06 | |||
8dbe2af0bc | |||
334caf8e7c | |||
8d8995f1ab | |||
48c6ece2be | |||
f7c7038171 | |||
627f04883a | |||
a7798f2a93 | |||
b21a1d1961 | |||
8a0e45826a | |||
dfb8d21ef4 | |||
a75040d0a1 | |||
86ffacf7ce | |||
b54368bf35 | |||
e889c68aff | |||
2e1fec17f5 | |||
f9b0863c8a | |||
f57b7df4d7 | |||
2cf52c1b55 | |||
27c6638913 | |||
3f100eb23a | |||
ffceae0a01 | |||
7a965dc58f | |||
bb1665cbd8 | |||
1dacae2c3c | |||
e31a76ce24 | |||
3799f43c71 | |||
a8a9660112 | |||
13613d4acb | |||
9ad4b3bd31 | |||
e224e3d62d | |||
476790290e | |||
68078fd620 | |||
620407720c | |||
adb0b761f1 | |||
97e02c2fa0 | |||
4ae546be1f | |||
0f5c70d563 | |||
f48b343af1 | |||
213baa37b0 | |||
8959d7d3a7 | |||
516759b1ff | |||
aaf826e043 | |||
c6adddf02e | |||
11b5d1b286 | |||
12f77ca523 | |||
9bbf009dff | |||
344a5ca545 | |||
6e1896b333 | |||
cfd9ca0d6f | |||
f96142cd7c | |||
4c73b52d5c | |||
48cd503d4a | |||
ba20e3bed0 | |||
6f7aa466ae | |||
e6c612f5cd | |||
4530654501 | |||
28a80e6e05 | |||
abceaa2f33 | |||
f2bad195bc | |||
1a647c399b | |||
c76da27240 | |||
04997c8418 | |||
45747ed531 | |||
62602b9bd8 | |||
b826e0c636 | |||
4586fccae4 | |||
9e847198f5 | |||
2c4107c531 | |||
34fdb91899 | |||
473a577e34 | |||
b14c2d1568 | |||
549f2254b4 | |||
17eaef0311 | |||
bc0750eb93 | |||
381e680758 | |||
988b9f8378 | |||
a5ee653da0 | |||
580372f23d | |||
5751865228 | |||
23f2bea353 | |||
79c7fe05c6 | |||
15e8d50313 | |||
6665d76fbb | |||
ad7251c8bb | |||
8f95b751e0 | |||
edd5f5a333 | |||
9d2236a4b5 | |||
e17128e7cb | |||
b6b18c1d7f | |||
2373186239 | |||
b6431c60e6 | |||
0c44e733ad | |||
996c7c2dde | |||
554fe65690 | |||
4695c69cf1 | |||
42c69d3ba6 | |||
0fb2ba577e | |||
9b571a1deb | |||
1aa8401ddf | |||
bf94f878bc | |||
c8f742e288 | |||
97cc6caa33 | |||
831613aab5 | |||
9ab9437319 | |||
867ab11def | |||
5cd0d6ab25 | |||
a2b50ec8c9 | |||
77d24afea3 | |||
39386eadea | |||
ca5aebaa6b | |||
112e777b90 | |||
a176cd646c | |||
07153f7e7f | |||
bd928f3dcc | |||
e78402dd4c | |||
626555c013 | |||
a9ef858359 | |||
8f7915022c | |||
4a0466e574 | |||
917d0870e8 | |||
290b0b48a9 | |||
a69172f6ce | |||
b1055a5edb | |||
5ef6e6366f | |||
b6833d1bbd | |||
865b48d78b | |||
818f6dbe9e | |||
c056b8c7f1 | |||
3c480e4e63 | |||
29762f1b6a | |||
d2707f1457 | |||
8dfc3c386a | |||
15945c8791 | |||
66f0ab0371 | |||
dce36751f5 | |||
1a9d382da9 | |||
b56dd32454 | |||
6ac75a0674 | |||
ab838920a1 | |||
71b58769af | |||
a95e03ae85 | |||
7d8036a2e3 | |||
66a5dab85a | |||
d52f42688a | |||
ed1175f27e | |||
35bc1eb218 | |||
dc7de0896c | |||
5d70c6e34f | |||
53be85a7fb | |||
fa6b802be4 | |||
54c1784da7 | |||
7f4f20b249 | |||
6ab4966d44 | |||
068feccc37 | |||
77a8492405 | |||
3c4eef8a86 | |||
36d37cc6ae | |||
185a941acc | |||
6af2396cf7 | |||
d1afadbd22 | |||
450a13dea0 | |||
22c409029c | |||
590b8052fe | |||
fef3d2ad53 | |||
56238fe94e | |||
fcadeb2079 | |||
fd701b07f0 | |||
ee04217d53 | |||
a1293b26ef | |||
667473c32d | |||
fce7ae16f5 | |||
4059a72710 | |||
f1e526f046 | |||
83e5deb988 | |||
56b751ead5 | |||
1706382f4c | |||
93d73fd6c2 | |||
c679a6fb7b | |||
39cd56038f | |||
f544128138 | |||
57abe8d078 | |||
cf7d47dda0 | |||
0e64261f26 | |||
c7e1bda32f | |||
3a6d270bb8 | |||
c2136d18bd | |||
9f5996f1ab | |||
ba04de6508 | |||
1953e2af7a | |||
06d01b2287 | |||
c685cc2f0a | |||
2f2d5f35bd | |||
30d53a8942 | |||
043f104738 | |||
4ec5e282d9 | |||
4fa6ae82ee | |||
e03559867b | |||
60935b29fc | |||
452a7ae88b | |||
1b1d5f10a1 | |||
65e26d713c | |||
fdd5010832 | |||
946e5bda22 | |||
24faaf44cb | |||
90bd984ff7 | |||
48789360b1 | |||
4c5aac8cd5 | |||
535c7bb60c | |||
6970396c01 | |||
832876d0a1 | |||
4c45347635 | |||
72c7b6edea | |||
1ef558b57c | |||
506d2e98a4 | |||
8c858d76dd | |||
f83b819bea | |||
0262e37301 | |||
2fbc92fd2e | |||
c1a4621c8f | |||
d1764fc3dd | |||
2e714f9f2a | |||
6815e4fceb | |||
655b495e8e | |||
92dbaf397b | |||
f0c681a6de | |||
1b9b34ed46 | |||
3d2ee6c3fe | |||
1c2f3d47e9 | |||
f692655ec5 | |||
3db84c8220 |
18
.bazelrc
18
.bazelrc
@ -1,6 +1,18 @@
|
|||||||
# Disable sandboxing because it's too slow.
|
# Make compilation fast, by keeping a few copies of the compilers
|
||||||
# https://github.com/bazelbuild/bazel/issues/2424
|
# running as daemons, and cache SourceFile AST's to reduce parse time.
|
||||||
build --spawn_strategy=standalone
|
build --strategy=TypeScriptCompile=worker
|
||||||
|
build --strategy=AngularTemplateCompile=worker
|
||||||
|
|
||||||
|
# Don't create bazel-* symlinks in the WORKSPACE directory.
|
||||||
|
# These require .gitignore and may scare users.
|
||||||
|
# Also, it's a workaround for https://github.com/bazelbuild/rules_typescript/issues/12
|
||||||
|
# which affects the common case of having `tsconfig.json` in the WORKSPACE directory.
|
||||||
|
#
|
||||||
|
# Instead, you should run `bazel info bazel-bin` to find out where the outputs went.
|
||||||
|
build --symlink_prefix=/
|
||||||
|
|
||||||
# Performance: avoid stat'ing input files
|
# Performance: avoid stat'ing input files
|
||||||
build --watchfs
|
build --watchfs
|
||||||
|
|
||||||
|
# Don't print all the .d.ts output locations after builds
|
||||||
|
build --show_result=0
|
@ -11,7 +11,7 @@
|
|||||||
anchor_1: &job_defaults
|
anchor_1: &job_defaults
|
||||||
working_directory: ~/ng
|
working_directory: ~/ng
|
||||||
docker:
|
docker:
|
||||||
- image: angular/ngcontainer
|
- image: angular/ngcontainer:0.0.2
|
||||||
|
|
||||||
# After checkout, rebase on top of master.
|
# After checkout, rebase on top of master.
|
||||||
# Similar to travis behavior, but not quite the same.
|
# Similar to travis behavior, but not quite the same.
|
||||||
@ -27,10 +27,9 @@ jobs:
|
|||||||
- checkout:
|
- checkout:
|
||||||
<<: *post_checkout
|
<<: *post_checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: angular-{{ .Branch }}-{{ checksum "npm-shrinkwrap.json" }}
|
key: angular-{{ .Branch }}-{{ checksum "yarn.lock" }}
|
||||||
|
|
||||||
- run: npm install
|
- run: yarn install --frozen-lockfile --non-interactive
|
||||||
- run: npm run postinstall
|
|
||||||
- run: ./node_modules/.bin/gulp lint
|
- run: ./node_modules/.bin/gulp lint
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@ -39,12 +38,13 @@ jobs:
|
|||||||
- checkout:
|
- checkout:
|
||||||
<<: *post_checkout
|
<<: *post_checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: angular-{{ .Branch }}-{{ checksum "npm-shrinkwrap.json" }}
|
key: angular-{{ .Branch }}-{{ checksum "yarn.lock" }}
|
||||||
|
|
||||||
- run: bazel run @nodejs//:npm install
|
- run: bazel run @yarn//:yarn
|
||||||
- run: bazel build packages/...
|
- run: bazel build packages/...
|
||||||
|
- run: bazel test @angular//...
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: angular-{{ .Branch }}-{{ checksum "npm-shrinkwrap.json" }}
|
key: angular-{{ .Branch }}-{{ checksum "yarn.lock" }}
|
||||||
paths:
|
paths:
|
||||||
- "node_modules"
|
- "node_modules"
|
||||||
|
|
||||||
|
@ -7,9 +7,12 @@
|
|||||||
#
|
#
|
||||||
# alexeagle - Alex Eagle
|
# alexeagle - Alex Eagle
|
||||||
# alxhub - Alex Rickabaugh
|
# alxhub - Alex Rickabaugh
|
||||||
|
# brocco - Mike Brocchi
|
||||||
# chuckjaz - Chuck Jazdzewski
|
# chuckjaz - Chuck Jazdzewski
|
||||||
|
# filipesilva - Filipe Silva
|
||||||
# Foxandxss - Jesús Rodríguez
|
# Foxandxss - Jesús Rodríguez
|
||||||
# gkalpak - George Kalpakas
|
# gkalpak - George Kalpakas
|
||||||
|
# hansl - Hans Larsen
|
||||||
# IgorMinar - Igor Minar
|
# IgorMinar - Igor Minar
|
||||||
# jasonaden - Jason Aden
|
# jasonaden - Jason Aden
|
||||||
# juleskremer - Jules Kremer
|
# juleskremer - Jules Kremer
|
||||||
@ -60,6 +63,19 @@ groups:
|
|||||||
- IgorMinar
|
- IgorMinar
|
||||||
- mhevery
|
- mhevery
|
||||||
|
|
||||||
|
bazel:
|
||||||
|
conditions:
|
||||||
|
files:
|
||||||
|
include:
|
||||||
|
- "WORKSPACE"
|
||||||
|
- "*.bazel"
|
||||||
|
- "*.bzl"
|
||||||
|
- "packages/bazel/*"
|
||||||
|
users:
|
||||||
|
- alexeagle #primary
|
||||||
|
- chuckjaz
|
||||||
|
- vikerman #fallback
|
||||||
|
|
||||||
build-and-ci:
|
build-and-ci:
|
||||||
conditions:
|
conditions:
|
||||||
files:
|
files:
|
||||||
@ -88,7 +104,6 @@ groups:
|
|||||||
- vicb
|
- vicb
|
||||||
- IgorMinar #fallback
|
- IgorMinar #fallback
|
||||||
|
|
||||||
|
|
||||||
core:
|
core:
|
||||||
conditions:
|
conditions:
|
||||||
files:
|
files:
|
||||||
@ -103,7 +118,7 @@ groups:
|
|||||||
animations:
|
animations:
|
||||||
conditions:
|
conditions:
|
||||||
files:
|
files:
|
||||||
- "packages/animation/*"
|
- "packages/animations/*"
|
||||||
- "packages/platform-browser/animations/*"
|
- "packages/platform-browser/animations/*"
|
||||||
users:
|
users:
|
||||||
- matsko #primary
|
- matsko #primary
|
||||||
@ -132,12 +147,23 @@ groups:
|
|||||||
- mhevery
|
- mhevery
|
||||||
- IgorMinar #fallback
|
- IgorMinar #fallback
|
||||||
|
|
||||||
|
compiler-cli/ngtools:
|
||||||
|
conditions:
|
||||||
|
files:
|
||||||
|
- "packages/compiler-cli/src/ngtools*"
|
||||||
|
users:
|
||||||
|
- hansl
|
||||||
|
- filipesilva #fallback
|
||||||
|
- brocco #fallback
|
||||||
|
|
||||||
compiler-cli:
|
compiler-cli:
|
||||||
conditions:
|
conditions:
|
||||||
files:
|
files:
|
||||||
- "packages/tsc-wrapped/*"
|
include:
|
||||||
- "packages/compiler-cli/*"
|
- "packages/compiler-cli/*"
|
||||||
- "packages/bazel/*"
|
- "packages/bazel/*"
|
||||||
|
exclude:
|
||||||
|
- "packages/compiler-cli/src/ngtools*"
|
||||||
users:
|
users:
|
||||||
- alexeagle
|
- alexeagle
|
||||||
- chuckjaz
|
- chuckjaz
|
||||||
@ -149,7 +175,10 @@ groups:
|
|||||||
common:
|
common:
|
||||||
conditions:
|
conditions:
|
||||||
files:
|
files:
|
||||||
- "packages/common/*"
|
include:
|
||||||
|
- "packages/common/*"
|
||||||
|
exclude:
|
||||||
|
- "packages/common/http/*"
|
||||||
users:
|
users:
|
||||||
- pkozlowski-opensource #primary
|
- pkozlowski-opensource #primary
|
||||||
- vicb
|
- vicb
|
||||||
@ -169,6 +198,7 @@ groups:
|
|||||||
http:
|
http:
|
||||||
conditions:
|
conditions:
|
||||||
files:
|
files:
|
||||||
|
- "packages/common/http/*"
|
||||||
- "packages/http/*"
|
- "packages/http/*"
|
||||||
users:
|
users:
|
||||||
- vikerman #primary
|
- vikerman #primary
|
||||||
@ -239,7 +269,15 @@ groups:
|
|||||||
- IgorMinar #fallback
|
- IgorMinar #fallback
|
||||||
- mhevery #fallback
|
- mhevery #fallback
|
||||||
|
|
||||||
|
service-worker:
|
||||||
|
conditions:
|
||||||
|
files:
|
||||||
|
- "packages/service-worker/*"
|
||||||
|
users:
|
||||||
|
- alxhub #primary
|
||||||
|
- gkalpak
|
||||||
|
- IgorMinar #fallback
|
||||||
|
- mhevery #fallback
|
||||||
|
|
||||||
benchpress:
|
benchpress:
|
||||||
conditions:
|
conditions:
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
sudo: false
|
sudo: false
|
||||||
# force trusty as Google Chrome addon is not supported on Precise
|
|
||||||
dist: trusty
|
dist: trusty
|
||||||
node_js:
|
node_js:
|
||||||
- '6.9.5'
|
- '6.9.5'
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
chrome: stable
|
|
||||||
# firefox: "38.0"
|
# firefox: "38.0"
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
@ -50,11 +48,13 @@ env:
|
|||||||
- CI_MODE=e2e_2
|
- CI_MODE=e2e_2
|
||||||
- CI_MODE=js
|
- CI_MODE=js
|
||||||
- CI_MODE=saucelabs_required
|
- CI_MODE=saucelabs_required
|
||||||
- CI_MODE=browserstack_required
|
# deactivated, see #19768
|
||||||
|
# - CI_MODE=browserstack_required
|
||||||
- CI_MODE=saucelabs_optional
|
- CI_MODE=saucelabs_optional
|
||||||
- CI_MODE=browserstack_optional
|
- CI_MODE=browserstack_optional
|
||||||
- CI_MODE=aio_tools_test
|
- CI_MODE=aio_tools_test
|
||||||
- CI_MODE=aio
|
- CI_MODE=aio
|
||||||
|
- CI_MODE=aio_optional
|
||||||
- CI_MODE=aio_e2e AIO_SHARD=0
|
- CI_MODE=aio_e2e AIO_SHARD=0
|
||||||
- CI_MODE=aio_e2e AIO_SHARD=1
|
- CI_MODE=aio_e2e AIO_SHARD=1
|
||||||
- CI_MODE=bazel
|
- CI_MODE=bazel
|
||||||
@ -64,6 +64,7 @@ matrix:
|
|||||||
allow_failures:
|
allow_failures:
|
||||||
- env: "CI_MODE=saucelabs_optional"
|
- env: "CI_MODE=saucelabs_optional"
|
||||||
- env: "CI_MODE=browserstack_optional"
|
- env: "CI_MODE=browserstack_optional"
|
||||||
|
- env: "CI_MODE=aio_optional"
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
# source the env.sh script so that the exported variables are available to other scripts later on
|
# source the env.sh script so that the exported variables are available to other scripts later on
|
||||||
|
38
BUILD.bazel
38
BUILD.bazel
@ -6,20 +6,26 @@ exports_files(["tsconfig.json"])
|
|||||||
# https://github.com/bazelbuild/bazel/issues/374#issuecomment-296217940
|
# https://github.com/bazelbuild/bazel/issues/374#issuecomment-296217940
|
||||||
filegroup(
|
filegroup(
|
||||||
name = "node_modules",
|
name = "node_modules",
|
||||||
srcs = glob([
|
# Performance workaround: list individual files
|
||||||
# Performance workaround: list individual files
|
# Reduces the number of files as inputs to nodejs_binary:
|
||||||
# This won't scale in the general case.
|
# bazel query "deps(:node_modules)" | wc -l
|
||||||
# TODO(alexeagle): figure out what to do
|
# This won't scale in the general case.
|
||||||
"node_modules/typescript/**",
|
# TODO(alexeagle): figure out what to do
|
||||||
"node_modules/zone.js/**",
|
srcs = glob(["/".join(["node_modules", pkg, "**", ext]) for pkg in [
|
||||||
"node_modules/rxjs/**/*.d.ts",
|
"jasmine",
|
||||||
"node_modules/rxjs/**/*.js",
|
"typescript",
|
||||||
"node_modules/@types/**/*.d.ts",
|
"zone.js",
|
||||||
"node_modules/tsickle/**",
|
"rxjs",
|
||||||
"node_modules/hammerjs/**/*.d.ts",
|
"@types",
|
||||||
"node_modules/protobufjs/**",
|
"tsickle",
|
||||||
"node_modules/bytebuffer/**",
|
"hammerjs",
|
||||||
"node_modules/reflect-metadata/**",
|
"protobufjs",
|
||||||
"node_modules/minimist/**/*.js",
|
"bytebuffer",
|
||||||
]),
|
"reflect-metadata",
|
||||||
|
"minimist",
|
||||||
|
] for ext in [
|
||||||
|
"*.js",
|
||||||
|
"*.json",
|
||||||
|
"*.d.ts",
|
||||||
|
]]),
|
||||||
)
|
)
|
||||||
|
443
CHANGELOG.md
443
CHANGELOG.md
@ -1,96 +1,106 @@
|
|||||||
<a name="5.0.0-beta.4"></a>
|
<a name="5.1.0-beta.0"></a>
|
||||||
# [5.0.0-beta.4](https://github.com/angular/angular/compare/5.0.0-beta.3...5.0.0-beta.4) (2017-08-16)
|
# [5.1.0-beta.0](https://github.com/angular/angular/compare/5.0.0-rc.4...5.1.0-beta.0) (2017-11-08)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **compiler:** don't overwrite missingTranslation's value in JIT ([#19952](https://github.com/angular/angular/issues/19952)) ([799cbb9](https://github.com/angular/angular/commit/799cbb9))
|
||||||
|
* **compiler:** report a reasonable error with invalid metadata ([#20062](https://github.com/angular/angular/issues/20062)) ([da22c48](https://github.com/angular/angular/commit/da22c48))
|
||||||
|
* **compiler-cli:** don't report emit diagnostics when `--noEmitOnError` is off ([#20063](https://github.com/angular/angular/issues/20063)) ([8639995](https://github.com/angular/angular/commit/8639995))
|
||||||
|
* **core:** `__symbol__` should return `__zone_symbol__` without zone.js loaded ([#19541](https://github.com/angular/angular/issues/19541)) ([678d1cf](https://github.com/angular/angular/commit/678d1cf))
|
||||||
|
* **core:** should support event.stopImmediatePropagation ([#19222](https://github.com/angular/angular/issues/19222)) ([7083791](https://github.com/angular/angular/commit/7083791))
|
||||||
|
* **platform-browser:** support Symbols in custom `jasmineToString()` method ([#19794](https://github.com/angular/angular/issues/19794)) ([5a6efa7](https://github.com/angular/angular/commit/5a6efa7))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **compiler:** introduce `TestBed.overrideTemplateUsingTestingModule` ([a460066](https://github.com/angular/angular/commit/a460066)), closes [#19815](https://github.com/angular/angular/issues/19815)
|
||||||
|
|
||||||
|
### Reverts
|
||||||
|
|
||||||
|
* feat(elements): implement `[@angular](https://github.com/angular)/elements` [#19469](https://github.com/angular/angular/issues/19469) ([#20152](https://github.com/angular/angular/issues/20152)) ([3997d97](https://github.com/angular/angular/commit/3997d97))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="5.0.1"></a>
|
||||||
|
## [5.0.1](https://github.com/angular/angular/compare/5.0.0...5.0.1) (2017-11-08)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **aio:** fix compilation error by using the correct type for `providers` ([4d523fd](https://github.com/angular/angular/commit/4d523fd))
|
* **compiler:** don't overwrite missingTranslation's value in JIT ([#19952](https://github.com/angular/angular/issues/19952)) ([799cbb9](https://github.com/angular/angular/commit/799cbb9))
|
||||||
* **aio:** skip PWA test when redeploying non-public commit ([06faac8](https://github.com/angular/angular/commit/06faac8))
|
* **compiler:** report a reasonable error with invalid metadata ([#20062](https://github.com/angular/angular/issues/20062)) ([da22c48](https://github.com/angular/angular/commit/da22c48))
|
||||||
* **compiler:** Don't strip CSS source maps ([64b4be9](https://github.com/angular/angular/commit/64b4be9))
|
* **compiler-cli:** don't report emit diagnostics when `--noEmitOnError` is off ([#20063](https://github.com/angular/angular/issues/20063)) ([8639995](https://github.com/angular/angular/commit/8639995))
|
||||||
* **forms:** re-assigning options should not clear select ([32ff21c](https://github.com/angular/angular/commit/32ff21c)), closes [#18330](https://github.com/angular/angular/issues/18330)
|
* **core:** `__symbol__` should return `__zone_symbol__` without zone.js loaded ([#19541](https://github.com/angular/angular/issues/19541)) ([678d1cf](https://github.com/angular/angular/commit/678d1cf))
|
||||||
* **language-service:** remove tsickle dependency ([bc22ff1](https://github.com/angular/angular/commit/bc22ff1))
|
* **core:** should support event.stopImmediatePropagation ([#19222](https://github.com/angular/angular/issues/19222)) ([7083791](https://github.com/angular/angular/commit/7083791))
|
||||||
|
* **platform-browser:** support Symbols in custom `jasmineToString()` method ([#19794](https://github.com/angular/angular/issues/19794)) ([5a6efa7](https://github.com/angular/angular/commit/5a6efa7))
|
||||||
|
|
||||||
|
|
||||||
|
<a name="5.0.0"></a>
|
||||||
|
# [5.0.0](https://github.com/angular/angular/compare/5.0.0-rc.9...5.0.0) pentagonal-donut (2017-11-01)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
|
* **animations:** allow @.disabled property to work without an expression ([#18713](https://github.com/angular/angular/issues/18713)) ([2159342](https://github.com/angular/angular/commit/2159342))
|
||||||
|
* **animations:** report errors when invalid CSS properties are detected ([#18718](https://github.com/angular/angular/issues/18718)) ([409688f](https://github.com/angular/angular/commit/409688f)), closes [#18701](https://github.com/angular/angular/issues/18701)
|
||||||
|
* **animations:** support :increment and :decrement transition aliases ([6f45519](https://github.com/angular/angular/commit/6f45519))
|
||||||
|
* **animations:** support negative query limit values ([86ffacf](https://github.com/angular/angular/commit/86ffacf)), closes [#19259](https://github.com/angular/angular/issues/19259)
|
||||||
|
* **common:** accept object map for HttpClient headers & params ([#18490](https://github.com/angular/angular/issues/18490)) ([1b1d5f1](https://github.com/angular/angular/commit/1b1d5f1))
|
||||||
|
* **common:** drop use of the Intl API to improve browser support ([#18284](https://github.com/angular/angular/issues/18284)) ([079d884](https://github.com/angular/angular/commit/079d884)), closes [#10809](https://github.com/angular/angular/issues/10809) [#9524](https://github.com/angular/angular/issues/9524) [#7008](https://github.com/angular/angular/issues/7008) [#9324](https://github.com/angular/angular/issues/9324) [#7590](https://github.com/angular/angular/issues/7590) [#6724](https://github.com/angular/angular/issues/6724) [#3429](https://github.com/angular/angular/issues/3429) [#17576](https://github.com/angular/angular/issues/17576) [#17478](https://github.com/angular/angular/issues/17478) [#17319](https://github.com/angular/angular/issues/17319) [#17200](https://github.com/angular/angular/issues/17200) [#16838](https://github.com/angular/angular/issues/16838) [#16624](https://github.com/angular/angular/issues/16624) [#16625](https://github.com/angular/angular/issues/16625) [#16591](https://github.com/angular/angular/issues/16591) [#14131](https://github.com/angular/angular/issues/14131) [#12632](https://github.com/angular/angular/issues/12632) [#11376](https://github.com/angular/angular/issues/11376) [#11187](https://github.com/angular/angular/issues/11187)
|
||||||
|
* **common:** generate `closure-locale.ts` to tree shake locale data ([#18907](https://github.com/angular/angular/issues/18907)) ([4878936](https://github.com/angular/angular/commit/4878936))
|
||||||
* **common:** mark NgTemplateOutlet API as stable ([0a73e8d](https://github.com/angular/angular/commit/0a73e8d))
|
* **common:** mark NgTemplateOutlet API as stable ([0a73e8d](https://github.com/angular/angular/commit/0a73e8d))
|
||||||
* **forms:** add status to `AbstractControlDirective` ([233ef93](https://github.com/angular/angular/commit/233ef93))
|
* **compiler-cli:** add watch mode to `ngc` ([#18818](https://github.com/angular/angular/issues/18818)) ([06d01b2](https://github.com/angular/angular/commit/06d01b2))
|
||||||
* **forms:** add updateOn support to ngModelOptions ([1cfa79c](https://github.com/angular/angular/commit/1cfa79c))
|
* **compiler-cli:** lower metadata `useValue` and `data` literal fields ([#18905](https://github.com/angular/angular/issues/18905)) ([0e64261](https://github.com/angular/angular/commit/0e64261))
|
||||||
|
* **compiler:** add representation of placeholders to xliff & xmb ([b3085e9](https://github.com/angular/angular/commit/b3085e9)), closes [#17345](https://github.com/angular/angular/issues/17345)
|
||||||
|
* **compiler:** allow multiple exportAs names ([#18723](https://github.com/angular/angular/issues/18723)) ([7ec28fe](https://github.com/angular/angular/commit/7ec28fe))
|
||||||
### Performance Improvements
|
* **compiler:** enabled strict checking of parameters to an `@Injectable` ([#19412](https://github.com/angular/angular/issues/19412)) ([dfb8d21](https://github.com/angular/angular/commit/dfb8d21))
|
||||||
|
* **compiler:** make `.ngsummary.json` files portable ([2572bf5](https://github.com/angular/angular/commit/2572bf5))
|
||||||
* **aio:** update to new version of build-optimizer ([088532b](https://github.com/angular/angular/commit/088532b))
|
* **compiler:** reuse the TypeScript typecheck for template typechecking. ([#19152](https://github.com/angular/angular/issues/19152)) ([996c7c2](https://github.com/angular/angular/commit/996c7c2))
|
||||||
* **core:** add option to remove blank text nodes from compiled templates ([d2c0d98](https://github.com/angular/angular/commit/d2c0d98))
|
* **compiler:** set `enableLegacyTemplate` to false by default ([#18756](https://github.com/angular/angular/issues/18756)) ([56238fe](https://github.com/angular/angular/commit/56238fe))
|
||||||
* **core:** Remove decorator DSL which depends on Reflect ([cac130e](https://github.com/angular/angular/commit/cac130e))
|
* **compiler:** use typescript for resolving resource paths ([43226cb](https://github.com/angular/angular/commit/43226cb))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.3.5"></a>
|
|
||||||
## [4.3.5](https://github.com/angular/angular/compare/4.3.4...4.3.5) (2017-08-16)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **aio:** skip PWA test when redeploying non-public commit ([b9c1c91](https://github.com/angular/angular/commit/b9c1c91))
|
|
||||||
* **core:** forbid destroyed views to be inserted or moved in VC ([972538b](https://github.com/angular/angular/commit/972538b)), closes [#18615](https://github.com/angular/angular/issues/18615)
|
|
||||||
* **forms:** re-assigning options should not clear select ([a1624f2](https://github.com/angular/angular/commit/a1624f2)), closes [#18330](https://github.com/angular/angular/issues/18330)
|
|
||||||
|
|
||||||
|
|
||||||
### Performance Improvements
|
|
||||||
|
|
||||||
* **aio:** update to new version of build-optimizer ([d7be4f1](https://github.com/angular/angular/commit/d7be4f1))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.3.4"></a>
|
|
||||||
## [4.3.4](https://github.com/angular/angular/compare/4.3.3...4.3.4) (2017-08-10)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **animations:** revert container/queried animations accordingly during cancel ([#18516](https://github.com/angular/angular/issues/18516)) ([5a165eb](https://github.com/angular/angular/commit/5a165eb))
|
|
||||||
* **animations:** support persisting dynamic styles within animation states ([#18468](https://github.com/angular/angular/issues/18468)) ([e0660b1](https://github.com/angular/angular/commit/e0660b1)), closes [#18423](https://github.com/angular/angular/issues/18423) [#17505](https://github.com/angular/angular/issues/17505)
|
|
||||||
* **benchpress:** compile cleanly with TS 2.4 ([#18455](https://github.com/angular/angular/issues/18455)) ([5afc7ab](https://github.com/angular/angular/commit/5afc7ab))
|
|
||||||
* **compiler:** cleanly compile with TypeScript 2.4 ([#18456](https://github.com/angular/angular/issues/18456)) ([5e4054b](https://github.com/angular/angular/commit/5e4054b))
|
|
||||||
* **compiler:** ignore [@import](https://github.com/import) in multi-line css ([#18452](https://github.com/angular/angular/issues/18452)) ([e7e7622](https://github.com/angular/angular/commit/e7e7622)), closes [#18038](https://github.com/angular/angular/issues/18038)
|
|
||||||
|
|
||||||
|
|
||||||
<a name="5.0.0-beta.3"></a>
|
|
||||||
# [5.0.0-beta.3](https://github.com/angular/angular/compare/5.0.0-beta.2...5.0.0-beta.3) (2017-08-09)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **animations:** revert container/queried animations accordingly during cancel ([#18516](https://github.com/angular/angular/issues/18516)) ([c0c03dc](https://github.com/angular/angular/commit/c0c03dc))
|
|
||||||
* **animations:** support persisting dynamic styles within animation states ([#18468](https://github.com/angular/angular/issues/18468)) ([05472cb](https://github.com/angular/angular/commit/05472cb)), closes [#18423](https://github.com/angular/angular/issues/18423) [#17505](https://github.com/angular/angular/issues/17505)
|
|
||||||
* **benchpress:** compile cleanly with TS 2.4 ([#18455](https://github.com/angular/angular/issues/18455)) ([e25b3dd](https://github.com/angular/angular/commit/e25b3dd))
|
|
||||||
* **common:** don't recreate view when context shape doesn't change ([#18277](https://github.com/angular/angular/issues/18277)) ([685cc26](https://github.com/angular/angular/commit/685cc26)), closes [#13407](https://github.com/angular/angular/issues/13407)
|
|
||||||
* **compiler:** cleanly compile with TypeScript 2.4 ([#18456](https://github.com/angular/angular/issues/18456)) ([7c47b62](https://github.com/angular/angular/commit/7c47b62))
|
|
||||||
* **compiler:** ignore [@import](https://github.com/import) in multi-line css ([#18452](https://github.com/angular/angular/issues/18452)) ([1dca575](https://github.com/angular/angular/commit/1dca575)), closes [#18038](https://github.com/angular/angular/issues/18038)
|
|
||||||
* **compiler-cli:** disable buggy expression lowering ([#18513](https://github.com/angular/angular/issues/18513)) ([ca695e0](https://github.com/angular/angular/commit/ca695e0))
|
|
||||||
* **compiler-cli:** fix and re-enable expression lowering ([#18570](https://github.com/angular/angular/issues/18570)) ([6f2038c](https://github.com/angular/angular/commit/6f2038c)), closes [#18388](https://github.com/angular/angular/issues/18388)
|
|
||||||
* **compiler-cli:** modified ngc to throw all errors, not just syntax ([#18388](https://github.com/angular/angular/issues/18388)) ([5651e4a](https://github.com/angular/angular/commit/5651e4a))
|
|
||||||
* **compiler-cli:** remove minimist dependency of compiler-cli/index ([#18532](https://github.com/angular/angular/issues/18532)) ([5b7432b](https://github.com/angular/angular/commit/5b7432b))
|
|
||||||
* **core:** fix platform-browser-dynamic ([#18576](https://github.com/angular/angular/issues/18576)) ([f0a5501](https://github.com/angular/angular/commit/f0a5501))
|
|
||||||
* **core:** forbid destroyed views to be inserted or moved in VC ([#18568](https://github.com/angular/angular/issues/18568)) ([e54bd59](https://github.com/angular/angular/commit/e54bd59)), closes [#17780](https://github.com/angular/angular/issues/17780)
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **core:** Create StaticInjector which does not depend on Reflect polyfill. ([d9d00bd](https://github.com/angular/angular/commit/d9d00bd))
|
* **core:** Create StaticInjector which does not depend on Reflect polyfill. ([d9d00bd](https://github.com/angular/angular/commit/d9d00bd))
|
||||||
|
* **core:** add option to remove blank text nodes from compiled templates ([#18823](https://github.com/angular/angular/issues/18823)) ([b8b551c](https://github.com/angular/angular/commit/b8b551c))
|
||||||
|
* **core:** support for bootstrap with custom zone ([#17672](https://github.com/angular/angular/issues/17672)) ([344a5ca](https://github.com/angular/angular/commit/344a5ca))
|
||||||
* **forms:** add default updateOn values for groups and arrays ([#18536](https://github.com/angular/angular/issues/18536)) ([ff5c58b](https://github.com/angular/angular/commit/ff5c58b))
|
* **forms:** add default updateOn values for groups and arrays ([#18536](https://github.com/angular/angular/issues/18536)) ([ff5c58b](https://github.com/angular/angular/commit/ff5c58b))
|
||||||
|
* **forms:** add options arg to abstract controls ([ebef5e6](https://github.com/angular/angular/commit/ebef5e6))
|
||||||
|
* **forms:** add status to `AbstractControlDirective` ([233ef93](https://github.com/angular/angular/commit/233ef93))
|
||||||
|
* **forms:** add updateOn and ngFormOptions to NgForm ([0d45828](https://github.com/angular/angular/commit/0d45828))
|
||||||
* **forms:** add updateOn blur option to FormControls ([#18408](https://github.com/angular/angular/issues/18408)) ([333a708](https://github.com/angular/angular/commit/333a708)), closes [#7113](https://github.com/angular/angular/issues/7113)
|
* **forms:** add updateOn blur option to FormControls ([#18408](https://github.com/angular/angular/issues/18408)) ([333a708](https://github.com/angular/angular/commit/333a708)), closes [#7113](https://github.com/angular/angular/issues/7113)
|
||||||
* **forms:** add updateOn submit option to FormControls ([#18514](https://github.com/angular/angular/issues/18514)) ([f69561b](https://github.com/angular/angular/commit/f69561b))
|
* **forms:** add updateOn submit option to FormControls ([#18514](https://github.com/angular/angular/issues/18514)) ([f69561b](https://github.com/angular/angular/commit/f69561b))
|
||||||
|
* **forms:** add updateOn support to ngModelOptions ([1cfa79c](https://github.com/angular/angular/commit/1cfa79c))
|
||||||
|
* **platform-server:** add an API to transfer state from server ([#19134](https://github.com/angular/angular/issues/19134)) ([cfd9ca0](https://github.com/angular/angular/commit/cfd9ca0))
|
||||||
|
* **platform-server:** provide a DOM implementation on the server ([2f2d5f3](https://github.com/angular/angular/commit/2f2d5f3)), closes [#14638](https://github.com/angular/angular/issues/14638)
|
||||||
|
* **platform-server:** provide a way to hook into renderModule* ([#19023](https://github.com/angular/angular/issues/19023)) ([8dfc3c3](https://github.com/angular/angular/commit/8dfc3c3))
|
||||||
|
* **router:** add ActivationStart/End events ([8f79150](https://github.com/angular/angular/commit/8f79150))
|
||||||
|
* **router:** add events tracking activation of individual routes ([49cd851](https://github.com/angular/angular/commit/49cd851))
|
||||||
|
* **service-worker:** introduce the [@angular](https://github.com/angular)/service-worker package ([#19274](https://github.com/angular/angular/issues/19274)) ([d442b68](https://github.com/angular/angular/commit/d442b68))
|
||||||
|
* **upgrade:** propagate touched state of NgModelController ([59c23c7](https://github.com/angular/angular/commit/59c23c7))
|
||||||
|
* **upgrade:** support lazy-loading Angular module into AngularJS app ([30e76fc](https://github.com/angular/angular/commit/30e76fc))
|
||||||
|
* update angular to support TypeScript 2.4 ([ca5aeba](https://github.com/angular/angular/commit/ca5aeba))
|
||||||
|
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|
||||||
* switch angular to use StaticInjector instead of ReflectiveInjector ([fcadbf4](https://github.com/angular/angular/commit/fcadbf4)), closes [#18496](https://github.com/angular/angular/issues/18496)
|
* **animations:** reduce size of bundle by removing AST classes ([#19539](https://github.com/angular/angular/issues/19539)) ([d5c9c5f](https://github.com/angular/angular/commit/d5c9c5f))
|
||||||
|
* **compiler:** don’t emit summaries for jit by default ([b086891](https://github.com/angular/angular/commit/b086891))
|
||||||
|
* **compiler:** fix perf issue in loading aot summaries in jit compiler ([fbc9537](https://github.com/angular/angular/commit/fbc9537))
|
||||||
|
* **compiler:** make the creation of `ts.Program` faster. ([#19275](https://github.com/angular/angular/issues/19275)) ([edd5f5a](https://github.com/angular/angular/commit/edd5f5a))
|
||||||
|
* **compiler:** only emit changed files for incremental compilation ([745b59f](https://github.com/angular/angular/commit/745b59f))
|
||||||
|
* **compiler:** only type check input files when using bazel ([#19581](https://github.com/angular/angular/issues/19581)) ([0b06ea1](https://github.com/angular/angular/commit/0b06ea1))
|
||||||
|
* **compiler:** only use tsickle if needed ([#19275](https://github.com/angular/angular/issues/19275)) ([8f95b75](https://github.com/angular/angular/commit/8f95b75))
|
||||||
|
* **compiler:** skip type check and emit in bazel in some cases. ([#19646](https://github.com/angular/angular/issues/19646)) ([a22121d](https://github.com/angular/angular/commit/a22121d))
|
||||||
|
* **compiler:** speed up loading of summaries for bazel. ([#19581](https://github.com/angular/angular/issues/19581)) ([81167d9](https://github.com/angular/angular/commit/81167d9))
|
||||||
|
* **compiler:** speed up watch mode ([#19275](https://github.com/angular/angular/issues/19275)) ([6665d76](https://github.com/angular/angular/commit/6665d76))
|
||||||
|
* **core:** Remove decorator DSL which depends on Reflect ([cac130e](https://github.com/angular/angular/commit/cac130e))
|
||||||
|
* **core:** add option to remove blank text nodes from compiled templates ([d2c0d98](https://github.com/angular/angular/commit/d2c0d98))
|
||||||
|
* **core:** use native addEventListener for faster rendering. ([#18107](https://github.com/angular/angular/issues/18107)) ([6279e50](https://github.com/angular/angular/commit/6279e50))
|
||||||
|
* **core** switch angular to use StaticInjector instead of ReflectiveInjector ([fcadbf4](https://github.com/angular/angular/commit/fcadbf4)), closes [#18496](https://github.com/angular/angular/issues/18496)
|
||||||
|
* latest tsickle to tree shake: abstract class methods & interfaces ([#18236](https://github.com/angular/angular/issues/18236)) ([b7a6f52](https://github.com/angular/angular/commit/b7a6f52))
|
||||||
|
|
||||||
|
|
||||||
### BREAKING CHANGES
|
### BREAKING CHANGES
|
||||||
|
|
||||||
* `platformXXXX()` no longer accepts providers which depend on reflection.
|
* **compiler**: Angular now requires TypeScript 2.4.x.
|
||||||
Specifically the method signature when from `Provider[]` to
|
* **compiler**: split compiler and core. `@angular/platform-server` now additionally depends on `@angular/platform-browser-dynamic` as a peer dependency. ([#18683](https://github.com/angular/angular/issues/18683)) ([0cc77b4](https://github.com/angular/angular/commit/0cc77b4))
|
||||||
`StaticProvider[]`.
|
* `platformXXXX()` no longer accepts providers which depend on reflection. Specifically the method signature went from `Provider[]` to `StaticProvider[]`.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
Before:
|
Before:
|
||||||
@ -117,25 +127,235 @@ declarations.
|
|||||||
Benchpress note: Previously Benchpress also supported reflective
|
Benchpress note: Previously Benchpress also supported reflective
|
||||||
provides, which now require static providers.
|
provides, which now require static providers.
|
||||||
|
|
||||||
DEPRECATION:
|
|
||||||
|
|
||||||
- `ReflectiveInjector` is now deprecated as it will be remove. Use
|
#### I18n Changes (@angular/common)
|
||||||
`Injector.create` as a replacement.
|
Because of multiple bugs and browser inconsistencies, we have dropped the intl api in favor of data exported from the Unicode Common Locale Data Repository (CLDR). Unfortunately we had to change the i18n pipes (date, number, currency, percent) and there are some breaking changes.
|
||||||
|
|
||||||
<a name="5.0.0-beta.2"></a>
|
##### I18n pipes:
|
||||||
# [5.0.0-beta.2](https://github.com/angular/angular/compare/5.0.0-beta.1...5.0.0-beta.2) (2017-08-02)
|
- Breaking change:
|
||||||
|
- By default Angular now only contains locale data for the language `en-US`, if you set the value of `LOCALE_ID` to another locale, you will have to import new locale data for this language because we don't use the intl API anymore.
|
||||||
|
- Features:
|
||||||
|
- you don't need to use the intl polyfill for Angular anymore.
|
||||||
|
- all i18n pipes now have an additional last parameter `locale` which allows you to use a specific locale instead of the one defined in the token `LOCALE_ID` (whose default value is `en-US`).
|
||||||
|
- the new locale data extracted from CLDR are now available to developers as well and can be used through an API (which should be especially useful for library authors).
|
||||||
|
- you can still use the old pipes for now, but their names have been changed and they are no longer included in the `CommonModule`. To use them, you will have to import the `DeprecatedI18NPipesModule` after the `CommonModule` (the order is important):
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule, DeprecatedI18NPipesModule } from '@angular/common';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
// import deprecated module after
|
||||||
|
DeprecatedI18NPipesModule
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class AppModule { }
|
||||||
|
```
|
||||||
|
|
||||||
|
Don't forget that you will still need to import the intl API polyfill if you want to use those deprecated pipes.
|
||||||
|
|
||||||
|
##### Date pipe
|
||||||
|
- Breaking changes:
|
||||||
|
- the predefined formats (`short`, `shortTime`, `shortDate`, `medium`, ...) now use the patterns given by CLDR (like it was in AngularJS) instead of the ones from the intl API. You might notice some changes, e.g. `shortDate` will be `8/15/17` instead of `8/15/2017` for `en-US`.
|
||||||
|
- the narrow version of eras is now `GGGGG` instead of `G`, the format `G` is now similar to `GG` and `GGG`.
|
||||||
|
- the narrow version of months is now `MMMMM` instead of `L`, the format `L` is now the short standalone version of months.
|
||||||
|
- the narrow version of the week day is now `EEEEE` instead of `E`, the format `E` is now similar to `EE` and `EEE`.
|
||||||
|
- the timezone `z` will now fallback to `O` and output `GMT+1` instead of the complete zone name (e.g. `Pacific Standard Time`), this is because the quantity of data required to have all the zone names in all of the existing locales is too big.
|
||||||
|
- the timezone `Z` will now output the ISO8601 basic format, e.g. `+0100`, you should now use `ZZZZ` to get `GMT+01:00`.
|
||||||
|
|
||||||
|
| Field type | Format | Example value | v4 | v5 |
|
||||||
|
|------------|---------------|-----------------------|----|---------------|
|
||||||
|
| Eras | Narrow | A for AD | G | GGGGG |
|
||||||
|
| Months | Narrow | S for September | L | MMMMM |
|
||||||
|
| Week day | Narrow | M for Monday | E | EEEEE |
|
||||||
|
| Timezone | Long location | Pacific Standard Time | z | Not available |
|
||||||
|
| Timezone | Long GMT | GMT+01:00 | Z | ZZZZ |
|
||||||
|
|
||||||
|
- Features
|
||||||
|
- new predefined formats `long`, `full`, `longTime`, `fullTime`.
|
||||||
|
- the format `yyy` is now supported, e.g. the year `52` will be `052` and the year `2017` will be `2017`.
|
||||||
|
- standalone months are now supported with the formats `L` to `LLLLL`.
|
||||||
|
- week of the year is now supported with the formats `w` and `ww`, e.g. weeks `5` and `05`.
|
||||||
|
- week of the month is now supported with the format `W`, e.g. week `3`.
|
||||||
|
- fractional seconds are now supported with the format `S` to `SSS`.
|
||||||
|
- day periods for AM/PM now supports additional formats `aa`, `aaa`, `aaaa` and `aaaaa`. The formats `a` to `aaa` are similar, while `aaaa` is the wide version if available (e.g. `ante meridiem` for `am`), or equivalent to `a` otherwise, and `aaaaa` is the narrow version (e.g. `a` for `am`).
|
||||||
|
- extra day periods are now supported with the formats `b` to `bbbbb` (and `B` to `BBBBB` for the standalone equivalents), e.g. `morning`, `noon`, `afternoon`, ....
|
||||||
|
- the short non-localized timezones are now available with the format `O` to `OOOO`. The formats `O` to `OOO` will output `GMT+1` while the format `OOOO` will be `GMT+01:00`.
|
||||||
|
- the ISO8601 basic time zones are now available with the formats `Z` to `ZZZZZ`. The formats `Z` to `ZZZ` will output `+0100`, while the format `ZZZZ` will be `GMT+01:00` and `ZZZZZ` will be `+01:00`.
|
||||||
|
|
||||||
|
- Bug fixes
|
||||||
|
- the date pipe will now work exactly the same across all browsers, which will fix a lot of bugs for safari and IE.
|
||||||
|
- eras can now be used on their own without the date, e.g. the format `GG` will be `AD` instead of `8 15, 2017 AD`.
|
||||||
|
|
||||||
|
##### Currency pipe
|
||||||
|
- Breaking change:
|
||||||
|
- the default value for `symbolDisplay` is now `symbol` instead of `code`. This means that by default you will see `$4.99` for `en-US` instead of `USD4.99` previously.
|
||||||
|
|
||||||
|
* Deprecation:
|
||||||
|
- the second parameter of the currency pipe (`symbolDisplay`) is no longer a boolean, it now takes the values `code`, `symbol` or `symbol-narrow`. A boolean value is still valid for now, but it is deprecated and it will print a warning message in the console.
|
||||||
|
|
||||||
|
- Features:
|
||||||
|
- you can now choose between `code`, `symbol` or `symbol-narrow` which gives you access to more options for some currencies (e.g. the canadian dollar with the code `CAD` has the symbol `CA$` and the symbol-narrow `$`).
|
||||||
|
|
||||||
|
##### Percent pipe
|
||||||
|
- Breaking change
|
||||||
|
- if you don't specify the number of digits to round to, the local format will be used (and it usually rounds numbers to 0 digits, instead of not rounding previously), e.g. `{{ 3.141592 | percent }}` will output `314%` for the locale `en-US` instead of `314.1592%` previously.
|
||||||
|
|
||||||
|
|
||||||
|
### Deprecated code
|
||||||
|
* **compiler**: The method `ngGetContentSelectors()` has been removed as it was deprecated since v4. Use `ComponentFactory.ngContentSelectors` instead.
|
||||||
|
* **compiler**: the compiler option `enableLegacyTemplate` is now disabled by default as the `<template>` element was deprecated since v4. Use `<ng-template>` instead. The option `enableLegacyTemplate` and the `<template>` element will both be removed in Angular v6.
|
||||||
|
* **compiler**: the option `useDebug` for the compiler has been removed as it had no effect and was deprecated since v4. ([#18778](https://github.com/angular/angular/issues/18778)) ([499d05d](https://github.com/angular/angular/commit/499d05d))
|
||||||
|
* **compiler**: deprecate i18n comments in favor of `ng-container` ([#18998](https://github.com/angular/angular/issues/18998)) ([66a5dab](https://github.com/angular/angular/commit/66a5dab))
|
||||||
|
* **common**: `NgFor` has been removed as it was deprecated since v4. Use `NgForOf` instead. This does not impact the use of `*ngFor` in your templates. ([#18758](https://github.com/angular/angular/issues/18758)) ([ec56760](https://github.com/angular/angular/commit/ec56760))
|
||||||
|
* **common**: `NgTemplateOutlet#ngOutletContext` has been removed as it was deprecated since v4. Use `NgTemplateOutlet#ngTemplateOutletContext` instead. ([#18780](https://github.com/angular/angular/issues/18780)) ([7522987](https://github.com/angular/angular/commit/7522987))
|
||||||
|
* **core**: `ErrorHandler` no longer takes a parameter as it was not used and deprecated since v4. ([#18759](https://github.com/angular/angular/issues/18759)) ([8f41326](https://github.com/angular/angular/commit/8f41326))
|
||||||
|
* **core**: `ReflectiveInjector` is now deprecated. Use `Injector.create` as a replacement.
|
||||||
|
* **core**: `Testability#findBindings` has been removed as it was deprecated since v4. Use `Testability#findProviders` instead. ([#18782](https://github.com/angular/angular/issues/18782)) ([f2a2a6b](https://github.com/angular/angular/commit/f2a2a6b))
|
||||||
|
* **core**: `DebugNode#source` has been removed as it was deprecated since v4. ([#18779](https://github.com/angular/angular/issues/18779)) ([d61b902](https://github.com/angular/angular/commit/d61b902))
|
||||||
|
* **core**: `OpaqueToken` has been removed as it was deprecated since v4. Use `InjectionToken` instead. ([#18971](https://github.com/angular/angular/issues/18971)) ([3c4eef8](https://github.com/angular/angular/commit/3c4eef8))
|
||||||
|
* **core**: `DifferFactory.create` no longer takes ChangeDetectionRef as a first argument as it was not used and deprecated since v4. ([#18757](https://github.com/angular/angular/issues/18757)) ([be9713c](https://github.com/angular/angular/commit/be9713c))
|
||||||
|
* **core**: `TrackByFn` has been removed because it was deprecated since v4. Use `TrackByFunction` instead. ([#18757](https://github.com/angular/angular/issues/18757)) ([596e9f4](https://github.com/angular/angular/commit/596e9f4))
|
||||||
|
* **http**: deprecate @angular/http in favor of @angular/common/http ([#18906](https://github.com/angular/angular/issues/18906)) ([72c7b6e](https://github.com/angular/angular/commit/72c7b6e))
|
||||||
|
* **router**: `RouterOutlet` properties `locationInjector` and `locationFactoryResolver` have been removed as they were deprecated since v4. ([#18781](https://github.com/angular/angular/issues/18781)) ([d1c4a94](https://github.com/angular/angular/commit/d1c4a94), [a9ef858](https://github.com/angular/angular/commit/a9ef858))
|
||||||
|
* **router**: the values `true`, `false`, `legacy_enabled` and `legacy_disabled` for the router parameter `initialNavigation` have been removed as they were deprecated. Use `enabled` or `disabled` instead. ([#18781](https://github.com/angular/angular/issues/18781)) ([d76761b](https://github.com/angular/angular/commit/d76761b))
|
||||||
|
* **platform-browser**: `NgProbeToken` has been removed from `@angular/platform-browser` as it was deprecated since v4. Import it from `@angular/core` instead. ([#18760](https://github.com/angular/angular/issues/18760)) ([d7f42bf](https://github.com/angular/angular/commit/d7f42bf))
|
||||||
|
* **platform-webworker**: `PRIMITIVE` has been removed as it was deprecated since v4. Use `SerializerTypes.PRIMITIVE` instead. ([#18761](https://github.com/angular/angular/issues/18761)) ([a56468c](https://github.com/angular/angular/commit/a56468c))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.4.6"></a>
|
||||||
|
## [4.4.6](https://github.com/angular/angular/compare/4.4.5...4.4.6) (2017-10-18)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **compiler:** do not consider arguments when determining recursion ([e64b54b](https://github.com/angular/angular/commit/e64b54b))
|
* **animations:** properly support boolean-based transitions and state changes ([#19672](https://github.com/angular/angular/issues/19672)) ([f983a6c](https://github.com/angular/angular/commit/f983a6c)), closes [#9396](https://github.com/angular/angular/issues/9396) [#12337](https://github.com/angular/angular/issues/12337)
|
||||||
* **compiler:** fix for element needing implicit parent placed in top-level ng-container ([381471d](https://github.com/angular/angular/commit/381471d)), closes [#18314](https://github.com/angular/angular/issues/18314)
|
* **common:** attempt to JSON.parse errors for JSON responses ([#19773](https://github.com/angular/angular/issues/19773)) ([269f5ac](https://github.com/angular/angular/commit/269f5ac))
|
||||||
|
* **router:** RouterLinkActive should update its state right after checking the children ([53a807a](https://github.com/angular/angular/commit/53a807a)), closes [#18983](https://github.com/angular/angular/issues/18983)
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **animations:** reduce size of bundle by removing AST classes ([#19673](https://github.com/angular/angular/issues/19673)) ([76d2496](https://github.com/angular/angular/commit/76d2496))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.4.5"></a>
|
||||||
|
## [4.4.5](https://github.com/angular/angular/compare/4.4.4...4.4.5) (2017-10-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **compiler:** `TestBed.overrideProvider` should keep imported `NgModule`s eager ([#19624](https://github.com/angular/angular/issues/19624)) ([734378c](https://github.com/angular/angular/commit/734378c))
|
||||||
|
* **compiler:** correctly instantiate eager providers that are used via `Injector.get` ([#19558](https://github.com/angular/angular/issues/19558)) ([e292548](https://github.com/angular/angular/commit/e292548)), closes [#15501](https://github.com/angular/angular/issues/15501)
|
||||||
|
* **compiler:** disallow references for select and index evaluation ([95f3b1d](https://github.com/angular/angular/commit/95f3b1d))
|
||||||
|
* **core:** make dynamic & inline code checking behave the same ([#19189](https://github.com/angular/angular/issues/19189)) ([6c66031](https://github.com/angular/angular/commit/6c66031))
|
||||||
|
* **platform-browser:** support customEqualityTesters when overriding Jasmine toEqual ([cc8ae32](https://github.com/angular/angular/commit/cc8ae32))
|
||||||
|
* **tsc-wrapped:** don't rewrite imports when annotating for closure ([#19579](https://github.com/angular/angular/issues/19579)) ([c9f8718](https://github.com/angular/angular/commit/c9f8718))
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.4.4"></a>
|
||||||
|
## [4.4.4](https://github.com/angular/angular/compare/4.4.3...4.4.4) (2017-09-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **animations:** support negative query limit value ([#19419](https://github.com/angular/angular/issues/19419)) ([bc81fbd](https://github.com/angular/angular/commit/bc81fbd)), closes [#19232](https://github.com/angular/angular/issues/19232)
|
||||||
|
* **compiler:** correctly map error message locations ([#19424](https://github.com/angular/angular/issues/19424)) ([c3b39ba](https://github.com/angular/angular/commit/c3b39ba))
|
||||||
|
* **compiler:** do not consider a reference with members as a reference ([#19466](https://github.com/angular/angular/issues/19466)) ([7fc2dce](https://github.com/angular/angular/commit/7fc2dce))
|
||||||
|
* **compiler:** skip when trimming / removing whitespaces ([#19310](https://github.com/angular/angular/issues/19310)) ([c7aa8a1](https://github.com/angular/angular/commit/c7aa8a1)), closes [#19304](https://github.com/angular/angular/issues/19304)
|
||||||
|
* **tsc-wrapped:** add metadata for `type` declarations ([#19040](https://github.com/angular/angular/issues/19040)) ([ae52851](https://github.com/angular/angular/commit/ae52851))
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.4.3"></a>
|
||||||
|
## [4.4.3](https://github.com/angular/angular/compare/4.4.2...4.4.3) (2017-09-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **tsc-wrapped:** deduplicate metadata only when the module is the same ([#19261](https://github.com/angular/angular/issues/19261)) ([0371538](https://github.com/angular/angular/commit/0371538)), closes [#19219](https://github.com/angular/angular/issues/19219)
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.4.2"></a>
|
||||||
|
## [4.4.2](https://github.com/angular/angular/compare/4.4.1...4.4.2) (2017-09-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **platform-server**: fix for packaging issues [#19250](https://github.com/angular/angular/issues/19250)
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.4.1"></a>
|
||||||
|
## [4.4.1](https://github.com/angular/angular/compare/4.3.6...4.4.1) (2017-09-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **animations:** do not leak DOM nodes/styling for host triggered animations ([#18853](https://github.com/angular/angular/issues/18853)) ([1cc3fe2](https://github.com/angular/angular/commit/1cc3fe2)), closes [#18606](https://github.com/angular/angular/issues/18606)
|
||||||
|
* **common:** fix improper packaging for [@angular](https://github.com/angular)/common/http ([#18613](https://github.com/angular/angular/issues/18613)) ([a203a95](https://github.com/angular/angular/commit/a203a95))
|
||||||
|
* **common:** fix XSSI prefix stripping by using JSON.parse always ([#18466](https://github.com/angular/angular/issues/18466)) ([8821723](https://github.com/angular/angular/commit/8821723)), closes [#18396](https://github.com/angular/angular/issues/18396) [#18453](https://github.com/angular/angular/issues/18453)
|
||||||
|
* **compiler:** normalize the locale name ([#18963](https://github.com/angular/angular/issues/18963)) ([497e017](https://github.com/angular/angular/commit/497e017))
|
||||||
|
* **core:** complete EventEmitter in QueryList on component destroy ([#18902](https://github.com/angular/angular/issues/18902)) ([7d137d7](https://github.com/angular/angular/commit/7d137d7)), closes [#18741](https://github.com/angular/angular/issues/18741)
|
||||||
|
* **tsc-wrapped:** deduplicate metadata for re-exported modules ([48ae1a6](https://github.com/angular/angular/commit/48ae1a6))
|
||||||
|
* **tsc-wrapped:** fix metadata symbol reference ([f6a7183](https://github.com/angular/angular/commit/f6a7183))
|
||||||
|
* **upgrade:** remove code setting id attribute. ([#19182](https://github.com/angular/angular/issues/19182)) ([b20c5d2](https://github.com/angular/angular/commit/b20c5d2)), closes [#18446](https://github.com/angular/angular/issues/18446)
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* **forms:** add options arg to abstract controls ([ebef5e6](https://github.com/angular/angular/commit/ebef5e6))
|
* **compiler:** allow multiple exportAs names ([#18723](https://github.com/angular/angular/issues/18723)) ([7ec28fe](https://github.com/angular/angular/commit/7ec28fe))
|
||||||
* **router:** add events tracking activation of individual routes ([49cd851](https://github.com/angular/angular/commit/49cd851))
|
* **core:** add option to remove blank text nodes from compiled templates ([#18823](https://github.com/angular/angular/issues/18823)) ([b8b551c](https://github.com/angular/angular/commit/b8b551c))
|
||||||
|
|
||||||
|
|
||||||
|
Note: the 4.4.0 release on npm accidentally glitched-out midway, so we cut 4.4.1 instead. oops :-)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.3.6"></a>
|
||||||
|
## [4.3.6](https://github.com/angular/angular/compare/4.3.5...4.3.6) (2017-08-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **animations:** ensure animations are disabled on the element containing the @.disabled flag ([#18714](https://github.com/angular/angular/issues/18714)) ([5d68c83](https://github.com/angular/angular/commit/5d68c83))
|
||||||
|
* **animations:** make sure @.disabled respects disabled parent/sub animation sequences ([#18715](https://github.com/angular/angular/issues/18715)) ([c3dcbf9](https://github.com/angular/angular/commit/c3dcbf9))
|
||||||
|
* **animations:** make sure animation cancellations respect AUTO style values ([#18787](https://github.com/angular/angular/issues/18787)) ([9a754f9](https://github.com/angular/angular/commit/9a754f9)), closes [#17450](https://github.com/angular/angular/issues/17450)
|
||||||
|
* **animations:** resolve error when using AnimationBuilder with platform-server ([#18642](https://github.com/angular/angular/issues/18642)) ([f9b2905](https://github.com/angular/angular/commit/f9b2905)), closes [#18635](https://github.com/angular/angular/issues/18635)
|
||||||
|
* **animations:** restore auto-style support for removed DOM nodes ([#18787](https://github.com/angular/angular/issues/18787)) ([e1f45a3](https://github.com/angular/angular/commit/e1f45a3))
|
||||||
|
* **core:** correct order in ContentChildren query result ([#18326](https://github.com/angular/angular/issues/18326)) ([fec3b1a](https://github.com/angular/angular/commit/fec3b1a)), closes [#16568](https://github.com/angular/angular/issues/16568)
|
||||||
|
* **core:** make sure onStable runs in the right zone ([#18706](https://github.com/angular/angular/issues/18706)) ([ee5591d](https://github.com/angular/angular/commit/ee5591d))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **animations:** allow @.disabled property to work without an expression ([#18713](https://github.com/angular/angular/issues/18713)) ([ac58914](https://github.com/angular/angular/commit/ac58914))
|
||||||
|
* **common:** add an empty DeprecatedI18NPipesModule module ([793f31b](https://github.com/angular/angular/commit/793f31b))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.3.5"></a>
|
||||||
|
## [4.3.5](https://github.com/angular/angular/compare/4.3.4...4.3.5) (2017-08-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **core:** forbid destroyed views to be inserted or moved in VC ([972538b](https://github.com/angular/angular/commit/972538b)), closes [#18615](https://github.com/angular/angular/issues/18615)
|
||||||
|
* **forms:** re-assigning options should not clear select ([a1624f2](https://github.com/angular/angular/commit/a1624f2)), closes [#18330](https://github.com/angular/angular/issues/18330)
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.3.4"></a>
|
||||||
|
## [4.3.4](https://github.com/angular/angular/compare/4.3.3...4.3.4) (2017-08-10)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **animations:** revert container/queried animations accordingly during cancel ([#18516](https://github.com/angular/angular/issues/18516)) ([5a165eb](https://github.com/angular/angular/commit/5a165eb))
|
||||||
|
* **animations:** support persisting dynamic styles within animation states ([#18468](https://github.com/angular/angular/issues/18468)) ([e0660b1](https://github.com/angular/angular/commit/e0660b1)), closes [#18423](https://github.com/angular/angular/issues/18423) [#17505](https://github.com/angular/angular/issues/17505)
|
||||||
|
* **benchpress:** compile cleanly with TS 2.4 ([#18455](https://github.com/angular/angular/issues/18455)) ([5afc7ab](https://github.com/angular/angular/commit/5afc7ab))
|
||||||
|
* **compiler:** cleanly compile with TypeScript 2.4 ([#18456](https://github.com/angular/angular/issues/18456)) ([5e4054b](https://github.com/angular/angular/commit/5e4054b))
|
||||||
|
* **compiler:** ignore [@import](https://github.com/import) in multi-line css ([#18452](https://github.com/angular/angular/issues/18452)) ([e7e7622](https://github.com/angular/angular/commit/e7e7622)), closes [#18038](https://github.com/angular/angular/issues/18038)
|
||||||
|
|
||||||
|
|
||||||
<a name="4.3.3"></a>
|
<a name="4.3.3"></a>
|
||||||
@ -146,35 +366,6 @@ DEPRECATION:
|
|||||||
* **compiler:** fix for element needing implicit parent placed in top-level ng-container ([f5cbc2e](https://github.com/angular/angular/commit/f5cbc2e)), closes [#18314](https://github.com/angular/angular/issues/18314)
|
* **compiler:** fix for element needing implicit parent placed in top-level ng-container ([f5cbc2e](https://github.com/angular/angular/commit/f5cbc2e)), closes [#18314](https://github.com/angular/angular/issues/18314)
|
||||||
|
|
||||||
|
|
||||||
<a name="5.0.0-beta.1"></a>
|
|
||||||
# [5.0.0-beta.1](https://github.com/angular/angular/compare/5.0.0-beta.0...5.0.0-beta.1) (2017-07-27)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **animations:** export BrowserModule as apart of BrowserAnimationsModule ([#18263](https://github.com/angular/angular/issues/18263)) ([fd0cc01](https://github.com/angular/angular/commit/fd0cc01))
|
|
||||||
* **compiler:** add equiv & disp attributes to Xliff2 ICU placeholders ([#18283](https://github.com/angular/angular/issues/18283)) ([38ec05f](https://github.com/angular/angular/commit/38ec05f)), closes [#17344](https://github.com/angular/angular/issues/17344)
|
|
||||||
* **compiler:** allow numbers for ICU message cases in lexer ([#18095](https://github.com/angular/angular/issues/18095)) ([a3a5429](https://github.com/angular/angular/commit/a3a5429)), closes [#17799](https://github.com/angular/angular/issues/17799)
|
|
||||||
* **core:** invoke error handler outside of the Angular Zone ([#18269](https://github.com/angular/angular/issues/18269)) ([7ae7573](https://github.com/angular/angular/commit/7ae7573)), closes [#17073](https://github.com/angular/angular/issues/17073) [#7774](https://github.com/angular/angular/issues/7774)
|
|
||||||
* **platform-server:** don't clobber parse5 properties when setting ([#18237](https://github.com/angular/angular/issues/18237)) ([a094769](https://github.com/angular/angular/commit/a094769)), closes [#17050](https://github.com/angular/angular/issues/17050)
|
|
||||||
* **router:** child CanActivate guard should wait for parent to complete ([#18110](https://github.com/angular/angular/issues/18110)) ([086f4aa](https://github.com/angular/angular/commit/086f4aa)), closes [#15670](https://github.com/angular/angular/issues/15670)
|
|
||||||
* **router:** should throw when lazy loaded module doesn't define any routes ([#15001](https://github.com/angular/angular/issues/15001)) ([82923a3](https://github.com/angular/angular/commit/82923a3)), closes [#14596](https://github.com/angular/angular/issues/14596)
|
|
||||||
* **upgrade:** ensure downgraded components are created in the Angular zone ([#18209](https://github.com/angular/angular/issues/18209)) ([43c33d5](https://github.com/angular/angular/commit/43c33d5))
|
|
||||||
* **upgrade:** throw error if trying to get injector before setting ([#18209](https://github.com/angular/angular/issues/18209)) ([d31dc7b](https://github.com/angular/angular/commit/d31dc7b))
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **compiler:** add representation of placeholders to xliff & xmb ([b3085e9](https://github.com/angular/angular/commit/b3085e9)), closes [#17345](https://github.com/angular/angular/issues/17345)
|
|
||||||
|
|
||||||
|
|
||||||
### Performance Improvements
|
|
||||||
|
|
||||||
* latest tsickle to tree shake: abstract class methods & interfaces ([#18236](https://github.com/angular/angular/issues/18236)) ([b7a6f52](https://github.com/angular/angular/commit/b7a6f52))
|
|
||||||
* **core:** use native addEventListener for faster rendering. ([#18107](https://github.com/angular/angular/issues/18107)) ([6279e50](https://github.com/angular/angular/commit/6279e50))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.3.2"></a>
|
<a name="4.3.2"></a>
|
||||||
## [4.3.2](https://github.com/angular/angular/compare/4.3.1...4.3.2) (2017-07-26)
|
## [4.3.2](https://github.com/angular/angular/compare/4.3.1...4.3.2) (2017-07-26)
|
||||||
|
|
||||||
@ -192,35 +383,6 @@ DEPRECATION:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="5.0.0-beta.0"></a>
|
|
||||||
# [5.0.0-beta.0](https://github.com/angular/angular/compare/4.3.0...5.0.0-beta.0) (2017-07-19)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **animations:** always camelcase style property names that contain auto styles ([d22f8f5](https://github.com/angular/angular/commit/d22f8f5)), closes [#17938](https://github.com/angular/angular/issues/17938)
|
|
||||||
* **animations:** capture cancelled animation styles within grouped animations ([23146c9](https://github.com/angular/angular/commit/23146c9)), closes [#17170](https://github.com/angular/angular/issues/17170)
|
|
||||||
* **animations:** do not crash animations if a nested component fires CD during CD ([5db6f38](https://github.com/angular/angular/commit/5db6f38)), closes [#18193](https://github.com/angular/angular/issues/18193)
|
|
||||||
* **animations:** make sure @.disabled works in non-animation components ([5344be5](https://github.com/angular/angular/commit/5344be5))
|
|
||||||
* **common:** send flushed body as error instead of null ([5c62e30](https://github.com/angular/angular/commit/5c62e30)), closes [#18181](https://github.com/angular/angular/issues/18181)
|
|
||||||
* **compiler:** ensure jit external id arguments names are unique ([95635c1](https://github.com/angular/angular/commit/95635c1))
|
|
||||||
* **compiler-cli:** don't generate empty <target/> when extracting xliff ([65c9e13](https://github.com/angular/angular/commit/65c9e13)), closes [#15754](https://github.com/angular/angular/issues/15754)
|
|
||||||
* **platform-server:** provide XhrFactory for HttpClient ([8076482](https://github.com/angular/angular/commit/8076482))
|
|
||||||
* **router:** canDeactivate guards should run from bottom to top ([e20cfe1](https://github.com/angular/angular/commit/e20cfe1)), closes [#15657](https://github.com/angular/angular/issues/15657)
|
|
||||||
* **router:** should navigate to the same url when config changes ([eb6fb5f](https://github.com/angular/angular/commit/eb6fb5f)), closes [#15535](https://github.com/angular/angular/issues/15535)
|
|
||||||
* **router:** should run resolvers for the same route concurrently ([ad3029e](https://github.com/angular/angular/commit/ad3029e)), closes [#14279](https://github.com/angular/angular/issues/14279)
|
|
||||||
* **router:** terminal route in custom matcher ([b399cb2](https://github.com/angular/angular/commit/b399cb2))
|
|
||||||
* **upgrade:** allow accessing AngularJS injector from downgraded module ([a5205c6](https://github.com/angular/angular/commit/a5205c6))
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **animations:** support :increment and :decrement transition aliases ([6f45519](https://github.com/angular/angular/commit/6f45519))
|
|
||||||
* **upgrade:** propagate touched state of NgModelController ([59c23c7](https://github.com/angular/angular/commit/59c23c7))
|
|
||||||
* **upgrade:** support lazy-loading Angular module into AngularJS app ([30e76fc](https://github.com/angular/angular/commit/30e76fc))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.3.1"></a>
|
<a name="4.3.1"></a>
|
||||||
## [4.3.1](https://github.com/angular/angular/compare/4.3.0...4.3.1) (2017-07-19)
|
## [4.3.1](https://github.com/angular/angular/compare/4.3.0...4.3.1) (2017-07-19)
|
||||||
|
|
||||||
@ -1292,7 +1454,6 @@ templates is unaffected. We expect no or little impact on apps from this change,
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* **aio:** add initial angular-cli scaffold ([#14118](https://github.com/angular/angular/issues/14118)) ([e130bc1](https://github.com/angular/angular/commit/e130bc1))
|
|
||||||
* **common:** rename underlying `NgFor` class and add a type parameter ([#14104](https://github.com/angular/angular/issues/14104)) ([86b2b25](https://github.com/angular/angular/commit/86b2b25))
|
* **common:** rename underlying `NgFor` class and add a type parameter ([#14104](https://github.com/angular/angular/issues/14104)) ([86b2b25](https://github.com/angular/angular/commit/86b2b25))
|
||||||
* **compiler:** allow missing translations ([#14113](https://github.com/angular/angular/issues/14113)) ([8775ab9](https://github.com/angular/angular/commit/8775ab9)), closes [#13861](https://github.com/angular/angular/issues/13861)
|
* **compiler:** allow missing translations ([#14113](https://github.com/angular/angular/issues/14113)) ([8775ab9](https://github.com/angular/angular/commit/8775ab9)), closes [#13861](https://github.com/angular/angular/issues/13861)
|
||||||
* **compiler:** do not parse xtb messages not needed by angular ([#14111](https://github.com/angular/angular/issues/14111)) ([f7fba74](https://github.com/angular/angular/commit/f7fba74)), closes [#14046](https://github.com/angular/angular/issues/14046)
|
* **compiler:** do not parse xtb messages not needed by angular ([#14111](https://github.com/angular/angular/issues/14111)) ([f7fba74](https://github.com/angular/angular/commit/f7fba74)), closes [#14046](https://github.com/angular/angular/issues/14046)
|
||||||
|
@ -220,8 +220,8 @@ The following is the list of supported scopes:
|
|||||||
* **platform-webworker**
|
* **platform-webworker**
|
||||||
* **platform-webworker-dynamic**
|
* **platform-webworker-dynamic**
|
||||||
* **router**
|
* **router**
|
||||||
|
* **service-worker**
|
||||||
* **upgrade**
|
* **upgrade**
|
||||||
* **tsc-wrapped**
|
|
||||||
|
|
||||||
There are currently a few exceptions to the "use package name" rule:
|
There are currently a few exceptions to the "use package name" rule:
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
[](https://travis-ci.org/angular/angular)
|
[](https://travis-ci.org/angular/angular)
|
||||||
[](https://circleci.com/gh/angular/angular/tree/master)
|
[](https://circleci.com/gh/angular/angular/tree/master)
|
||||||
|
[](https://www.browserstack.com/automate/public-build/LzF3RzBVVGt6VWE2S0hHaC9uYllOZz09LS1BVjNTclBKV0x4eVRlcjA4QVY1M0N3PT0=--eb4ce8c8dc2c1c5b2b5352d473ee12a73ac20e06)
|
||||||
[](https://gitter.im/angular/angular?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
[](https://gitter.im/angular/angular?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
[](http://issuestats.com/github/angular/angular)
|
[](http://issuestats.com/github/angular/angular)
|
||||||
[](http://issuestats.com/github/angular/angular)
|
[](http://issuestats.com/github/angular/angular)
|
||||||
@ -8,7 +9,7 @@
|
|||||||
|
|
||||||
[](https://saucelabs.com/u/angular2-ci)
|
[](https://saucelabs.com/u/angular2-ci)
|
||||||
|
|
||||||
*Safari (7+), iOS (7+), Edge (14) and IE mobile (11) are tested on [BrowserStack][browserstack].*
|
*Safari (7+), iOS (7+) and IE mobile (11) are tested on [BrowserStack][browserstack].*
|
||||||
|
|
||||||
# Angular
|
# Angular
|
||||||
|
|
||||||
@ -23,7 +24,7 @@ Angular is a development platform for building mobile and desktop web applicatio
|
|||||||
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our
|
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our
|
||||||
guidelines for [contributing][contributing] and then check out one of our issues in the [hotlist: community-help](https://github.com/angular/angular/labels/hotlist%3A%20community-help).
|
guidelines for [contributing][contributing] and then check out one of our issues in the [hotlist: community-help](https://github.com/angular/angular/labels/hotlist%3A%20community-help).
|
||||||
|
|
||||||
[browserstack]: https://www.browserstack.com/
|
[browserstack]: https://www.browserstack.com/automate/public-build/LzF3RzBVVGt6VWE2S0hHaC9uYllOZz09LS1BVjNTclBKV0x4eVRlcjA4QVY1M0N3PT0=--eb4ce8c8dc2c1c5b2b5352d473ee12a73ac20e06
|
||||||
[contributing]: http://github.com/angular/angular/blob/master/CONTRIBUTING.md
|
[contributing]: http://github.com/angular/angular/blob/master/CONTRIBUTING.md
|
||||||
[quickstart]: https://angular.io/docs/ts/latest/quickstart.html
|
[quickstart]: https://angular.io/docs/ts/latest/quickstart.html
|
||||||
[ng]: http://angular.io
|
[ng]: http://angular.io
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
|
workspace(name = "angular_src")
|
||||||
|
|
||||||
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
|
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
|
||||||
|
|
||||||
git_repository(
|
git_repository(
|
||||||
name = "build_bazel_rules_nodejs",
|
name = "build_bazel_rules_nodejs",
|
||||||
remote = "https://github.com/bazelbuild/rules_nodejs.git",
|
remote = "https://github.com/bazelbuild/rules_nodejs.git",
|
||||||
tag = "0.0.2",
|
# TODO(alexeagle): use the correct tag here.
|
||||||
|
commit = "2c6243df53fd33fdab283ebdd01582e4eb815db8",
|
||||||
)
|
)
|
||||||
|
|
||||||
load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories")
|
load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories")
|
||||||
@ -18,4 +21,4 @@ local_repository(
|
|||||||
local_repository(
|
local_repository(
|
||||||
name = "angular",
|
name = "angular",
|
||||||
path = "packages/bazel",
|
path = "packages/bazel",
|
||||||
)
|
)
|
||||||
|
@ -13,7 +13,11 @@ You should run all these tasks from the `angular/aio` folder.
|
|||||||
Here are the most important tasks you might need to use:
|
Here are the most important tasks you might need to use:
|
||||||
|
|
||||||
* `yarn` - install all the dependencies.
|
* `yarn` - install all the dependencies.
|
||||||
* `yarn setup` - Install all the dependencies, boilerplate, plunkers, zips and runs dgeni on the docs.
|
* `yarn setup` - install all the dependencies, boilerplate, plunkers, zips and run dgeni on the docs.
|
||||||
|
* `yarn setup-local` - same as `setup`, but use the locally built Angular packages for aio and docs examples boilerplate.
|
||||||
|
|
||||||
|
* `yarn build` - create a production build of the application (after installing dependencies, boilerplate, etc).
|
||||||
|
* `yarn build-local` - same as `build`, but use `setup-local` instead of `setup`.
|
||||||
|
|
||||||
* `yarn start` - run a development web server that watches the files; then builds the doc-viewer and reloads the page, as necessary.
|
* `yarn start` - run a development web server that watches the files; then builds the doc-viewer and reloads the page, as necessary.
|
||||||
* `yarn serve-and-sync` - run both the `docs-watch` and `start` in the same console.
|
* `yarn serve-and-sync` - run both the `docs-watch` and `start` in the same console.
|
||||||
@ -26,33 +30,33 @@ Here are the most important tasks you might need to use:
|
|||||||
* `yarn docs-lint` - check that the doc gen code follows our style rules.
|
* `yarn docs-lint` - check that the doc gen code follows our style rules.
|
||||||
* `yarn docs-test` - run the unit tests for the doc generation code.
|
* `yarn docs-test` - run the unit tests for the doc generation code.
|
||||||
|
|
||||||
* `yarn boilerplate:add` - generate all the boilerplate code for the examples, so that they can be run locally. Add the option `-- --local` to use your local version of Angular contained in the "dist" folder.
|
* `yarn boilerplate:add` - generate all the boilerplate code for the examples, so that they can be run locally. Add the option `--local` to use your local version of Angular contained in the "dist" folder.
|
||||||
* `yarn boilerplate:remove` - remove all the boilerplate code that was added via `yarn boilerplate:add`.
|
* `yarn boilerplate:remove` - remove all the boilerplate code that was added via `yarn boilerplate:add`.
|
||||||
* `yarn generate-plunkers` - generate the plunker files that are used by the `live-example` tags in the docs.
|
* `yarn generate-plunkers` - generate the plunker files that are used by the `live-example` tags in the docs.
|
||||||
* `yarn generate-zips` - generate the zip files from the examples. Zip available via the `live-example` tags in the docs.
|
* `yarn generate-zips` - generate the zip files from the examples. Zip available via the `live-example` tags in the docs.
|
||||||
|
|
||||||
* `yarn example-e2e` - run all e2e tests for examples
|
* `yarn example-e2e` - run all e2e tests for examples
|
||||||
- `yarn example-e2e -- --setup` - force webdriver update & other setup, then run tests
|
- `yarn example-e2e --setup` - force webdriver update & other setup, then run tests
|
||||||
- `yarn example-e2e -- --filter=foo` - limit e2e tests to those containing the word "foo"
|
- `yarn example-e2e --filter=foo` - limit e2e tests to those containing the word "foo"
|
||||||
- `yarn example-e2e -- --setup --local` - run e2e tests with the local version of Angular contained in the "dist" folder
|
- `yarn example-e2e --setup --local` - run e2e tests with the local version of Angular contained in the "dist" folder
|
||||||
|
|
||||||
* `yarn build-ie-polyfills` - generates a js file of polyfills that can be loaded in Internet Explorer.
|
* `yarn build-ie-polyfills` - generates a js file of polyfills that can be loaded in Internet Explorer.
|
||||||
|
|
||||||
## Using ServiceWorker locally
|
## Using ServiceWorker locally
|
||||||
|
|
||||||
Since abb36e3cb, running `yarn start -- --prod` will no longer set up the ServiceWorker, which
|
Since abb36e3cb, running `yarn start --prod` will no longer set up the ServiceWorker, which
|
||||||
would require manually running `yarn sw-manifest` and `yarn sw-copy` (something that is not possible
|
would require manually running `yarn sw-manifest` and `yarn sw-copy` (something that is not possible
|
||||||
with webpack serving the files from memory).
|
with webpack serving the files from memory).
|
||||||
|
|
||||||
If you want to test ServiceWorker locally, you can use `yarn build` and serve the files in `dist/`
|
If you want to test ServiceWorker locally, you can use `yarn build` and serve the files in `dist/`
|
||||||
with `yarn http-server -- dist -p 4200`.
|
with `yarn http-server dist -p 4200`.
|
||||||
|
|
||||||
For more details see #16745.
|
For more details see #16745.
|
||||||
|
|
||||||
|
|
||||||
## Guide to authoring
|
## Guide to authoring
|
||||||
|
|
||||||
There are two types of content in the documentatation:
|
There are two types of content in the documentation:
|
||||||
|
|
||||||
* **API docs**: descriptions of the modules, classes, interfaces, decorators, etc that make up the Angular platform.
|
* **API docs**: descriptions of the modules, classes, interfaces, decorators, etc that make up the Angular platform.
|
||||||
API docs are generated directly from the source code.
|
API docs are generated directly from the source code.
|
||||||
@ -107,8 +111,16 @@ yarn start
|
|||||||
yarn docs-watch
|
yarn docs-watch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
>Alternatively, try the consolidated `serve-and-sync` command that builds, watches and serves in the same terminal window
|
||||||
|
```bash
|
||||||
|
yarn serve-and-sync
|
||||||
|
```
|
||||||
|
|
||||||
* Open a browser at https://localhost:4200/ and navigate to the document on which you want to work.
|
* Open a browser at https://localhost:4200/ and navigate to the document on which you want to work.
|
||||||
You can automatically open the browser by using `yarn start -- -o` in the first terminal.
|
You can automatically open the browser by using `yarn start -o` in the first terminal.
|
||||||
|
|
||||||
* Make changes to the page's associated doc or example files. Every time a file is saved, the doc will
|
* Make changes to the page's associated doc or example files. Every time a file is saved, the doc will
|
||||||
be regenerated, the app will rebuild and the page will reload.
|
be regenerated, the app will rebuild and the page will reload.
|
||||||
|
|
||||||
|
* If you get a build error complaining about examples or any other odd behavior, be sure to consult
|
||||||
|
the [Authors Style Guide](https://angular.io/guide/docs-style-guide).
|
||||||
|
@ -156,7 +156,7 @@ RUN find $AIO_SCRIPTS_SH_DIR -maxdepth 1 -type f -printf "%P\n" \
|
|||||||
# Set up the Node.js scripts
|
# Set up the Node.js scripts
|
||||||
COPY scripts-js/ $AIO_SCRIPTS_JS_DIR/
|
COPY scripts-js/ $AIO_SCRIPTS_JS_DIR/
|
||||||
WORKDIR $AIO_SCRIPTS_JS_DIR/
|
WORKDIR $AIO_SCRIPTS_JS_DIR/
|
||||||
RUN yarn install --production
|
RUN yarn install --production --frozen-lockfile
|
||||||
|
|
||||||
|
|
||||||
# Set up health check
|
# Set up health check
|
||||||
|
@ -6,7 +6,7 @@ server=8.8.4.4
|
|||||||
# Listen for DHCP and DNS requests only on this address.
|
# Listen for DHCP and DNS requests only on this address.
|
||||||
listen-address=127.0.0.1
|
listen-address=127.0.0.1
|
||||||
|
|
||||||
# Force an IP addres for these domains.
|
# Force an IP address for these domains.
|
||||||
address=/{{$AIO_NGINX_HOSTNAME}}/127.0.0.1
|
address=/{{$AIO_NGINX_HOSTNAME}}/127.0.0.1
|
||||||
address=/{{$AIO_UPLOAD_HOSTNAME}}/127.0.0.1
|
address=/{{$AIO_UPLOAD_HOSTNAME}}/127.0.0.1
|
||||||
address=/{{$TEST_AIO_NGINX_HOSTNAME}}/127.0.0.1
|
address=/{{$TEST_AIO_NGINX_HOSTNAME}}/127.0.0.1
|
||||||
|
@ -13,10 +13,8 @@ const AIO_REPO_SLUG = getEnvVar('AIO_REPO_SLUG');
|
|||||||
const AIO_TRUSTED_PR_LABEL = getEnvVar('AIO_TRUSTED_PR_LABEL');
|
const AIO_TRUSTED_PR_LABEL = getEnvVar('AIO_TRUSTED_PR_LABEL');
|
||||||
const AIO_UPLOAD_HOSTNAME = getEnvVar('AIO_UPLOAD_HOSTNAME');
|
const AIO_UPLOAD_HOSTNAME = getEnvVar('AIO_UPLOAD_HOSTNAME');
|
||||||
const AIO_UPLOAD_PORT = +getEnvVar('AIO_UPLOAD_PORT');
|
const AIO_UPLOAD_PORT = +getEnvVar('AIO_UPLOAD_PORT');
|
||||||
const AIO_WWW_USER = getEnvVar('AIO_WWW_USER');
|
|
||||||
|
|
||||||
// Run
|
// Run
|
||||||
process.setuid(AIO_WWW_USER); // TODO(gkalpak): Find more suitable way to run as `www-data`.
|
|
||||||
_main();
|
_main();
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
|
@ -18,7 +18,7 @@ const TEST_AIO_UPLOAD_PORT = +getEnvVar('TEST_AIO_UPLOAD_PORT');
|
|||||||
const WWW_USER = getEnvVar('AIO_WWW_USER');
|
const WWW_USER = getEnvVar('AIO_WWW_USER');
|
||||||
|
|
||||||
// Interfaces - Types
|
// Interfaces - Types
|
||||||
export interface CmdResult { success: boolean; err: Error; stdout: string; stderr: string; }
|
export interface CmdResult { success: boolean; err: Error | null; stdout: string; stderr: string; }
|
||||||
export interface FileSpecs { content?: string; size?: number; }
|
export interface FileSpecs { content?: string; size?: number; }
|
||||||
|
|
||||||
export type CleanUpFn = () => void;
|
export type CleanUpFn = () => void;
|
||||||
@ -143,7 +143,7 @@ class Helper {
|
|||||||
statusText = status[1];
|
statusText = status[1];
|
||||||
} else {
|
} else {
|
||||||
statusCode = status;
|
statusCode = status;
|
||||||
statusText = http.STATUS_CODES[statusCode];
|
statusText = http.STATUS_CODES[statusCode] || 'UNKNOWN_STATUS_CODE';
|
||||||
}
|
}
|
||||||
|
|
||||||
return (result: CmdResult) => {
|
return (result: CmdResult) => {
|
||||||
@ -196,7 +196,7 @@ class Helper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Methods - Protected
|
// Methods - Protected
|
||||||
protected createCleanUpFn(fn: Function): CleanUpFn {
|
protected createCleanUpFn(fn: () => void): CleanUpFn {
|
||||||
const cleanUpFn = () => {
|
const cleanUpFn = () => {
|
||||||
const idx = this.cleanUpFns.indexOf(cleanUpFn);
|
const idx = this.cleanUpFns.indexOf(cleanUpFn);
|
||||||
if (idx !== -1) {
|
if (idx !== -1) {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "yarn clean-dist",
|
"prebuild": "yarn clean-dist",
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"build-watch": "yarn tsc -- --watch",
|
"build-watch": "yarn tsc --watch",
|
||||||
"clean-dist": "node --eval \"require('shelljs').rm('-rf', 'dist')\"",
|
"clean-dist": "node --eval \"require('shelljs').rm('-rf', 'dist')\"",
|
||||||
"dev": "concurrently --kill-others --raw --success first \"yarn build-watch\" \"yarn test-watch\"",
|
"dev": "concurrently --kill-others --raw --success first \"yarn build-watch\" \"yarn test-watch\"",
|
||||||
"lint": "tslint --project tsconfig.json",
|
"lint": "tslint --project tsconfig.json",
|
||||||
@ -20,26 +20,26 @@
|
|||||||
"test-watch": "nodemon --exec \"yarn ~~test-only\" --watch dist"
|
"test-watch": "nodemon --exec \"yarn ~~test-only\" --watch dist"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"body-parser": "^1.17.2",
|
"body-parser": "^1.18.2",
|
||||||
"express": "^4.14.1",
|
"express": "^4.15.4",
|
||||||
"jasmine": "^2.5.3",
|
"jasmine": "^2.8.0",
|
||||||
"jsonwebtoken": "^7.3.0",
|
"jsonwebtoken": "^8.0.1",
|
||||||
"shelljs": "^0.7.6"
|
"shelljs": "^0.7.8",
|
||||||
|
"tslib": "^1.7.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/body-parser": "^1.16.4",
|
"@types/body-parser": "^1.16.5",
|
||||||
"@types/express": "^4.0.35",
|
"@types/express": "^4.0.37",
|
||||||
"@types/jasmine": "^2.5.43",
|
"@types/jasmine": "^2.6.0",
|
||||||
"@types/jsonwebtoken": "^7.2.0",
|
"@types/jsonwebtoken": "^7.2.3",
|
||||||
"@types/node": "^7.0.5",
|
"@types/node": "^8.0.30",
|
||||||
"@types/shelljs": "^0.7.0",
|
"@types/shelljs": "^0.7.4",
|
||||||
"@types/supertest": "^2.0.0",
|
"@types/supertest": "^2.0.3",
|
||||||
"concurrently": "^3.3.0",
|
"concurrently": "^3.5.0",
|
||||||
"eslint": "^3.15.0",
|
"nodemon": "^1.12.1",
|
||||||
"eslint-plugin-jasmine": "^2.2.0",
|
|
||||||
"nodemon": "^1.11.0",
|
|
||||||
"supertest": "^3.0.0",
|
"supertest": "^3.0.0",
|
||||||
"tslint": "^4.4.2",
|
"tslint": "^5.7.0",
|
||||||
"typescript": "^2.1.6"
|
"tslint-jasmine-noSkipOrFocus": "^1.0.8",
|
||||||
|
"typescript": "^2.5.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,8 @@ describe('BuildCleaner', () => {
|
|||||||
let cleanerGetExistingBuildNumbersSpy: jasmine.Spy;
|
let cleanerGetExistingBuildNumbersSpy: jasmine.Spy;
|
||||||
let cleanerGetOpenPrNumbersSpy: jasmine.Spy;
|
let cleanerGetOpenPrNumbersSpy: jasmine.Spy;
|
||||||
let cleanerRemoveUnnecessaryBuildsSpy: jasmine.Spy;
|
let cleanerRemoveUnnecessaryBuildsSpy: jasmine.Spy;
|
||||||
let existingBuildsDeferred: {resolve: Function, reject: Function};
|
let existingBuildsDeferred: {resolve: (v?: any) => void, reject: (e?: any) => void};
|
||||||
let openPrsDeferred: {resolve: Function, reject: Function};
|
let openPrsDeferred: {resolve: (v?: any) => void, reject: (e?: any) => void};
|
||||||
let promise: Promise<void>;
|
let promise: Promise<void>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@ -195,7 +195,7 @@ describe('BuildCleaner', () => {
|
|||||||
|
|
||||||
|
|
||||||
describe('getOpenPrNumbers()', () => {
|
describe('getOpenPrNumbers()', () => {
|
||||||
let prDeferred: {resolve: Function, reject: Function};
|
let prDeferred: {resolve: (v: any) => void, reject: (v: any) => void};
|
||||||
let promise: Promise<number[]>;
|
let promise: Promise<number[]>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@ -277,7 +277,10 @@ describe('BuildCleaner', () => {
|
|||||||
|
|
||||||
it('should catch errors and log them', () => {
|
it('should catch errors and log them', () => {
|
||||||
const consoleErrorSpy = spyOn(console, 'error');
|
const consoleErrorSpy = spyOn(console, 'error');
|
||||||
shellRmSpy.and.callFake(() => { throw 'Test'; });
|
shellRmSpy.and.callFake(() => {
|
||||||
|
// tslint:disable-next-line: no-string-throw
|
||||||
|
throw 'Test';
|
||||||
|
});
|
||||||
|
|
||||||
(cleaner as any).removeDir('/foo/bar');
|
(cleaner as any).removeDir('/foo/bar');
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ describe('GithubApi', () => {
|
|||||||
|
|
||||||
|
|
||||||
it('should not pass data to \'request()\'', () => {
|
it('should not pass data to \'request()\'', () => {
|
||||||
(api.get as Function)('foo', {}, {});
|
(api.get as any)('foo', {}, {});
|
||||||
|
|
||||||
expect(apiRequestSpy).toHaveBeenCalled();
|
expect(apiRequestSpy).toHaveBeenCalled();
|
||||||
expect(apiRequestSpy.calls.argsFor(0)[2]).toBeUndefined();
|
expect(apiRequestSpy.calls.argsFor(0)[2]).toBeUndefined();
|
||||||
@ -144,7 +144,7 @@ describe('GithubApi', () => {
|
|||||||
|
|
||||||
|
|
||||||
describe('getPaginated()', () => {
|
describe('getPaginated()', () => {
|
||||||
let deferreds: {resolve: Function, reject: Function}[];
|
let deferreds: {resolve: (v: any) => void, reject: (v: any) => void}[];
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
deferreds = [];
|
deferreds = [];
|
||||||
@ -292,7 +292,7 @@ describe('GithubApi', () => {
|
|||||||
|
|
||||||
|
|
||||||
describe('onResponse', () => {
|
describe('onResponse', () => {
|
||||||
let promise: Promise<Object>;
|
let promise: Promise<object>;
|
||||||
let respond: (statusCode: number) => IncomingMessage;
|
let respond: (statusCode: number) => IncomingMessage;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@ -22,7 +22,7 @@ describe('GithubPullRequests', () => {
|
|||||||
|
|
||||||
describe('addComment()', () => {
|
describe('addComment()', () => {
|
||||||
let prs: GithubPullRequests;
|
let prs: GithubPullRequests;
|
||||||
let deferred: {resolve: Function, reject: Function};
|
let deferred: {resolve: (v: any) => void, reject: (v: any) => void};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
prs = new GithubPullRequests('12345', 'foo/bar');
|
prs = new GithubPullRequests('12345', 'foo/bar');
|
||||||
|
@ -223,6 +223,7 @@ describe('BuildCreator', () => {
|
|||||||
|
|
||||||
|
|
||||||
it('should reject with an UploadError', done => {
|
it('should reject with an UploadError', done => {
|
||||||
|
// tslint:disable-next-line: no-string-throw
|
||||||
shellMkdirSpy.and.callFake(() => { throw 'Test'; });
|
shellMkdirSpy.and.callFake(() => { throw 'Test'; });
|
||||||
bc.create(pr, sha, archive, isPublic).catch(err => {
|
bc.create(pr, sha, archive, isPublic).catch(err => {
|
||||||
expectToBeUploadError(err, 500, `Error while uploading to directory: ${shaDir}\nTest`);
|
expectToBeUploadError(err, 500, `Error while uploading to directory: ${shaDir}\nTest`);
|
||||||
@ -407,6 +408,7 @@ describe('BuildCreator', () => {
|
|||||||
|
|
||||||
|
|
||||||
it('should reject with an UploadError', done => {
|
it('should reject with an UploadError', done => {
|
||||||
|
// tslint:disable-next-line: no-string-throw
|
||||||
shellMvSpy.and.callFake(() => { throw 'Test'; });
|
shellMvSpy.and.callFake(() => { throw 'Test'; });
|
||||||
bc.updatePrVisibility(pr, makePublic).catch(err => {
|
bc.updatePrVisibility(pr, makePublic).catch(err => {
|
||||||
expectToBeUploadError(err, 500, `Error while making PR ${pr} ${makePublic ? 'public' : 'hidden'}.\nTest`);
|
expectToBeUploadError(err, 500, `Error while making PR ${pr} ${makePublic ? 'public' : 'hidden'}.\nTest`);
|
||||||
@ -434,11 +436,11 @@ describe('BuildCreator', () => {
|
|||||||
|
|
||||||
describe('exists()', () => {
|
describe('exists()', () => {
|
||||||
let fsAccessSpy: jasmine.Spy;
|
let fsAccessSpy: jasmine.Spy;
|
||||||
let fsAccessCbs: Function[];
|
let fsAccessCbs: ((v?: any) => void)[];
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fsAccessCbs = [];
|
fsAccessCbs = [];
|
||||||
fsAccessSpy = spyOn(fs, 'access').and.callFake((_: string, cb: Function) => fsAccessCbs.push(cb));
|
fsAccessSpy = spyOn(fs, 'access').and.callFake((_: string, cb: (v?: any) => void) => fsAccessCbs.push(cb));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -482,7 +484,7 @@ describe('BuildCreator', () => {
|
|||||||
let shellChmodSpy: jasmine.Spy;
|
let shellChmodSpy: jasmine.Spy;
|
||||||
let shellRmSpy: jasmine.Spy;
|
let shellRmSpy: jasmine.Spy;
|
||||||
let cpExecSpy: jasmine.Spy;
|
let cpExecSpy: jasmine.Spy;
|
||||||
let cpExecCbs: Function[];
|
let cpExecCbs: ((...args: any[]) => void)[];
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cpExecCbs = [];
|
cpExecCbs = [];
|
||||||
@ -490,7 +492,7 @@ describe('BuildCreator', () => {
|
|||||||
consoleWarnSpy = spyOn(console, 'warn');
|
consoleWarnSpy = spyOn(console, 'warn');
|
||||||
shellChmodSpy = spyOn(shell, 'chmod');
|
shellChmodSpy = spyOn(shell, 'chmod');
|
||||||
shellRmSpy = spyOn(shell, 'rm');
|
shellRmSpy = spyOn(shell, 'rm');
|
||||||
cpExecSpy = spyOn(cp, 'exec').and.callFake((_: string, cb: Function) => cpExecCbs.push(cb));
|
cpExecSpy = spyOn(cp, 'exec').and.callFake((_: string, cb: (...args: any[]) => void) => cpExecCbs.push(cb));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -556,7 +558,11 @@ describe('BuildCreator', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
shellChmodSpy.and.callFake(() => { throw 'Test'; });
|
shellChmodSpy.and.callFake(() => {
|
||||||
|
// tslint:disable-next-line: no-string-throw
|
||||||
|
throw 'Test';
|
||||||
|
});
|
||||||
|
|
||||||
cpExecCbs[0]();
|
cpExecCbs[0]();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -569,7 +575,11 @@ describe('BuildCreator', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
shellRmSpy.and.callFake(() => { throw 'Test'; });
|
shellRmSpy.and.callFake(() => {
|
||||||
|
// tslint:disable-next-line: no-string-throw
|
||||||
|
throw 'Test';
|
||||||
|
});
|
||||||
|
|
||||||
cpExecCbs[0]();
|
cpExecCbs[0]();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ describe('uploadServerFactory', () => {
|
|||||||
|
|
||||||
it('should log the server address info on \'listening\'', () => {
|
it('should log the server address info on \'listening\'', () => {
|
||||||
const consoleInfoSpy = spyOn(console, 'info');
|
const consoleInfoSpy = spyOn(console, 'info');
|
||||||
const server = createUploadServer('builds/dir');
|
const server = createUploadServer();
|
||||||
server.address = () => ({address: 'foo', family: '', port: 1337});
|
server.address = () => ({address: 'foo', family: '', port: 1337});
|
||||||
|
|
||||||
expect(consoleInfoSpy).not.toHaveBeenCalled();
|
expect(consoleInfoSpy).not.toHaveBeenCalled();
|
||||||
|
@ -1,25 +1,66 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"alwaysStrict": true,
|
/* Basic Options */
|
||||||
"forceConsistentCasingInFileNames": true,
|
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
|
||||||
"inlineSourceMap": true,
|
"module": "commonjs", /* Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||||
"lib": [
|
"lib": [
|
||||||
"es2016"
|
"es2015",
|
||||||
],
|
"es2016.array.include"
|
||||||
"noImplicitAny": true,
|
], /* Specify library files to be included in the compilation: */
|
||||||
"noImplicitReturns": true,
|
// "allowJs": true, /* Allow javascript files to be compiled. */
|
||||||
"noImplicitThis": true,
|
// "checkJs": true, /* Report errors in .js files. */
|
||||||
"noUnusedLocals": true,
|
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
||||||
"noUnusedParameters": true,
|
// "declaration": true, /* Generates corresponding '.d.ts' file. */
|
||||||
"outDir": "dist",
|
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
||||||
"pretty": true,
|
// "outFile": "./", /* Concatenate and emit output to single file. */
|
||||||
"rootDir": ".",
|
"outDir": "dist", /* Redirect output structure to the directory. */
|
||||||
"skipLibCheck": true,
|
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||||
"strictNullChecks": true,
|
// "removeComments": true, /* Do not emit comments to output. */
|
||||||
"target": "es5",
|
// "noEmit": true, /* Do not emit outputs. */
|
||||||
|
"importHelpers": true, /* Import emit helpers from 'tslib'. */
|
||||||
|
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
||||||
|
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
||||||
|
|
||||||
|
/* Strict Type-Checking Options */
|
||||||
|
"strict": true, /* Enable all strict type-checking options. */
|
||||||
|
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
||||||
|
// "strictNullChecks": true, /* Enable strict null checks. */
|
||||||
|
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
||||||
|
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
||||||
|
|
||||||
|
/* Additional Checks */
|
||||||
|
"noUnusedLocals": true, /* Report errors on unused locals. */
|
||||||
|
"noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||||
|
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||||
|
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||||
|
|
||||||
|
/* Module Resolution Options */
|
||||||
|
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||||
|
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||||
|
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||||
|
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"node_modules/@types"
|
"node_modules/@types"
|
||||||
]
|
], /* List of folders to include type definitions from. */
|
||||||
|
// "types": [], /* Type declaration files to be included in compilation. */
|
||||||
|
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
||||||
|
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
||||||
|
|
||||||
|
/* Source Map Options */
|
||||||
|
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
||||||
|
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||||
|
"inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
||||||
|
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
||||||
|
|
||||||
|
/* Experimental Options */
|
||||||
|
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||||
|
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||||
|
|
||||||
|
/* Other */
|
||||||
|
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
|
||||||
|
"newLine": "LF", /* Use the specified end of line sequence to be used when emitting files: "crlf" (windows) or "lf" (unix). */
|
||||||
|
"pretty": true, /* Stylize errors and messages using color and context. */
|
||||||
|
"skipLibCheck": true /* Skip type checking of all declaration files (*.d.ts). */
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"lib/**/*",
|
"lib/**/*",
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
{
|
{
|
||||||
"extends": "tslint:recommended",
|
"defaultSeverity": "error",
|
||||||
|
"extends": [
|
||||||
|
"tslint:recommended"
|
||||||
|
],
|
||||||
|
"jsRules": {},
|
||||||
"rules": {
|
"rules": {
|
||||||
"array-type": [true, "array"],
|
"array-type": [true, "array"],
|
||||||
"arrow-parens": [true, "ban-single-arg-parens"],
|
"arrow-parens": [true, "ban-single-arg-parens"],
|
||||||
@ -7,9 +11,14 @@
|
|||||||
"max-classes-per-file": [true, 4],
|
"max-classes-per-file": [true, 4],
|
||||||
"no-consecutive-blank-lines": [true, 2],
|
"no-consecutive-blank-lines": [true, 2],
|
||||||
"no-console": [false],
|
"no-console": [false],
|
||||||
|
"no-focused-test": true,
|
||||||
"no-namespace": [true, "allow-declarations"],
|
"no-namespace": [true, "allow-declarations"],
|
||||||
|
"no-skipped-test": true,
|
||||||
"no-string-literal": false,
|
"no-string-literal": false,
|
||||||
"quotemark": [true, "single"],
|
"quotemark": [true, "single"],
|
||||||
"variable-name": [true, "ban-keywords", "check-format", "allow-leading-underscore"]
|
"variable-name": [true, "ban-keywords", "check-format", "allow-leading-underscore"]
|
||||||
}
|
},
|
||||||
|
"rulesDirectory": [
|
||||||
|
"node_modules/tslint-jasmine-noSkipOrFocus"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -6,10 +6,9 @@ export AIO_GITHUB_TOKEN=$(head -c -1 /aio-secrets/GITHUB_TOKEN 2>/dev/null || ec
|
|||||||
export AIO_PREVIEW_DEPLOYMENT_TOKEN=$(head -c -1 /aio-secrets/PREVIEW_DEPLOYMENT_TOKEN 2>/dev/null || echo "MISSING_PREVIEW_DEPLOYMENT_TOKEN")
|
export AIO_PREVIEW_DEPLOYMENT_TOKEN=$(head -c -1 /aio-secrets/PREVIEW_DEPLOYMENT_TOKEN 2>/dev/null || echo "MISSING_PREVIEW_DEPLOYMENT_TOKEN")
|
||||||
|
|
||||||
# Start the upload-server instance
|
# Start the upload-server instance
|
||||||
# TODO(gkalpak): Ideally, the upload server should be run as a non-privileged user.
|
|
||||||
# (Currently, there doesn't seem to be a straight forward way.)
|
|
||||||
action=$([ "$1" == "stop" ] && echo "stop" || echo "start")
|
action=$([ "$1" == "stop" ] && echo "stop" || echo "start")
|
||||||
pm2 $action $AIO_SCRIPTS_JS_DIR/dist/lib/upload-server \
|
pm2 $action $AIO_SCRIPTS_JS_DIR/dist/lib/upload-server \
|
||||||
|
--uid $AIO_WWW_USER \
|
||||||
--log /var/log/aio/upload-server-prod.log \
|
--log /var/log/aio/upload-server-prod.log \
|
||||||
--name aio-upload-server-prod \
|
--name aio-upload-server-prod \
|
||||||
${@:2}
|
${@:2}
|
||||||
|
@ -15,13 +15,12 @@ export AIO_GITHUB_TOKEN=$(head -c -1 /aio-secrets/TEST_GITHUB_TOKEN 2>/dev/null
|
|||||||
export AIO_PREVIEW_DEPLOYMENT_TOKEN=$(head -c -1 /aio-secrets/TEST_PREVIEW_DEPLOYMENT_TOKEN 2>/dev/null || echo "TEST_PREVIEW_DEPLOYMENT_TOKEN")
|
export AIO_PREVIEW_DEPLOYMENT_TOKEN=$(head -c -1 /aio-secrets/TEST_PREVIEW_DEPLOYMENT_TOKEN 2>/dev/null || echo "TEST_PREVIEW_DEPLOYMENT_TOKEN")
|
||||||
|
|
||||||
# Start the upload-server instance
|
# Start the upload-server instance
|
||||||
# TODO(gkalpak): Ideally, the upload server should be run as a non-privileged user.
|
|
||||||
# (Currently, there doesn't seem to be a straight forward way.)
|
|
||||||
appName=aio-upload-server-test
|
appName=aio-upload-server-test
|
||||||
if [[ "$1" == "stop" ]]; then
|
if [[ "$1" == "stop" ]]; then
|
||||||
pm2 delete $appName
|
pm2 delete $appName
|
||||||
else
|
else
|
||||||
pm2 start $AIO_SCRIPTS_JS_DIR/dist/lib/verify-setup/start-test-upload-server.js \
|
pm2 start $AIO_SCRIPTS_JS_DIR/dist/lib/verify-setup/start-test-upload-server.js \
|
||||||
|
--uid $AIO_WWW_USER \
|
||||||
--log /var/log/aio/upload-server-test.log \
|
--log /var/log/aio/upload-server-test.log \
|
||||||
--name $appName \
|
--name $appName \
|
||||||
--no-autorestart \
|
--no-autorestart \
|
||||||
|
@ -9,7 +9,7 @@ VM host to update the preview server based on changes in the source code.
|
|||||||
The script will pull the latest changes from the origin's master branch and examine if there have
|
The script will pull the latest changes from the origin's master branch and examine if there have
|
||||||
been any changes in files inside the preview server source code directory (see below). If there are,
|
been any changes in files inside the preview server source code directory (see below). If there are,
|
||||||
it will create a new image and verify that is works as expected. Finally, it will stop and remove
|
it will create a new image and verify that is works as expected. Finally, it will stop and remove
|
||||||
the old docker container and image, create and new container based on the new image and start it.
|
the old docker container and image, create a new container based on the new image and start it.
|
||||||
|
|
||||||
The script assumes that the preview server source code is in the repository's
|
The script assumes that the preview server source code is in the repository's
|
||||||
`aio/aio-builds-setup/` directory and expects the following inputs:
|
`aio/aio-builds-setup/` directory and expects the following inputs:
|
||||||
|
@ -9,7 +9,7 @@ readonly defaultImageNameAndTag="aio-builds:latest"
|
|||||||
# (Necessary, because only `scripts-js/dist/` is copied to the docker image.)
|
# (Necessary, because only `scripts-js/dist/` is copied to the docker image.)
|
||||||
(
|
(
|
||||||
cd "$SCRIPTS_JS_DIR"
|
cd "$SCRIPTS_JS_DIR"
|
||||||
yarn install
|
yarn install --frozen-lockfile --non-interactive
|
||||||
yarn build
|
yarn build
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -7,6 +7,6 @@ source "`dirname $0`/_env.sh"
|
|||||||
# Test `scripts-js/`
|
# Test `scripts-js/`
|
||||||
(
|
(
|
||||||
cd "$SCRIPTS_JS_DIR"
|
cd "$SCRIPTS_JS_DIR"
|
||||||
yarn install
|
yarn install --frozen-lockfile --non-interactive
|
||||||
yarn test
|
yarn test
|
||||||
)
|
)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
set -eux -o pipefail
|
set -eux -o pipefail
|
||||||
exec 3>&1
|
exec 3>&1
|
||||||
|
|
||||||
echo "[`date`] - Updating the preview server..."
|
echo "\n\n[`date`] - Updating the preview server..."
|
||||||
|
|
||||||
# Input
|
# Input
|
||||||
readonly HOST_REPO_DIR=$1
|
readonly HOST_REPO_DIR=$1
|
||||||
@ -37,7 +37,7 @@ readonly CONTAINER_NAME=aio
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Create and verify a new docker image.
|
# Create and verify a new docker image.
|
||||||
aio/aio-builds-setup/scripts/create-image.sh "$PROVISIONAL_IMAGE_NAME"
|
aio/aio-builds-setup/scripts/create-image.sh "$PROVISIONAL_IMAGE_NAME" --no-cache
|
||||||
readonly imageVerified=$(sudo docker run --dns 127.0.0.1 --rm --volume $HOST_SECRETS_DIR:/aio-secrets:ro "$PROVISIONAL_IMAGE_NAME" /bin/bash -c "aio-init && aio-health-check && aio-verify-setup" >> /dev/fd/3 && echo "true" || echo "false")
|
readonly imageVerified=$(sudo docker run --dns 127.0.0.1 --rm --volume $HOST_SECRETS_DIR:/aio-secrets:ro "$PROVISIONAL_IMAGE_NAME" /bin/bash -c "aio-init && aio-health-check && aio-verify-setup" >> /dev/fd/3 && echo "true" || echo "false")
|
||||||
|
|
||||||
if [[ "$imageVerified" != "true" ]]; then
|
if [[ "$imageVerified" != "true" ]]; then
|
||||||
|
34
aio/content/examples/.gitignore
vendored
34
aio/content/examples/.gitignore
vendored
@ -1,8 +1,23 @@
|
|||||||
# boilerplate files
|
# boilerplate files
|
||||||
|
**/src/environments/environment.prod.ts
|
||||||
|
**/src/environments/environment.ts
|
||||||
|
**/src/assets/.gitkeep
|
||||||
|
**/src/favicon.ico
|
||||||
**/src/styles.css
|
**/src/styles.css
|
||||||
**/src/systemjs-angular-loader.js
|
**/src/systemjs-angular-loader.js
|
||||||
**/src/systemjs.config.js
|
**/src/systemjs.config.js
|
||||||
**/src/tsconfig.json
|
**/src/tsconfig.json
|
||||||
|
**/src/favicon.ico
|
||||||
|
**/src/polyfills.ts
|
||||||
|
**/src/test.ts
|
||||||
|
**/src/tsconfig.app.json
|
||||||
|
**/src/tsconfig.spec.json
|
||||||
|
**/src/typings.d.ts
|
||||||
|
**/e2e/app.po.ts
|
||||||
|
**/e2e/tsconfig.e2e.json
|
||||||
|
**/.angular-cli.json
|
||||||
|
**/.editorconfig
|
||||||
|
**/tsconfig.json
|
||||||
**/bs-config.e2e.json
|
**/bs-config.e2e.json
|
||||||
**/bs-config.json
|
**/bs-config.json
|
||||||
**/package.json
|
**/package.json
|
||||||
@ -15,11 +30,7 @@
|
|||||||
# built files
|
# built files
|
||||||
*.map
|
*.map
|
||||||
_test-output
|
_test-output
|
||||||
protractor-helpers.js
|
|
||||||
*/e2e-spec.js
|
|
||||||
**/*.js
|
**/*.js
|
||||||
**/ts/**/*.js
|
|
||||||
**/js-es6*/**/*.js
|
|
||||||
dist/
|
dist/
|
||||||
|
|
||||||
|
|
||||||
@ -43,24 +54,31 @@ dist/
|
|||||||
**/app/**/*.ajs.js
|
**/app/**/*.ajs.js
|
||||||
|
|
||||||
# aot
|
# aot
|
||||||
*/aot/**/*
|
**/*.ngsummary.json
|
||||||
!*/aot/bs-config.json
|
|
||||||
!*/aot/index.html
|
|
||||||
!rollup-config.js
|
!rollup-config.js
|
||||||
|
aot-compiler/**/*.d.ts
|
||||||
|
aot-compiler/**/*.factory.d.ts
|
||||||
|
|
||||||
# i18n
|
# i18n
|
||||||
!i18n/src/systemjs-text-plugin.js
|
!i18n/src/systemjs-text-plugin.js
|
||||||
|
|
||||||
# testing
|
# testing
|
||||||
!testing/src/browser-test-shim.js
|
!testing/src/browser-test-shim.js
|
||||||
!testing/karma*.js
|
|
||||||
|
|
||||||
# webpack
|
# webpack
|
||||||
!webpack/**/config/*.js
|
!webpack/**/config/*.js
|
||||||
!webpack/**/*webpack*.js
|
!webpack/**/*webpack*.js
|
||||||
|
!webpack/src/polyfills.ts
|
||||||
|
|
||||||
# styleguide
|
# styleguide
|
||||||
!styleguide/src/systemjs.custom.js
|
!styleguide/src/systemjs.custom.js
|
||||||
|
|
||||||
|
# universal
|
||||||
|
!universal/webpack.server.config.js
|
||||||
|
|
||||||
# plunkers
|
# plunkers
|
||||||
*plnkr.no-link.html
|
*plnkr.no-link.html
|
||||||
|
|
||||||
|
# ngUpgrade testing
|
||||||
|
!upgrade-phonecat-*/**/karma.conf.js
|
||||||
|
!upgrade-phonecat-*/**/karma-test-shim.js
|
||||||
|
@ -83,7 +83,7 @@ describe('AngularJS to Angular Quick Reference Tests', function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testPosterButtonClick(expectedButtonText: string, isDisplayed: boolean) {
|
function testPosterButtonClick(expectedButtonText: string, isDisplayed: boolean) {
|
||||||
let posterButton = element(by.css('movie-list tr > th > button'));
|
let posterButton = element(by.css('app-movie-list tr > th > button'));
|
||||||
expect(posterButton.getText()).toBe(expectedButtonText);
|
expect(posterButton.getText()).toBe(expectedButtonText);
|
||||||
|
|
||||||
posterButton.click().then(function () {
|
posterButton.click().then(function () {
|
||||||
@ -92,11 +92,11 @@ describe('AngularJS to Angular Quick Reference Tests', function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getMovieRows() {
|
function getMovieRows() {
|
||||||
return element.all(by.css('movie-list tbody > tr'));
|
return element.all(by.css('app-movie-list tbody > tr'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function testFavoriteHero(heroName: string, expectedLabel: string) {
|
function testFavoriteHero(heroName: string, expectedLabel: string) {
|
||||||
let movieListComp = element(by.tagName('movie-list'));
|
let movieListComp = element(by.tagName('app-movie-list'));
|
||||||
let heroInput = movieListComp.element(by.tagName('input'));
|
let heroInput = movieListComp.element(by.tagName('input'));
|
||||||
let favoriteHeroLabel = movieListComp.element(by.tagName('h3'));
|
let favoriteHeroLabel = movieListComp.element(by.tagName('h3'));
|
||||||
let resultLabel = movieListComp.element(by.css('span > p'));
|
let resultLabel = movieListComp.element(by.css('span > p'));
|
@ -4,7 +4,7 @@ import { MovieService } from './movie.service';
|
|||||||
import { IMovie } from './movie';
|
import { IMovie } from './movie';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-app',
|
selector: 'app-root',
|
||||||
templateUrl: './app.component.html',
|
templateUrl: './app.component.html',
|
||||||
styleUrls: [ './app.component.css' ],
|
styleUrls: [ './app.component.css' ],
|
||||||
providers: [ MovieService ]
|
providers: [ MovieService ]
|
||||||
|
@ -8,7 +8,7 @@ import { MovieService } from './movie.service';
|
|||||||
|
|
||||||
// #docregion component
|
// #docregion component
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'movie-list',
|
selector: 'app-movie-list',
|
||||||
templateUrl: './movie-list.component.html',
|
templateUrl: './movie-list.component.html',
|
||||||
// #docregion style-url
|
// #docregion style-url
|
||||||
styleUrls: [ './movie-list.component.css' ],
|
styleUrls: [ './movie-list.component.css' ],
|
||||||
|
@ -8,7 +8,7 @@ export class MovieService {
|
|||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
hero: 'Celeritas',
|
hero: 'Celeritas',
|
||||||
imageurl: 'images/hero.png',
|
imageurl: 'assets/images/hero.png',
|
||||||
movieId: 1,
|
movieId: 1,
|
||||||
mpaa: 'pg-13',
|
mpaa: 'pg-13',
|
||||||
releaseDate: '2015-12-19T00:00:00',
|
releaseDate: '2015-12-19T00:00:00',
|
||||||
@ -19,7 +19,7 @@ export class MovieService {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
hero: 'Mr. Nice',
|
hero: 'Mr. Nice',
|
||||||
imageurl: 'images/villain.png',
|
imageurl: 'assets/images/villain.png',
|
||||||
movieId: 2,
|
movieId: 2,
|
||||||
mpaa: 'pg-13',
|
mpaa: 'pg-13',
|
||||||
releaseDate: '2015-12-18T00:00:00',
|
releaseDate: '2015-12-18T00:00:00',
|
||||||
@ -30,7 +30,7 @@ export class MovieService {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
hero: 'Angular',
|
hero: 'Angular',
|
||||||
imageurl: 'images/ng-logo.png',
|
imageurl: 'assets/images/ng-logo.png',
|
||||||
movieId: 3,
|
movieId: 3,
|
||||||
mpaa: 'pg-13',
|
mpaa: 'pg-13',
|
||||||
releaseDate: '2015-12-17T00:00:00',
|
releaseDate: '2015-12-17T00:00:00',
|
||||||
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<base href="/">
|
<base href="/">
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
@ -8,21 +8,10 @@
|
|||||||
<!-- #docregion style -->
|
<!-- #docregion style -->
|
||||||
<link rel="stylesheet" href="styles.css">
|
<link rel="stylesheet" href="styles.css">
|
||||||
<!-- #enddocregion style -->
|
<!-- #enddocregion style -->
|
||||||
|
|
||||||
<!-- Polyfills -->
|
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
|
||||||
|
|
||||||
<script src="node_modules/zone.js/dist/zone.js"></script>
|
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
|
||||||
|
|
||||||
<script src="systemjs.config.js"></script>
|
|
||||||
<script>
|
|
||||||
System.import('main.js').catch(function(err){ console.error(err); });
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<my-app>Loading app...</my-app>
|
<app-root></app-root>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
// #docregion
|
// #docregion
|
||||||
|
import { enableProdMode } from '@angular/core';
|
||||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||||
|
|
||||||
import { AppModule } from './app/app.module';
|
import { AppModule } from './app/app.module';
|
||||||
|
import { environment } from './environments/environment';
|
||||||
|
|
||||||
|
if (environment.production) {
|
||||||
|
enableProdMode();
|
||||||
|
}
|
||||||
|
|
||||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||||
|
@ -29,7 +29,7 @@ describe('Animation Tests', () => {
|
|||||||
let host: ElementFinder;
|
let host: ElementFinder;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
host = element(by.css('hero-list-basic'));
|
host = element(by.css('app-hero-list-basic'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('animates between active and inactive', () => {
|
it('animates between active and inactive', () => {
|
||||||
@ -58,7 +58,7 @@ describe('Animation Tests', () => {
|
|||||||
let host: ElementFinder;
|
let host: ElementFinder;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
host = element(by.css('hero-list-inline-styles'));
|
host = element(by.css('app-hero-list-inline-styles'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('are not kept after animation', () => {
|
it('are not kept after animation', () => {
|
||||||
@ -79,7 +79,7 @@ describe('Animation Tests', () => {
|
|||||||
let host: ElementFinder;
|
let host: ElementFinder;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
host = element(by.css('hero-list-combined-transitions'));
|
host = element(by.css('app-hero-list-combined-transitions'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('animates between active and inactive', () => {
|
it('animates between active and inactive', () => {
|
||||||
@ -108,7 +108,7 @@ describe('Animation Tests', () => {
|
|||||||
let host: ElementFinder;
|
let host: ElementFinder;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
host = element(by.css('hero-list-twoway'));
|
host = element(by.css('app-hero-list-twoway'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('animates between active and inactive', () => {
|
it('animates between active and inactive', () => {
|
||||||
@ -137,7 +137,7 @@ describe('Animation Tests', () => {
|
|||||||
let host: ElementFinder;
|
let host: ElementFinder;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
host = element(by.css('hero-list-enter-leave'));
|
host = element(by.css('app-hero-list-enter-leave'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('adds and removes element', () => {
|
it('adds and removes element', () => {
|
||||||
@ -157,7 +157,7 @@ describe('Animation Tests', () => {
|
|||||||
let host: ElementFinder;
|
let host: ElementFinder;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
host = element(by.css('hero-list-enter-leave-states'));
|
host = element(by.css('app-hero-list-enter-leave-states'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('adds and removes and animates between active and inactive', () => {
|
it('adds and removes and animates between active and inactive', () => {
|
||||||
@ -186,7 +186,7 @@ describe('Animation Tests', () => {
|
|||||||
let host: ElementFinder;
|
let host: ElementFinder;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
host = element(by.css('hero-list-auto'));
|
host = element(by.css('app-hero-list-auto'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('adds and removes element', () => {
|
it('adds and removes element', () => {
|
||||||
@ -206,7 +206,7 @@ describe('Animation Tests', () => {
|
|||||||
let host: ElementFinder;
|
let host: ElementFinder;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
host = element(by.css('hero-list-timings'));
|
host = element(by.css('app-hero-list-timings'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('adds and removes element', () => {
|
it('adds and removes element', () => {
|
||||||
@ -227,7 +227,7 @@ describe('Animation Tests', () => {
|
|||||||
let host: ElementFinder;
|
let host: ElementFinder;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
host = element(by.css('hero-list-multistep'));
|
host = element(by.css('app-hero-list-multistep'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('adds and removes element', () => {
|
it('adds and removes element', () => {
|
||||||
@ -248,7 +248,7 @@ describe('Animation Tests', () => {
|
|||||||
let host: ElementFinder;
|
let host: ElementFinder;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
host = element(by.css('hero-list-groups'));
|
host = element(by.css('app-hero-list-groups'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('adds and removes element', () => {
|
it('adds and removes element', () => {
|
||||||
@ -269,7 +269,7 @@ describe('Animation Tests', () => {
|
|||||||
let host: ElementFinder;
|
let host: ElementFinder;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
host = element(by.css('hero-list-basic'));
|
host = element(by.css('app-hero-list-basic'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('animates between active and inactive', () => {
|
it('animates between active and inactive', () => {
|
||||||
@ -335,17 +335,17 @@ describe('Animation Tests', () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getBoundingClientWidth(el: ElementFinder): promise.Promise<number> {
|
function getBoundingClientWidth(el: ElementFinder) {
|
||||||
return browser.executeScript(
|
return browser.executeScript(
|
||||||
'return arguments[0].getBoundingClientRect().width',
|
'return arguments[0].getBoundingClientRect().width',
|
||||||
el.getWebElement()
|
el.getWebElement()
|
||||||
);
|
) as PromiseLike<number>;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOffsetWidth(el: ElementFinder): promise.Promise<number> {
|
function getOffsetWidth(el: ElementFinder) {
|
||||||
return browser.executeScript(
|
return browser.executeScript(
|
||||||
'return arguments[0].offsetWidth',
|
'return arguments[0].offsetWidth',
|
||||||
el.getWebElement()
|
el.getWebElement()
|
||||||
);
|
) as PromiseLike<number>;
|
||||||
}
|
}
|
||||||
});
|
});
|
@ -1,5 +1,6 @@
|
|||||||
// #docregion animations-module
|
// #docplaster
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
|
// #docregion animations-module
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
// #enddocregion animations-module
|
// #enddocregion animations-module
|
||||||
@ -15,11 +16,12 @@ import { HeroListAutoComponent } from './hero-list-auto.component';
|
|||||||
import { HeroListGroupsComponent } from './hero-list-groups.component';
|
import { HeroListGroupsComponent } from './hero-list-groups.component';
|
||||||
import { HeroListMultistepComponent } from './hero-list-multistep.component';
|
import { HeroListMultistepComponent } from './hero-list-multistep.component';
|
||||||
import { HeroListTimingsComponent } from './hero-list-timings.component';
|
import { HeroListTimingsComponent } from './hero-list-timings.component';
|
||||||
|
// #docregion animations-module
|
||||||
|
|
||||||
// #docregion animation-module
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [ BrowserModule, BrowserAnimationsModule ],
|
imports: [ BrowserModule, BrowserAnimationsModule ],
|
||||||
// #enddocregion animation-module
|
// ... more stuff ...
|
||||||
|
// #enddocregion animations-module
|
||||||
declarations: [
|
declarations: [
|
||||||
HeroTeamBuilderComponent,
|
HeroTeamBuilderComponent,
|
||||||
HeroListBasicComponent,
|
HeroListBasicComponent,
|
||||||
@ -34,5 +36,8 @@ import { HeroListTimingsComponent } from './hero-list-timings.component';
|
|||||||
HeroListGroupsComponent
|
HeroListGroupsComponent
|
||||||
],
|
],
|
||||||
bootstrap: [ HeroTeamBuilderComponent ]
|
bootstrap: [ HeroTeamBuilderComponent ]
|
||||||
|
// #docregion animations-module
|
||||||
})
|
})
|
||||||
export class AppModule { }
|
export class AppModule { }
|
||||||
|
// #enddocregion animations-module
|
||||||
|
|
||||||
|
@ -10,10 +10,10 @@ import {
|
|||||||
transition
|
transition
|
||||||
} from '@angular/animations';
|
} from '@angular/animations';
|
||||||
|
|
||||||
import { Heroes } from './hero.service';
|
import { Hero } from './hero.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-list-auto',
|
selector: 'app-hero-list-auto',
|
||||||
// #docregion template
|
// #docregion template
|
||||||
template: `
|
template: `
|
||||||
<ul>
|
<ul>
|
||||||
@ -43,5 +43,5 @@ import { Heroes } from './hero.service';
|
|||||||
// #enddocregion animationdef
|
// #enddocregion animationdef
|
||||||
})
|
})
|
||||||
export class HeroListAutoComponent {
|
export class HeroListAutoComponent {
|
||||||
@Input() heroes: Heroes;
|
@Input() heroes: Hero[];
|
||||||
}
|
}
|
||||||
|
@ -14,10 +14,10 @@ import {
|
|||||||
} from '@angular/animations';
|
} from '@angular/animations';
|
||||||
// #enddocregion imports
|
// #enddocregion imports
|
||||||
|
|
||||||
import { Heroes } from './hero.service';
|
import { Hero } from './hero.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-list-basic',
|
selector: 'app-hero-list-basic',
|
||||||
// #enddocregion
|
// #enddocregion
|
||||||
/* The click event calls hero.toggleState(), which
|
/* The click event calls hero.toggleState(), which
|
||||||
* causes the state of that hero to switch from
|
* causes the state of that hero to switch from
|
||||||
@ -66,5 +66,5 @@ import { Heroes } from './hero.service';
|
|||||||
// #enddocregion animationdef
|
// #enddocregion animationdef
|
||||||
})
|
})
|
||||||
export class HeroListBasicComponent {
|
export class HeroListBasicComponent {
|
||||||
@Input() heroes: Heroes;
|
@Input() heroes: Hero[];
|
||||||
}
|
}
|
||||||
|
@ -13,10 +13,10 @@ import {
|
|||||||
} from '@angular/animations';
|
} from '@angular/animations';
|
||||||
// #enddocregion imports
|
// #enddocregion imports
|
||||||
|
|
||||||
import { Heroes } from './hero.service';
|
import { Hero } from './hero.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-list-combined-transitions',
|
selector: 'app-hero-list-combined-transitions',
|
||||||
// #docregion template
|
// #docregion template
|
||||||
template: `
|
template: `
|
||||||
<ul>
|
<ul>
|
||||||
@ -55,5 +55,5 @@ import { Heroes } from './hero.service';
|
|||||||
// #enddocregion animationdef
|
// #enddocregion animationdef
|
||||||
})
|
})
|
||||||
export class HeroListCombinedTransitionsComponent {
|
export class HeroListCombinedTransitionsComponent {
|
||||||
@Input() heroes: Heroes;
|
@Input() heroes: Hero[];
|
||||||
}
|
}
|
||||||
|
@ -10,10 +10,10 @@ import {
|
|||||||
transition
|
transition
|
||||||
} from '@angular/animations';
|
} from '@angular/animations';
|
||||||
|
|
||||||
import { Heroes } from './hero.service';
|
import { Hero } from './hero.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-list-enter-leave-states',
|
selector: 'app-hero-list-enter-leave-states',
|
||||||
// #docregion template
|
// #docregion template
|
||||||
template: `
|
template: `
|
||||||
<ul>
|
<ul>
|
||||||
@ -59,5 +59,5 @@ import { Heroes } from './hero.service';
|
|||||||
// #enddocregion animationdef
|
// #enddocregion animationdef
|
||||||
})
|
})
|
||||||
export class HeroListEnterLeaveStatesComponent {
|
export class HeroListEnterLeaveStatesComponent {
|
||||||
@Input() heroes: Heroes;
|
@Input() heroes: Hero[];
|
||||||
}
|
}
|
||||||
|
@ -10,10 +10,10 @@ import {
|
|||||||
transition
|
transition
|
||||||
} from '@angular/animations';
|
} from '@angular/animations';
|
||||||
|
|
||||||
import { Heroes } from './hero.service';
|
import { Hero } from './hero.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-list-enter-leave',
|
selector: 'app-hero-list-enter-leave',
|
||||||
// #docregion template
|
// #docregion template
|
||||||
template: `
|
template: `
|
||||||
<ul>
|
<ul>
|
||||||
@ -47,5 +47,5 @@ import { Heroes } from './hero.service';
|
|||||||
// #enddocregion animationdef
|
// #enddocregion animationdef
|
||||||
})
|
})
|
||||||
export class HeroListEnterLeaveComponent {
|
export class HeroListEnterLeaveComponent {
|
||||||
@Input() heroes: Heroes;
|
@Input() heroes: Hero[];
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,10 @@ import {
|
|||||||
group
|
group
|
||||||
} from '@angular/animations';
|
} from '@angular/animations';
|
||||||
|
|
||||||
import { Heroes } from './hero.service';
|
import { Hero } from './hero.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-list-groups',
|
selector: 'app-hero-list-groups',
|
||||||
template: `
|
template: `
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="let hero of heroes"
|
<li *ngFor="let hero of heroes"
|
||||||
@ -76,5 +76,5 @@ import { Heroes } from './hero.service';
|
|||||||
// #enddocregion animationdef
|
// #enddocregion animationdef
|
||||||
})
|
})
|
||||||
export class HeroListGroupsComponent {
|
export class HeroListGroupsComponent {
|
||||||
@Input() heroes: Heroes;
|
@Input() heroes: Hero[];
|
||||||
}
|
}
|
||||||
|
@ -12,10 +12,10 @@ import {
|
|||||||
} from '@angular/animations';
|
} from '@angular/animations';
|
||||||
// #enddocregion imports
|
// #enddocregion imports
|
||||||
|
|
||||||
import { Heroes } from './hero.service';
|
import { Hero } from './hero.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-list-inline-styles',
|
selector: 'app-hero-list-inline-styles',
|
||||||
// #docregion template
|
// #docregion template
|
||||||
template: `
|
template: `
|
||||||
<ul>
|
<ul>
|
||||||
@ -56,5 +56,5 @@ import { Heroes } from './hero.service';
|
|||||||
// #enddocregion animationdef
|
// #enddocregion animationdef
|
||||||
})
|
})
|
||||||
export class HeroListInlineStylesComponent {
|
export class HeroListInlineStylesComponent {
|
||||||
@Input() heroes: Heroes;
|
@Input() heroes: Hero[];
|
||||||
}
|
}
|
||||||
|
@ -12,10 +12,10 @@ import {
|
|||||||
AnimationEvent
|
AnimationEvent
|
||||||
} from '@angular/animations';
|
} from '@angular/animations';
|
||||||
|
|
||||||
import { Heroes } from './hero.service';
|
import { Hero } from './hero.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-list-multistep',
|
selector: 'app-hero-list-multistep',
|
||||||
// #docregion template
|
// #docregion template
|
||||||
template: `
|
template: `
|
||||||
<ul>
|
<ul>
|
||||||
@ -59,7 +59,7 @@ import { Heroes } from './hero.service';
|
|||||||
// #enddocregion animationdef
|
// #enddocregion animationdef
|
||||||
})
|
})
|
||||||
export class HeroListMultistepComponent {
|
export class HeroListMultistepComponent {
|
||||||
@Input() heroes: Heroes;
|
@Input() heroes: Hero[];
|
||||||
|
|
||||||
animationStarted(event: AnimationEvent) {
|
animationStarted(event: AnimationEvent) {
|
||||||
console.warn('Animation started: ', event);
|
console.warn('Animation started: ', event);
|
||||||
|
@ -10,10 +10,10 @@ import {
|
|||||||
transition
|
transition
|
||||||
} from '@angular/animations';
|
} from '@angular/animations';
|
||||||
|
|
||||||
import { Heroes } from './hero.service';
|
import { Hero } from './hero.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-list-timings',
|
selector: 'app-hero-list-timings',
|
||||||
template: `
|
template: `
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="let hero of heroes"
|
<li *ngFor="let hero of heroes"
|
||||||
@ -54,5 +54,5 @@ import { Heroes } from './hero.service';
|
|||||||
// #enddocregion animationdef
|
// #enddocregion animationdef
|
||||||
})
|
})
|
||||||
export class HeroListTimingsComponent {
|
export class HeroListTimingsComponent {
|
||||||
@Input() heroes: Heroes;
|
@Input() heroes: Hero[];
|
||||||
}
|
}
|
||||||
|
@ -13,10 +13,10 @@ import {
|
|||||||
} from '@angular/animations';
|
} from '@angular/animations';
|
||||||
// #enddocregion imports
|
// #enddocregion imports
|
||||||
|
|
||||||
import { Heroes } from './hero.service';
|
import { Hero } from './hero.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-list-twoway',
|
selector: 'app-hero-list-twoway',
|
||||||
// #docregion template
|
// #docregion template
|
||||||
template: `
|
template: `
|
||||||
<ul>
|
<ul>
|
||||||
@ -54,5 +54,5 @@ import { Heroes } from './hero.service';
|
|||||||
// #enddocregion animationdef
|
// #enddocregion animationdef
|
||||||
})
|
})
|
||||||
export class HeroListTwowayComponent {
|
export class HeroListTwowayComponent {
|
||||||
@Input() heroes: Heroes;
|
@Input() heroes: Hero[];
|
||||||
}
|
}
|
||||||
|
@ -1,40 +1,41 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
import { Heroes } from './hero.service';
|
import { Hero, HeroService } from './hero.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-team-builder',
|
selector: 'app-root',
|
||||||
template: `
|
template: `
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button [disabled]="!heroes.canAdd()" (click)="heroes.addInactive()">Add inactive hero</button>
|
<button [disabled]="!heroService.canAdd()" (click)="heroService.addInactive()">Add inactive hero</button>
|
||||||
<button [disabled]="!heroes.canAdd()" (click)="heroes.addActive()">Add active hero</button>
|
<button [disabled]="!heroService.canAdd()" (click)="heroService.addActive()">Add active hero</button>
|
||||||
<button [disabled]="!heroes.canRemove()" (click)="heroes.remove()">Remove hero</button>
|
<button [disabled]="!heroService.canRemove()" (click)="heroService.remove()">Remove hero</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<h4>Basic State</h4>
|
<h4>Basic State</h4>
|
||||||
<p>Switch between active/inactive on click.</p>
|
<p>Switch between active/inactive on click.</p>
|
||||||
<hero-list-basic [heroes]=heroes></hero-list-basic>
|
<app-hero-list-basic [heroes]="heroes"></app-hero-list-basic>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<h4>Styles inline in transitions</h4>
|
<h4>Styles inline in transitions</h4>
|
||||||
<p>Animated effect on click, no persistend end styles.</p>
|
<p>Animated effect on click, no persistend end styles.</p>
|
||||||
<hero-list-inline-styles [heroes]=heroes></hero-list-inline-styles>
|
<app-hero-list-inline-styles [heroes]="heroes"></app-hero-list-inline-styles>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<h4>Combined transition syntax</h4>
|
<h4>Combined transition syntax</h4>
|
||||||
<p>Switch between active/inactive on click. Define just one transition used in both directions.</p>
|
<p>Switch between active/inactive on click. Define just one transition used in both directions.</p>
|
||||||
<hero-list-combined-transitions [heroes]=heroes></hero-list-combined-transitions>
|
<app-hero-list-combined-transitions [heroes]="heroes"></app-hero-list-combined-transitions>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<h4>Two-way transition syntax</h4>
|
<h4>Two-way transition syntax</h4>
|
||||||
<p>Switch between active/inactive on click. Define just one transition used in both directions using the <=> syntax.</p>
|
<p>Switch between active/inactive on click. Define just one transition used in both directions using the <=> syntax.</p>
|
||||||
<hero-list-twoway [heroes]=heroes></hero-list-twoway>
|
<app-hero-list-twoway [heroes]="heroes"></app-hero-list-twoway>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<h4>Enter & Leave</h4>
|
<h4>Enter & Leave</h4>
|
||||||
<p>Enter and leave animations using the void state.</p>
|
<p>Enter and leave animations using the void state.</p>
|
||||||
<hero-list-enter-leave [heroes]=heroes></hero-list-enter-leave>
|
<app-hero-list-enter-leave [heroes]="heroes"></app-hero-list-enter-leave>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
@ -44,27 +45,27 @@ import { Heroes } from './hero.service';
|
|||||||
Enter and leave animations combined with active/inactive state animations.
|
Enter and leave animations combined with active/inactive state animations.
|
||||||
Different enter and leave transitions depending on state.
|
Different enter and leave transitions depending on state.
|
||||||
</p>
|
</p>
|
||||||
<hero-list-enter-leave-states [heroes]=heroes></hero-list-enter-leave-states>
|
<app-hero-list-enter-leave-states [heroes]="heroes"></app-hero-list-enter-leave-states>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<h4>Auto Style Calc</h4>
|
<h4>Auto Style Calc</h4>
|
||||||
<p>Leave animation from the current computed height using the auto-style value *.</p>
|
<p>Leave animation from the current computed height using the auto-style value *.</p>
|
||||||
<hero-list-auto [heroes]=heroes></hero-list-auto>
|
<app-hero-list-auto [heroes]="heroes"></app-hero-list-auto>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<h4>Different Timings</h4>
|
<h4>Different Timings</h4>
|
||||||
<p>Enter and leave animations with different easings, ease-in for enter, ease-out for leave.</p>
|
<p>Enter and leave animations with different easings, ease-in for enter, ease-out for leave.</p>
|
||||||
<hero-list-timings [heroes]=heroes></hero-list-timings>
|
<app-hero-list-timings [heroes]="heroes"></app-hero-list-timings>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<h4>Multiple Keyframes</h4>
|
<h4>Multiple Keyframes</h4>
|
||||||
<p>Enter and leave animations with three keyframes in each, to give the transition some bounce.</p>
|
<p>Enter and leave animations with three keyframes in each, to give the transition some bounce.</p>
|
||||||
<hero-list-multistep [heroes]=heroes></hero-list-multistep>
|
<app-hero-list-multistep [heroes]="heroes"></app-hero-list-multistep>
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<h4>Parallel Groups</h4>
|
<h4>Parallel Groups</h4>
|
||||||
<p>Enter and leave animations with multiple properties animated in parallel with different timings.</p>
|
<p>Enter and leave animations with multiple properties animated in parallel with different timings.</p>
|
||||||
<hero-list-groups [heroes]=heroes></hero-list-groups>
|
<app-hero-list-groups [heroes]="heroes"></app-hero-list-groups>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
@ -87,8 +88,12 @@ import { Heroes } from './hero.service';
|
|||||||
min-height: 6em;
|
min-height: 6em;
|
||||||
}
|
}
|
||||||
`],
|
`],
|
||||||
providers: [Heroes]
|
providers: [HeroService]
|
||||||
})
|
})
|
||||||
export class HeroTeamBuilderComponent {
|
export class HeroTeamBuilderComponent {
|
||||||
constructor(private heroes: Heroes) { }
|
heroes: Hero[];
|
||||||
|
|
||||||
|
constructor(private heroService: HeroService) {
|
||||||
|
this.heroes = heroService.heroes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
class Hero {
|
// #docregion hero
|
||||||
constructor(public name: string,
|
export class Hero {
|
||||||
public state = 'inactive') {
|
constructor(public name: string, public state = 'inactive') { }
|
||||||
}
|
|
||||||
|
|
||||||
toggleState() {
|
toggleState() {
|
||||||
this.state = (this.state === 'active' ? 'inactive' : 'active');
|
this.state = this.state === 'active' ? 'inactive' : 'active';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// #enddocregion hero
|
||||||
|
|
||||||
let ALL_HEROES = [
|
const ALL_HEROES = [
|
||||||
'Windstorm',
|
'Windstorm',
|
||||||
'RubberMan',
|
'RubberMan',
|
||||||
'Bombasto',
|
'Bombasto',
|
||||||
@ -25,36 +25,30 @@ let ALL_HEROES = [
|
|||||||
].map(name => new Hero(name));
|
].map(name => new Hero(name));
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Heroes implements Iterable<Hero> {
|
export class HeroService {
|
||||||
|
|
||||||
currentHeroes: Hero[] = [];
|
heroes: Hero[] = [];
|
||||||
|
|
||||||
[Symbol.iterator]() {
|
|
||||||
return this.currentHeroes.values();
|
|
||||||
}
|
|
||||||
|
|
||||||
canAdd() {
|
canAdd() {
|
||||||
return this.currentHeroes.length < ALL_HEROES.length;
|
return this.heroes.length < ALL_HEROES.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
canRemove() {
|
canRemove() {
|
||||||
return this.currentHeroes.length > 0;
|
return this.heroes.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
addActive() {
|
addActive(active = true) {
|
||||||
let hero = ALL_HEROES[this.currentHeroes.length];
|
let hero = ALL_HEROES[this.heroes.length];
|
||||||
hero.state = 'active';
|
hero.state = active ? 'active' : 'inactive';
|
||||||
this.currentHeroes.push(hero);
|
this.heroes.push(hero);
|
||||||
}
|
}
|
||||||
|
|
||||||
addInactive() {
|
addInactive() {
|
||||||
let hero = ALL_HEROES[this.currentHeroes.length];
|
this.addActive(false);
|
||||||
hero.state = 'inactive';
|
|
||||||
this.currentHeroes.push(hero);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
remove() {
|
remove() {
|
||||||
this.currentHeroes.splice(this.currentHeroes.length - 1, 1);
|
this.heroes.length -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,26 +5,11 @@
|
|||||||
<title>Animations</title>
|
<title>Animations</title>
|
||||||
<base href="/">
|
<base href="/">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="stylesheet" href="styles.css">
|
|
||||||
|
|
||||||
<!-- Polyfill for Web Animations -->
|
|
||||||
<script src="https://unpkg.com/web-animations-js@2.2.1"></script>
|
|
||||||
|
|
||||||
<!-- Polyfills -->
|
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
|
||||||
|
|
||||||
<script src="node_modules/zone.js/dist/zone.js"></script>
|
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
|
||||||
|
|
||||||
<script src="systemjs.config.js"></script>
|
|
||||||
<script>
|
|
||||||
System.import('main.js').catch(function(err){ console.error(err); });
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1 style="visibility: hidden;">External H1 Title for E2E test</h1>
|
<h1 style="visibility: hidden;">External H1 Title for E2E test</h1>
|
||||||
<hero-team-builder></hero-team-builder>
|
<app-root></app-root>
|
||||||
<button style="visibility: hidden;">External button for E2E test</button>
|
<button style="visibility: hidden;">External button for E2E test</button>
|
||||||
<ul style="visibility: hidden;">
|
<ul style="visibility: hidden;">
|
||||||
<li>External list for E2E test</li>
|
<li>External list for E2E test</li>
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
|
import { enableProdMode } from '@angular/core';
|
||||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||||
|
|
||||||
import { AppModule } from './app/app.module';
|
import { AppModule } from './app/app.module';
|
||||||
|
import { environment } from './environments/environment';
|
||||||
|
|
||||||
|
if (environment.production) {
|
||||||
|
enableProdMode();
|
||||||
|
}
|
||||||
|
|
||||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
'use strict'; // necessary for es6 output in node
|
|
||||||
|
|
||||||
import { browser, element, by } from 'protractor';
|
|
||||||
|
|
||||||
/* tslint:disable:quotemark */
|
|
||||||
describe('AOT Compilation', function () {
|
|
||||||
|
|
||||||
beforeAll(function () {
|
|
||||||
browser.get('');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should load page and click button', function (done: any) {
|
|
||||||
let headingSelector = element.all(by.css('h1')).get(0);
|
|
||||||
expect(headingSelector.getText()).toEqual('Hello Angular');
|
|
||||||
|
|
||||||
expect(element.all(by.xpath('//div[text()="Magneta"]')).get(0).isPresent()).toBe(true);
|
|
||||||
expect(element.all(by.xpath('//div[text()="Bombasto"]')).get(0).isPresent()).toBe(true);
|
|
||||||
expect(element.all(by.xpath('//div[text()="Magma"]')).get(0).isPresent()).toBe(true);
|
|
||||||
expect(element.all(by.xpath('//div[text()="Tornado"]')).get(0).isPresent()).toBe(true);
|
|
||||||
|
|
||||||
let toggleButton = element.all(by.css('button')).get(0);
|
|
||||||
toggleButton.click().then(function() {
|
|
||||||
expect(headingSelector.isPresent()).toBe(false);
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"build": "build:aot"
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
// #docregion
|
|
||||||
import nodeResolve from 'rollup-plugin-node-resolve';
|
|
||||||
import commonjs from 'rollup-plugin-commonjs';
|
|
||||||
import uglify from 'rollup-plugin-uglify';
|
|
||||||
|
|
||||||
// #docregion config
|
|
||||||
export default {
|
|
||||||
entry: 'src/main.js',
|
|
||||||
dest: 'src/build.js', // output a single application bundle
|
|
||||||
sourceMap: false,
|
|
||||||
format: 'iife',
|
|
||||||
onwarn: function(warning) {
|
|
||||||
// Skip certain warnings
|
|
||||||
|
|
||||||
// should intercept ... but doesn't in some rollup versions
|
|
||||||
if ( warning.code === 'THIS_IS_UNDEFINED' ) { return; }
|
|
||||||
|
|
||||||
// console.warn everything else
|
|
||||||
console.warn( warning.message );
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
nodeResolve({jsnext: true, module: true}),
|
|
||||||
// #docregion commonjs
|
|
||||||
commonjs({
|
|
||||||
include: 'node_modules/rxjs/**',
|
|
||||||
}),
|
|
||||||
// #enddocregion commonjs
|
|
||||||
// #docregion uglify
|
|
||||||
uglify()
|
|
||||||
// #enddocregion uglify
|
|
||||||
]
|
|
||||||
};
|
|
||||||
// #enddocregion config
|
|
@ -1,7 +0,0 @@
|
|||||||
<!-- #docregion -->
|
|
||||||
<button (click)="toggleHeading()">Toggle Heading</button>
|
|
||||||
<h1 *ngIf="showHeading">Hello Angular</h1>
|
|
||||||
|
|
||||||
<h3>List of Heroes</h3>
|
|
||||||
<div *ngFor="let hero of heroes">{{hero}}</div>
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
// #docregion
|
|
||||||
import { Component } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'my-app',
|
|
||||||
templateUrl: './app.component.html'
|
|
||||||
})
|
|
||||||
export class AppComponent {
|
|
||||||
showHeading = true;
|
|
||||||
heroes = ['Magneta', 'Bombasto', 'Magma', 'Tornado'];
|
|
||||||
|
|
||||||
toggleHeading() {
|
|
||||||
this.showHeading = !this.showHeading;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
// #docregion
|
|
||||||
import { NgModule } from '@angular/core';
|
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
|
||||||
|
|
||||||
import { AppComponent } from './app.component';
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [ BrowserModule ],
|
|
||||||
declarations: [ AppComponent ],
|
|
||||||
bootstrap: [ AppComponent ]
|
|
||||||
})
|
|
||||||
export class AppModule { }
|
|
@ -1,24 +0,0 @@
|
|||||||
<!-- #docregion -->
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Ahead of time compilation (JIT)</title>
|
|
||||||
<base href="/">
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<link rel="stylesheet" href="styles.css">
|
|
||||||
|
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
|
||||||
<script src="node_modules/zone.js/dist/zone.js"></script>
|
|
||||||
<!-- #docregion jit -->
|
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
|
||||||
<script src="systemjs.config.js"></script>
|
|
||||||
<script>
|
|
||||||
System.import('main-jit.js').catch(function(err){ console.error(err); });
|
|
||||||
</script>
|
|
||||||
<!-- #enddocregion jit -->
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<my-app>Loading...</my-app>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,20 +0,0 @@
|
|||||||
<!-- #docregion -->
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Ahead of time compilation</title>
|
|
||||||
<base href="/">
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<link rel="stylesheet" href="styles.css">
|
|
||||||
|
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
|
||||||
<script src="node_modules/zone.js/dist/zone.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<my-app>Loading...</my-app>
|
|
||||||
</body>
|
|
||||||
<!-- #docregion bundle -->
|
|
||||||
<script src="build.js"></script>
|
|
||||||
<!-- #enddocregion bundle -->
|
|
||||||
</html>
|
|
@ -1,6 +0,0 @@
|
|||||||
// #docregion
|
|
||||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
||||||
import { AppModule } from './app/app.module';
|
|
||||||
|
|
||||||
console.log('Running JIT compiled');
|
|
||||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
|
@ -1,6 +0,0 @@
|
|||||||
// #docregion
|
|
||||||
import { platformBrowser } from '@angular/platform-browser';
|
|
||||||
import { AppModuleNgFactory } from '../aot/src/app/app.module.ngfactory';
|
|
||||||
|
|
||||||
console.log('Running AOT compiled');
|
|
||||||
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);
|
|
@ -1,26 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "es5",
|
|
||||||
"module": "es2015",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"sourceMap": true,
|
|
||||||
"emitDecoratorMetadata": true,
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"lib": ["es2015", "dom"],
|
|
||||||
"noImplicitAny": true,
|
|
||||||
"suppressImplicitAnyIndexErrors": true,
|
|
||||||
"typeRoots": [
|
|
||||||
"./node_modules/@types/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
"files": [
|
|
||||||
"src/app/app.module.ts",
|
|
||||||
"src/main.ts"
|
|
||||||
],
|
|
||||||
|
|
||||||
"angularCompilerOptions": {
|
|
||||||
"genDir": "aot",
|
|
||||||
"skipMetadataEmit" : true
|
|
||||||
}
|
|
||||||
}
|
|
@ -79,10 +79,10 @@ function salesTaxTests() {
|
|||||||
|
|
||||||
function getPageElts() {
|
function getPageElts() {
|
||||||
return {
|
return {
|
||||||
heroes: element.all(by.css('my-app li')),
|
heroes: element.all(by.css('app-root li')),
|
||||||
heroDetail: element(by.css('my-app hero-detail')),
|
heroDetail: element(by.css('app-root app-hero-detail')),
|
||||||
salesTaxAmountInput: element(by.css('my-app sales-tax input')),
|
salesTaxAmountInput: element(by.css('app-root app-sales-tax input')),
|
||||||
salesTaxDetail: element(by.css('my-app sales-tax div'))
|
salesTaxDetail: element(by.css('app-root app-sales-tax div'))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -3,10 +3,10 @@ import { Component } from '@angular/core';
|
|||||||
// #enddocregion import
|
// #enddocregion import
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-app',
|
selector: 'app-root',
|
||||||
template: `
|
template: `
|
||||||
<hero-list></hero-list>
|
<app-hero-list></app-hero-list>
|
||||||
<sales-tax></sales-tax>
|
<app-sales-tax></app-sales-tax>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
// #docregion export
|
// #docregion export
|
||||||
|
@ -3,7 +3,7 @@ import { Component, Input } from '@angular/core';
|
|||||||
import { Hero } from './hero';
|
import { Hero } from './hero';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-detail',
|
selector: 'app-hero-detail',
|
||||||
templateUrl: './hero-detail.component.html'
|
templateUrl: './hero-detail.component.html'
|
||||||
})
|
})
|
||||||
export class HeroDetailComponent {
|
export class HeroDetailComponent {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<!--#docregion binding -->
|
<!--#docregion binding -->
|
||||||
<li>{{hero.name}}</li>
|
<li>{{hero.name}}</li>
|
||||||
<hero-detail [hero]="selectedHero"></hero-detail>
|
<app-hero-detail [hero]="selectedHero"></app-hero-detail>
|
||||||
<li (click)="selectHero(hero)"></li>
|
<li (click)="selectHero(hero)"></li>
|
||||||
<!--#enddocregion binding -->
|
<!--#enddocregion binding -->
|
||||||
|
|
||||||
<!--#docregion structural -->
|
<!--#docregion structural -->
|
||||||
<li *ngFor="let hero of heroes"></li>
|
<li *ngFor="let hero of heroes"></li>
|
||||||
<hero-detail *ngIf="selectedHero"></hero-detail>
|
<app-hero-detail *ngIf="selectedHero"></app-hero-detail>
|
||||||
|
@ -8,4 +8,4 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<hero-detail *ngIf="selectedHero" [hero]="selectedHero"></hero-detail>
|
<app-hero-detail *ngIf="selectedHero" [hero]="selectedHero"></app-hero-detail>
|
||||||
|
@ -5,7 +5,7 @@ import { HeroService } from './hero.service';
|
|||||||
|
|
||||||
// #docregion metadata, providers
|
// #docregion metadata, providers
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-list',
|
selector: 'app-hero-list',
|
||||||
templateUrl: './hero-list.component.html',
|
templateUrl: './hero-list.component.html',
|
||||||
providers: [ HeroService ]
|
providers: [ HeroService ]
|
||||||
})
|
})
|
||||||
|
@ -4,7 +4,7 @@ import { SalesTaxService } from './sales-tax.service';
|
|||||||
import { TaxRateService } from './tax-rate.service';
|
import { TaxRateService } from './tax-rate.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'sales-tax',
|
selector: 'app-sales-tax',
|
||||||
template: `
|
template: `
|
||||||
<h2>Sales Tax Calculator</h2>
|
<h2>Sales Tax Calculator</h2>
|
||||||
Amount: <input #amountBox (change)="0">
|
Amount: <input #amountBox (change)="0">
|
||||||
|
@ -1,26 +1,13 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>Architecture of Angular</title>
|
<title>Architecture of Angular</title>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<base href="/">
|
<base href="/">
|
||||||
<link rel="stylesheet" href="styles.css">
|
|
||||||
|
|
||||||
<!-- Polyfills -->
|
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
|
||||||
|
|
||||||
<script src="node_modules/zone.js/dist/zone.js"></script>
|
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
|
||||||
|
|
||||||
<script src="systemjs.config.js"></script>
|
|
||||||
<script>
|
|
||||||
System.import('main.js').catch(function(err){ console.error(err); });
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<my-app>Loading...</my-app>
|
<app-root></app-root>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
// #docregion
|
// #docregion
|
||||||
|
import { enableProdMode } from '@angular/core';
|
||||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||||
|
|
||||||
import { AppModule } from './app/app.module';
|
import { AppModule } from './app/app.module';
|
||||||
|
import { environment } from './environments/environment';
|
||||||
|
|
||||||
|
if (environment.production) {
|
||||||
|
enableProdMode();
|
||||||
|
}
|
||||||
|
|
||||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<!-- #docregion -->
|
<!-- #docregion -->
|
||||||
<h1>My First Attribute Directive</h1>
|
<h1>My First Attribute Directive</h1>
|
||||||
<!-- #docregion applied -->
|
<!-- #docregion applied -->
|
||||||
<p myHighlight>Highlight me!</p>
|
<p appHightlight>Highlight me!</p>
|
||||||
<!-- #enddocregion applied, -->
|
<!-- #enddocregion applied, -->
|
||||||
|
|
||||||
<!-- #docregion color-1 -->
|
<!-- #docregion color-1 -->
|
||||||
<p myHighlight highlightColor="yellow">Highlighted in yellow</p>
|
<p appHightlight highlightColor="yellow">Highlighted in yellow</p>
|
||||||
<p myHighlight [highlightColor]="'orange'">Highlighted in orange</p>
|
<p appHightlight [highlightColor]="'orange'">Highlighted in orange</p>
|
||||||
<!-- #enddocregion color-1 -->
|
<!-- #enddocregion color-1 -->
|
||||||
|
|
||||||
<!-- #docregion color-2 -->
|
<!-- #docregion color-2 -->
|
||||||
<p myHighlight [highlightColor]="color">Highlighted with parent component's color</p>
|
<p appHightlight [highlightColor]="color">Highlighted with parent component's color</p>
|
||||||
<!-- #enddocregion color-2 -->
|
<!-- #enddocregion color-2 -->
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-app',
|
selector: 'app-root',
|
||||||
templateUrl: './app.component.1.html'
|
templateUrl: './app.component.1.html'
|
||||||
})
|
})
|
||||||
// #docregion class
|
// #docregion class
|
||||||
|
@ -8,11 +8,11 @@
|
|||||||
<input type="radio" name="colors" (click)="color='cyan'">Cyan
|
<input type="radio" name="colors" (click)="color='cyan'">Cyan
|
||||||
</div>
|
</div>
|
||||||
<!-- #docregion color -->
|
<!-- #docregion color -->
|
||||||
<p [myHighlight]="color">Highlight me!</p>
|
<p [appHighlight]="color">Highlight me!</p>
|
||||||
<!-- #enddocregion color, v2 -->
|
<!-- #enddocregion color, v2 -->
|
||||||
|
|
||||||
<!-- #docregion defaultColor -->
|
<!-- #docregion defaultColor -->
|
||||||
<p [myHighlight]="color" defaultColor="violet">
|
<p [appHighlight]="color" defaultColor="violet">
|
||||||
Highlight me too!
|
Highlight me too!
|
||||||
</p>
|
</p>
|
||||||
<!-- #enddocregion defaultColor, -->
|
<!-- #enddocregion defaultColor, -->
|
||||||
@ -20,5 +20,5 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<p><i>Mouse over the following lines to see fixed highlights</i></p>
|
<p><i>Mouse over the following lines to see fixed highlights</i></p>
|
||||||
|
|
||||||
<p [myHighlight]="'yellow'">Highlighted in yellow</p>
|
<p [appHighlight]="'yellow'">Highlighted in yellow</p>
|
||||||
<p myHighlight="orange">Highlighted in orange</p>
|
<p appHighlight="orange">Highlighted in orange</p>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-app',
|
selector: 'app-root',
|
||||||
templateUrl: './app.component.html'
|
templateUrl: './app.component.html'
|
||||||
})
|
})
|
||||||
// #docregion class
|
// #docregion class
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// #docregion
|
// #docregion
|
||||||
import { Directive, ElementRef, Input } from '@angular/core';
|
import { Directive, ElementRef, Input } from '@angular/core';
|
||||||
|
|
||||||
@Directive({ selector: '[myHighlight]' })
|
@Directive({ selector: '[appHighlight]' })
|
||||||
export class HighlightDirective {
|
export class HighlightDirective {
|
||||||
constructor(el: ElementRef) {
|
constructor(el: ElementRef) {
|
||||||
el.nativeElement.style.backgroundColor = 'yellow';
|
el.nativeElement.style.backgroundColor = 'yellow';
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
import { Directive, ElementRef, HostListener, Input } from '@angular/core';
|
import { Directive, ElementRef, HostListener, Input } from '@angular/core';
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[myHighlight]'
|
selector: '[appHighlight]'
|
||||||
})
|
})
|
||||||
export class HighlightDirective {
|
export class HighlightDirective {
|
||||||
// #docregion ctor
|
// #docregion ctor
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
import { Directive, ElementRef, HostListener, Input } from '@angular/core';
|
import { Directive, ElementRef, HostListener, Input } from '@angular/core';
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[myHighlight]'
|
selector: '[appHighlight]'
|
||||||
})
|
})
|
||||||
export class HighlightDirective {
|
export class HighlightDirective {
|
||||||
|
|
||||||
constructor(private el: ElementRef) { }
|
constructor(private el: ElementRef) { }
|
||||||
|
|
||||||
@Input('myHighlight') highlightColor: string;
|
@Input('appHighlight') highlightColor: string;
|
||||||
|
|
||||||
// #docregion mouse-enter
|
// #docregion mouse-enter
|
||||||
@HostListener('mouseenter') onMouseEnter() {
|
@HostListener('mouseenter') onMouseEnter() {
|
||||||
|
@ -4,7 +4,7 @@ import { Directive, ElementRef, HostListener, Input } from '@angular/core';
|
|||||||
// #enddocregion imports
|
// #enddocregion imports
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[myHighlight]'
|
selector: '[appHighlight]'
|
||||||
})
|
})
|
||||||
export class HighlightDirective {
|
export class HighlightDirective {
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ export class HighlightDirective {
|
|||||||
// #enddocregion defaultColor
|
// #enddocregion defaultColor
|
||||||
|
|
||||||
// #docregion color
|
// #docregion color
|
||||||
@Input('myHighlight') highlightColor: string;
|
@Input('appHighlight') highlightColor: string;
|
||||||
// #enddocregion color
|
// #enddocregion color
|
||||||
|
|
||||||
// #docregion mouse-enter
|
// #docregion mouse-enter
|
||||||
|
@ -1,25 +1,13 @@
|
|||||||
<!-- #docregion -->
|
<!-- #docregion -->
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Attribute Directives</title>
|
<title>Attribute Directives</title>
|
||||||
<base href="/">
|
<base href="/">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="stylesheet" href="styles.css">
|
|
||||||
|
|
||||||
<!-- Polyfills -->
|
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
|
||||||
|
|
||||||
<script src="node_modules/zone.js/dist/zone.js"></script>
|
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
|
||||||
|
|
||||||
<script src="systemjs.config.js"></script>
|
|
||||||
<script>
|
|
||||||
System.import('main.js').catch(function(err){ console.error(err); });
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<my-app>loading...</my-app>
|
<app-root></app-root>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
// #docregion
|
// #docregion
|
||||||
|
import { enableProdMode } from '@angular/core';
|
||||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||||
|
|
||||||
import { AppModule } from './app/app.module';
|
import { AppModule } from './app/app.module';
|
||||||
|
import { environment } from './environments/environment';
|
||||||
|
|
||||||
|
if (environment.production) {
|
||||||
|
enableProdMode();
|
||||||
|
}
|
||||||
|
|
||||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
'use strict'; // necessary for es6 output in node
|
|
||||||
|
|
||||||
import { browser, element, by } from 'protractor';
|
|
||||||
|
|
||||||
describe('cli-quickstart App', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
return browser.get('/');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should display message saying app works', () => {
|
|
||||||
let pageTitle = element(by.css('app-root h1')).getText();
|
|
||||||
expect(pageTitle).toEqual('Welcome to My First Angular App!!');
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,14 +1,14 @@
|
|||||||
import { MyAppPage } from './app.po';
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
describe('my-app App', function() {
|
import { browser, element, by } from 'protractor';
|
||||||
let page: MyAppPage;
|
|
||||||
|
|
||||||
|
describe('cli-quickstart App', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
page = new MyAppPage();
|
return browser.get('/');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display message saying app works', () => {
|
it('should display message saying app works', () => {
|
||||||
page.navigateTo();
|
let pageTitle = element(by.css('app-root h1')).getText();
|
||||||
expect(page.getParagraphText()).toEqual('Welcome to app!!');
|
expect(pageTitle).toEqual('Welcome to My First Angular App!!');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -5,7 +5,5 @@
|
|||||||
"!**/*.[0-9].*",
|
"!**/*.[0-9].*",
|
||||||
".angular-cli.json",
|
".angular-cli.json",
|
||||||
"protractor.conf.js"
|
"protractor.conf.js"
|
||||||
],
|
]
|
||||||
"removeSystemJsConfig": true,
|
|
||||||
"type": "cli"
|
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,8 @@ describe('Component Communication Cookbook Tests', function () {
|
|||||||
let _masterName = 'Master';
|
let _masterName = 'Master';
|
||||||
|
|
||||||
it('should pass properties to children properly', function () {
|
it('should pass properties to children properly', function () {
|
||||||
let parent = element.all(by.tagName('hero-parent')).get(0);
|
let parent = element.all(by.tagName('app-hero-parent')).get(0);
|
||||||
let heroes = parent.all(by.tagName('hero-child'));
|
let heroes = parent.all(by.tagName('app-hero-child'));
|
||||||
|
|
||||||
for (let i = 0; i < _heroNames.length; i++) {
|
for (let i = 0; i < _heroNames.length; i++) {
|
||||||
let childTitle = heroes.get(i).element(by.tagName('h3')).getText();
|
let childTitle = heroes.get(i).element(by.tagName('h3')).getText();
|
||||||
@ -37,8 +37,8 @@ describe('Component Communication Cookbook Tests', function () {
|
|||||||
it('should display trimmed, non-empty names', function () {
|
it('should display trimmed, non-empty names', function () {
|
||||||
let _nonEmptyNameIndex = 0;
|
let _nonEmptyNameIndex = 0;
|
||||||
let _nonEmptyName = '"Mr. IQ"';
|
let _nonEmptyName = '"Mr. IQ"';
|
||||||
let parent = element.all(by.tagName('name-parent')).get(0);
|
let parent = element.all(by.tagName('app-name-parent')).get(0);
|
||||||
let hero = parent.all(by.tagName('name-child')).get(_nonEmptyNameIndex);
|
let hero = parent.all(by.tagName('app-name-child')).get(_nonEmptyNameIndex);
|
||||||
|
|
||||||
let displayName = hero.element(by.tagName('h3')).getText();
|
let displayName = hero.element(by.tagName('h3')).getText();
|
||||||
expect(displayName).toEqual(_nonEmptyName);
|
expect(displayName).toEqual(_nonEmptyName);
|
||||||
@ -47,8 +47,8 @@ describe('Component Communication Cookbook Tests', function () {
|
|||||||
it('should replace empty name with default name', function () {
|
it('should replace empty name with default name', function () {
|
||||||
let _emptyNameIndex = 1;
|
let _emptyNameIndex = 1;
|
||||||
let _defaultName = '"<no name set>"';
|
let _defaultName = '"<no name set>"';
|
||||||
let parent = element.all(by.tagName('name-parent')).get(0);
|
let parent = element.all(by.tagName('app-name-parent')).get(0);
|
||||||
let hero = parent.all(by.tagName('name-child')).get(_emptyNameIndex);
|
let hero = parent.all(by.tagName('app-name-child')).get(_emptyNameIndex);
|
||||||
|
|
||||||
let displayName = hero.element(by.tagName('h3')).getText();
|
let displayName = hero.element(by.tagName('h3')).getText();
|
||||||
expect(displayName).toEqual(_defaultName);
|
expect(displayName).toEqual(_defaultName);
|
||||||
@ -73,7 +73,7 @@ describe('Component Communication Cookbook Tests', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should set expected values after clicking \'Minor\' twice', function () {
|
it('should set expected values after clicking \'Minor\' twice', function () {
|
||||||
let repoTag = element(by.tagName('version-parent'));
|
let repoTag = element(by.tagName('app-version-parent'));
|
||||||
let newMinorButton = repoTag.all(by.tagName('button')).get(0);
|
let newMinorButton = repoTag.all(by.tagName('button')).get(0);
|
||||||
|
|
||||||
newMinorButton.click().then(function() {
|
newMinorButton.click().then(function() {
|
||||||
@ -91,7 +91,7 @@ describe('Component Communication Cookbook Tests', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should set expected values after clicking \'Major\' once', function () {
|
it('should set expected values after clicking \'Major\' once', function () {
|
||||||
let repoTag = element(by.tagName('version-parent'));
|
let repoTag = element(by.tagName('app-version-parent'));
|
||||||
let newMajorButton = repoTag.all(by.tagName('button')).get(1);
|
let newMajorButton = repoTag.all(by.tagName('button')).get(1);
|
||||||
|
|
||||||
newMajorButton.click().then(function() {
|
newMajorButton.click().then(function() {
|
||||||
@ -107,7 +107,7 @@ describe('Component Communication Cookbook Tests', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function getActual() {
|
function getActual() {
|
||||||
let versionTag = element(by.tagName('version-child'));
|
let versionTag = element(by.tagName('app-version-child'));
|
||||||
let label = versionTag.element(by.tagName('h3')).getText();
|
let label = versionTag.element(by.tagName('h3')).getText();
|
||||||
let ul = versionTag.element((by.tagName('ul')));
|
let ul = versionTag.element((by.tagName('ul')));
|
||||||
let logs = ul.all(by.tagName('li'));
|
let logs = ul.all(by.tagName('li'));
|
||||||
@ -127,26 +127,26 @@ describe('Component Communication Cookbook Tests', function () {
|
|||||||
// #docregion child-to-parent
|
// #docregion child-to-parent
|
||||||
// ...
|
// ...
|
||||||
it('should not emit the event initially', function () {
|
it('should not emit the event initially', function () {
|
||||||
let voteLabel = element(by.tagName('vote-taker'))
|
let voteLabel = element(by.tagName('app-vote-taker'))
|
||||||
.element(by.tagName('h3')).getText();
|
.element(by.tagName('h3')).getText();
|
||||||
expect(voteLabel).toBe('Agree: 0, Disagree: 0');
|
expect(voteLabel).toBe('Agree: 0, Disagree: 0');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should process Agree vote', function () {
|
it('should process Agree vote', function () {
|
||||||
let agreeButton1 = element.all(by.tagName('my-voter')).get(0)
|
let agreeButton1 = element.all(by.tagName('app-voter')).get(0)
|
||||||
.all(by.tagName('button')).get(0);
|
.all(by.tagName('button')).get(0);
|
||||||
agreeButton1.click().then(function() {
|
agreeButton1.click().then(function() {
|
||||||
let voteLabel = element(by.tagName('vote-taker'))
|
let voteLabel = element(by.tagName('app-vote-taker'))
|
||||||
.element(by.tagName('h3')).getText();
|
.element(by.tagName('h3')).getText();
|
||||||
expect(voteLabel).toBe('Agree: 1, Disagree: 0');
|
expect(voteLabel).toBe('Agree: 1, Disagree: 0');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should process Disagree vote', function () {
|
it('should process Disagree vote', function () {
|
||||||
let agreeButton1 = element.all(by.tagName('my-voter')).get(1)
|
let agreeButton1 = element.all(by.tagName('app-voter')).get(1)
|
||||||
.all(by.tagName('button')).get(1);
|
.all(by.tagName('button')).get(1);
|
||||||
agreeButton1.click().then(function() {
|
agreeButton1.click().then(function() {
|
||||||
let voteLabel = element(by.tagName('vote-taker'))
|
let voteLabel = element(by.tagName('app-vote-taker'))
|
||||||
.element(by.tagName('h3')).getText();
|
.element(by.tagName('h3')).getText();
|
||||||
expect(voteLabel).toBe('Agree: 1, Disagree: 1');
|
expect(voteLabel).toBe('Agree: 1, Disagree: 1');
|
||||||
});
|
});
|
||||||
@ -170,7 +170,7 @@ describe('Component Communication Cookbook Tests', function () {
|
|||||||
// ...
|
// ...
|
||||||
it('timer and parent seconds should match', function () {
|
it('timer and parent seconds should match', function () {
|
||||||
let parent = element(by.tagName(parentTag));
|
let parent = element(by.tagName(parentTag));
|
||||||
let message = parent.element(by.tagName('countdown-timer')).getText();
|
let message = parent.element(by.tagName('app-countdown-timer')).getText();
|
||||||
browser.sleep(10); // give `seconds` a chance to catchup with `message`
|
browser.sleep(10); // give `seconds` a chance to catchup with `message`
|
||||||
let seconds = parent.element(by.className('seconds')).getText();
|
let seconds = parent.element(by.className('seconds')).getText();
|
||||||
expect(message).toContain(seconds);
|
expect(message).toContain(seconds);
|
||||||
@ -181,7 +181,7 @@ describe('Component Communication Cookbook Tests', function () {
|
|||||||
let stopButton = parent.all(by.tagName('button')).get(1);
|
let stopButton = parent.all(by.tagName('button')).get(1);
|
||||||
|
|
||||||
stopButton.click().then(function() {
|
stopButton.click().then(function() {
|
||||||
let message = parent.element(by.tagName('countdown-timer')).getText();
|
let message = parent.element(by.tagName('app-countdown-timer')).getText();
|
||||||
expect(message).toContain('Holding');
|
expect(message).toContain('Holding');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -194,7 +194,7 @@ describe('Component Communication Cookbook Tests', function () {
|
|||||||
// #docregion bidirectional-service
|
// #docregion bidirectional-service
|
||||||
// ...
|
// ...
|
||||||
it('should announce a mission', function () {
|
it('should announce a mission', function () {
|
||||||
let missionControl = element(by.tagName('mission-control'));
|
let missionControl = element(by.tagName('app-mission-control'));
|
||||||
let announceButton = missionControl.all(by.tagName('button')).get(0);
|
let announceButton = missionControl.all(by.tagName('button')).get(0);
|
||||||
announceButton.click().then(function () {
|
announceButton.click().then(function () {
|
||||||
let history = missionControl.all(by.tagName('li'));
|
let history = missionControl.all(by.tagName('li'));
|
||||||
@ -217,7 +217,7 @@ describe('Component Communication Cookbook Tests', function () {
|
|||||||
|
|
||||||
function testConfirmMission(buttonIndex: number, expectedLogCount: number, astronaut: string) {
|
function testConfirmMission(buttonIndex: number, expectedLogCount: number, astronaut: string) {
|
||||||
let _confirmedLog = ' confirmed the mission';
|
let _confirmedLog = ' confirmed the mission';
|
||||||
let missionControl = element(by.tagName('mission-control'));
|
let missionControl = element(by.tagName('app-mission-control'));
|
||||||
let confirmButton = missionControl.all(by.tagName('button')).get(buttonIndex);
|
let confirmButton = missionControl.all(by.tagName('button')).get(buttonIndex);
|
||||||
confirmButton.click().then(function () {
|
confirmButton.click().then(function () {
|
||||||
let history = missionControl.all(by.tagName('li'));
|
let history = missionControl.all(by.tagName('li'));
|
@ -9,43 +9,43 @@
|
|||||||
<a href="#bidirectional-service">Parent and children communicate via a service ("Mission Control")</a><br/>
|
<a href="#bidirectional-service">Parent and children communicate via a service ("Mission Control")</a><br/>
|
||||||
|
|
||||||
<div id="parent-to-child">
|
<div id="parent-to-child">
|
||||||
<hero-parent></hero-parent>
|
<app-hero-parent></app-hero-parent>
|
||||||
</div>
|
</div>
|
||||||
<a href="#top" class="to-top">Back to Top</a>
|
<a href="#top" class="to-top">Back to Top</a>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<div id="parent-to-child-setter">
|
<div id="parent-to-child-setter">
|
||||||
<name-parent></name-parent>
|
<app-name-parent></app-name-parent>
|
||||||
</div>
|
</div>
|
||||||
<a href="#top" class="to-top">Back to Top</a>
|
<a href="#top" class="to-top">Back to Top</a>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<div id="parent-to-child-on-changes">
|
<div id="parent-to-child-on-changes">
|
||||||
<version-parent></version-parent>
|
<app-version-parent></app-version-parent>
|
||||||
</div>
|
</div>
|
||||||
<a href="#top" class="to-top">Back to Top</a>
|
<a href="#top" class="to-top">Back to Top</a>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<div id="child-to-parent">
|
<div id="child-to-parent">
|
||||||
<vote-taker></vote-taker>
|
<app-vote-taker></app-vote-taker>
|
||||||
</div>
|
</div>
|
||||||
<a href="#top" class="to-top">Back to Top</a>
|
<a href="#top" class="to-top">Back to Top</a>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<div id="parent-to-child-local-var">
|
<div id="parent-to-child-local-var">
|
||||||
<countdown-parent-lv></countdown-parent-lv>
|
<app-countdown-parent-lv></app-countdown-parent-lv>
|
||||||
</div>
|
</div>
|
||||||
<a href="#top" class="to-top">Back to Top</a>
|
<a href="#top" class="to-top">Back to Top</a>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<div id="parent-to-view-child">
|
<div id="parent-to-view-child">
|
||||||
<countdown-parent-vc></countdown-parent-vc>
|
<app-countdown-parent-vc></app-countdown-parent-vc>
|
||||||
</div>
|
</div>
|
||||||
<a href="#top" class="to-top">Back to Top</a>
|
<a href="#top" class="to-top">Back to Top</a>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<div id="bidirectional-service">
|
<div id="bidirectional-service">
|
||||||
<mission-control></mission-control>
|
<app-mission-control></app-mission-control>
|
||||||
</div>
|
</div>
|
||||||
<a href="#top" class="to-top">Back to Top</a>
|
<a href="#top" class="to-top">Back to Top</a>
|
||||||
<hr>
|
<hr>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-app',
|
selector: 'app-root',
|
||||||
templateUrl: './app.component.html'
|
templateUrl: './app.component.html'
|
||||||
})
|
})
|
||||||
export class AppComponent { }
|
export class AppComponent { }
|
||||||
|
@ -5,7 +5,7 @@ import { MissionService } from './mission.service';
|
|||||||
import { Subscription } from 'rxjs/Subscription';
|
import { Subscription } from 'rxjs/Subscription';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-astronaut',
|
selector: 'app-astronaut',
|
||||||
template: `
|
template: `
|
||||||
<p>
|
<p>
|
||||||
{{astronaut}}: <strong>{{mission}}</strong>
|
{{astronaut}}: <strong>{{mission}}</strong>
|
||||||
|
@ -11,15 +11,15 @@ import { CountdownTimerComponent } from './countdown-timer.component';
|
|||||||
//// Local variable, #timer, version
|
//// Local variable, #timer, version
|
||||||
// #docregion lv
|
// #docregion lv
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'countdown-parent-lv',
|
selector: 'app-countdown-parent-lv',
|
||||||
template: `
|
template: `
|
||||||
<h3>Countdown to Liftoff (via local variable)</h3>
|
<h3>Countdown to Liftoff (via local variable)</h3>
|
||||||
<button (click)="timer.start()">Start</button>
|
<button (click)="timer.start()">Start</button>
|
||||||
<button (click)="timer.stop()">Stop</button>
|
<button (click)="timer.stop()">Stop</button>
|
||||||
<div class="seconds">{{timer.seconds}}</div>
|
<div class="seconds">{{timer.seconds}}</div>
|
||||||
<countdown-timer #timer></countdown-timer>
|
<app-countdown-timer #timer></app-countdown-timer>
|
||||||
`,
|
`,
|
||||||
styleUrls: ['demo.css']
|
styleUrls: ['../assets/demo.css']
|
||||||
})
|
})
|
||||||
export class CountdownLocalVarParentComponent { }
|
export class CountdownLocalVarParentComponent { }
|
||||||
// #enddocregion lv
|
// #enddocregion lv
|
||||||
@ -27,15 +27,15 @@ export class CountdownLocalVarParentComponent { }
|
|||||||
//// View Child version
|
//// View Child version
|
||||||
// #docregion vc
|
// #docregion vc
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'countdown-parent-vc',
|
selector: 'app-countdown-parent-vc',
|
||||||
template: `
|
template: `
|
||||||
<h3>Countdown to Liftoff (via ViewChild)</h3>
|
<h3>Countdown to Liftoff (via ViewChild)</h3>
|
||||||
<button (click)="start()">Start</button>
|
<button (click)="start()">Start</button>
|
||||||
<button (click)="stop()">Stop</button>
|
<button (click)="stop()">Stop</button>
|
||||||
<div class="seconds">{{ seconds() }}</div>
|
<div class="seconds">{{ seconds() }}</div>
|
||||||
<countdown-timer></countdown-timer>
|
<app-countdown-timer></app-countdown-timer>
|
||||||
`,
|
`,
|
||||||
styleUrls: ['demo.css']
|
styleUrls: ['../assets/demo.css']
|
||||||
})
|
})
|
||||||
export class CountdownViewChildParentComponent implements AfterViewInit {
|
export class CountdownViewChildParentComponent implements AfterViewInit {
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'countdown-timer',
|
selector: 'app-countdown-timer',
|
||||||
template: '<p>{{message}}</p>'
|
template: '<p>{{message}}</p>'
|
||||||
})
|
})
|
||||||
export class CountdownTimerComponent implements OnInit, OnDestroy {
|
export class CountdownTimerComponent implements OnInit, OnDestroy {
|
||||||
|
@ -4,7 +4,7 @@ import { Component, Input } from '@angular/core';
|
|||||||
import { Hero } from './hero';
|
import { Hero } from './hero';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-child',
|
selector: 'app-hero-child',
|
||||||
template: `
|
template: `
|
||||||
<h3>{{hero.name}} says:</h3>
|
<h3>{{hero.name}} says:</h3>
|
||||||
<p>I, {{hero.name}}, am at your service, {{masterName}}.</p>
|
<p>I, {{hero.name}}, am at your service, {{masterName}}.</p>
|
||||||
|
@ -4,13 +4,13 @@ import { Component } from '@angular/core';
|
|||||||
import { HEROES } from './hero';
|
import { HEROES } from './hero';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-parent',
|
selector: 'app-hero-parent',
|
||||||
template: `
|
template: `
|
||||||
<h2>{{master}} controls {{heroes.length}} heroes</h2>
|
<h2>{{master}} controls {{heroes.length}} heroes</h2>
|
||||||
<hero-child *ngFor="let hero of heroes"
|
<app-hero-child *ngFor="let hero of heroes"
|
||||||
[hero]="hero"
|
[hero]="hero"
|
||||||
[master]="master">
|
[master]="master">
|
||||||
</hero-child>
|
</app-hero-child>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
export class HeroParentComponent {
|
export class HeroParentComponent {
|
||||||
|
@ -4,13 +4,13 @@ import { Component } from '@angular/core';
|
|||||||
import { MissionService } from './mission.service';
|
import { MissionService } from './mission.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mission-control',
|
selector: 'app-mission-control',
|
||||||
template: `
|
template: `
|
||||||
<h2>Mission Control</h2>
|
<h2>Mission Control</h2>
|
||||||
<button (click)="announce()">Announce mission</button>
|
<button (click)="announce()">Announce mission</button>
|
||||||
<my-astronaut *ngFor="let astronaut of astronauts"
|
<app-astronaut *ngFor="let astronaut of astronauts"
|
||||||
[astronaut]="astronaut">
|
[astronaut]="astronaut">
|
||||||
</my-astronaut>
|
</app-astronaut>
|
||||||
<h3>History</h3>
|
<h3>History</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="let event of history">{{event}}</li>
|
<li *ngFor="let event of history">{{event}}</li>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'name-child',
|
selector: 'app-name-child',
|
||||||
template: '<h3>"{{name}}"</h3>'
|
template: '<h3>"{{name}}"</h3>'
|
||||||
})
|
})
|
||||||
export class NameChildComponent {
|
export class NameChildComponent {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user