Skip to content

[Bug]: Namespaced Custom Events聽#28491

Description

@daniel-nagy

馃悶 bug report

Affected Package

platform-browser

Is this a regression?

No.

Description

Custom events that are namespaced using the syntax namespace:event will fail. For example, binding to the MDCTabBar:activated event will fail (source).

<mwc-tab-bar (MDCTabBar:activated)="onTabActivated($event)"></mwc-tab-bar>

The problem is Angular will think you are listening to an activated event on a global MDCTabBar event target (source).

Possible Solution

If Angular doesn't know about the event target then assume it is part of the event name, or add syntax to tell Angular to listen to the event name verbatim. I think I saw the ^ syntax in another issue.

e.g.

<!-- hey Angular, don't mess with the event name -->
<mwc-tab-bar (^MDCTabBar:activated)="onTabActivated($event)"></mwc-tab-bar>

馃敩 Minimal Reproduction

Not needed.

馃敟 Exception or Error


Unsupported event target null for event activated

馃實 Your Environment

Angular Version:


platform-browser: 7.0.3

Anything else relevant?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions