https://github.com/angular/angular
Revision dd28855455bad294282ed1c4e0bc55b7fca0f9b9 authored by George Kalpakas on 04 November 2020, 18:46:59 UTC, committed by Misko Hevery on 06 November 2020, 17:31:49 UTC
As with regular Angular components, Angular elements are expected to
have their views update when inputs change.

Previously, Angular Elements views were not updated if the underlying
component used the `OnPush` change detection strategy.

This commit fixes this by calling `markForCheck()` on the component
view's `ChangeDetectorRef`.

NOTE:
This is similar to how `@angular/upgrade` does it:
https://github.com/angular/angular/blob/3236ae0ee118d0734c90fa9f3767435396213470/packages/upgrade/src/common/src/downgrade_component_adapter.ts#L146.

Fixes #38948

PR Close #39452
1 parent ff925af
Raw File
Tip revision: dd28855455bad294282ed1c4e0bc55b7fca0f9b9 authored by George Kalpakas on 04 November 2020, 18:46:59 UTC
fix(elements): update the view of an `OnPush` component when inputs change (#39452)
Tip revision: dd28855
BUILD.bazel
package(default_visibility = ["//visibility:public"])

exports_files([
    "LICENSE",
    "karma-js.conf.js",
    "browser-providers.conf.js",
    "scripts/ci/track-payload-size.sh",
    "scripts/ci/payload-size.sh",
    "scripts/ci/payload-size.js",
    "package.json",
])

alias(
    name = "tsconfig.json",
    actual = "//packages:tsconfig-build.json",
)

filegroup(
    name = "web_test_bootstrap_scripts",
    # do not sort
    srcs = [
        "@npm//:node_modules/core-js/client/core.js",
        "//packages/zone.js/bundles:zone.umd.js",
        "//packages/zone.js/bundles:zone-testing.umd.js",
        "//packages/zone.js/bundles:task-tracking.umd.js",
        "//:test-events.js",
        "//:third_party/shims_for_IE.js",
        # Including systemjs because it defines `__eval`, which produces correct stack traces.
        "@npm//:node_modules/systemjs/dist/system.src.js",
        "@npm//:node_modules/reflect-metadata/Reflect.js",
    ],
)

filegroup(
    name = "angularjs_scripts",
    srcs = [
        # We also declare the unminified AngularJS files since these can be used for
        # local debugging (e.g. see: packages/upgrade/test/common/test_helpers.ts)
        "@npm//:node_modules/angular/angular.js",
        "@npm//:node_modules/angular/angular.min.js",
        "@npm//:node_modules/angular-1.5/angular.js",
        "@npm//:node_modules/angular-1.5/angular.min.js",
        "@npm//:node_modules/angular-1.6/angular.js",
        "@npm//:node_modules/angular-1.6/angular.min.js",
        "@npm//:node_modules/angular-mocks/angular-mocks.js",
        "@npm//:node_modules/angular-mocks-1.5/angular-mocks.js",
        "@npm//:node_modules/angular-mocks-1.6/angular-mocks.js",
    ],
)

# Detect if the build is running under --stamp
config_setting(
    name = "stamp",
    values = {"stamp": "true"},
)
back to top