angular-docs-cn/packages/core/test
Andrew Scott 779344012a refactor(core): assert TNode is not a container when setting attribute on element (#37111)
This PR provides a more helpful error than the one currently present:
`el.setAttribute is not a function`. It is not valid to have directives with host bindings
on `ng-template` or `ng-container` nodes. VE would silently ignore this, while Ivy
attempts to set the attribute and throws an error because these are comment nodes
and do not have `setAttribute` functionality.

It is better to throw a helpful error than to silently ignore this because
putting a directive with host binding on an `ng-template` or `ng-container` is most often a mistake.
Developers should be made aware that the host binding will have no effect in these cases.

Note that an error is already thrown in Ivy, as mentioned above, so this
is not a breaking change and can be merged to both master and patch.

Resolves #35994

PR Close #37111
2020-06-08 11:21:05 -07:00
..
acceptance refactor(core): assert TNode is not a container when setting attribute on element (#37111) 2020-06-08 11:21:05 -07:00
animation build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
bundling refactor(core): remove `looseIdentical` in favor of built-in `Object.is` (#37191) 2020-06-01 17:19:17 -04:00
change_detection refactor(core): remove `looseIdentical` in favor of built-in `Object.is` (#37191) 2020-06-01 17:19:17 -04:00
debug build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
di build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
dom build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
i18n build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
linker build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
metadata build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
reflection build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
render3 fix(core): infinite loop if injectable using inheritance has a custom decorator (#37022) 2020-06-03 13:16:25 -07:00
sanitization build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
strict_types build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
testability build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
util build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
view build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
zone build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
BUILD.bazel test(core): re-enable IE 10/11 test on SauceLabs (#35962) 2020-03-24 10:14:47 -07:00
application_init_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
application_module_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
application_ref_integration_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
application_ref_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
component_fixture_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
dev_mode_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
directive_lifecycle_integration_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
error_handler_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
event_emitter_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
fake_async_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
forward_ref_integration_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
spies.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
test_bed_async_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
test_bed_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
testing_internal_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
util_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00