Skip to content

[BottomNavigation] Binding inside BottomNavigation/Tabs will work only if wrapped in NgZone #1896

Closed

Description

@NickIliev

Steps to reproduce:

Behavior: The Angular binding will work only when wrapped in the Angular zone. Remove the NgZone and the binding won't update the UI (on selectedIndexChanged event).

Related to NativeScript/NativeScript#6967

Activity

  1. MartoYankov commented on Jul 17, 2019

    @MartoYankov
    Contributor

    We discussed this and it's actually expected and not connected to the BottomNavigation widget. All UI components event handlers are automatically wrapped in the zone when they are declared in the markup. This is not the case when event handlers are declared in the code-behind via the on API. The problem arises only with events that are fired from native code or callbacks called from a native code.

    A possible solution would be to patch the Observable class in nativescript-angular to automatically wrap the on callback in the zone. Perhaps we should discuss this further with @VladimirAmiorkov and @vakrilov and log a new issue.

    For the time being, we agreed to document this where needed.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions