Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Stop watchers in template #14988

Closed
Closed
@iamisti

Description

@iamisti

Hi Guys,
I'd like to request a new feature if it's not yet in.
It's a performance improvement which I think should be in the framework.

The problem:
There is no way to stop watchers in a template or convert them to one-time data binding.

Use case:
I have a list of items which has some properties that can change during time. I need two-way data binding there. But there are certain changes that put them into a final state, and their data will never change anymore after that state.
At that moment the two-way data bindings are not required anymore.
And another problem with those items is the amount of them as they keep growing and the watchers are increasing continously.

Example for the feature:
aStatus:
is a status of an item which can be the following: 'new', 'pending', 'sent'

oneTimeBinding
is a filter which is supposed to stop two-way data binding and convert it to one-time data binding based on a filter which is passed as a value.

    <!-- if value of aStatus is 'sent' then stop two-way data binding -->
    <div>{{aStatus | oneTimeBinding:'sent'}}</div>

My feature request for having a 'filter' for it is just an idea, it can be anything else.
All I need is to have possibility to stop bindings in views.

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions