Skip to content

support for $watch-ing any property on a vm #328

@weisjohn

Description

@weisjohn

I'm trying to subscribe to any data changes made against any property on the vm, not just pre-defined property names. I couldn't find any way to do it, so here's my proposal.

I made an example here: http://jsfiddle.net/BBk3j/. In the first $watch, I subscribe to changes on the foo property. The next two $watch statements would be my proposal to allow any watching for updates on any property. Either support a wildcard syntax (which I don't think is a great idea, because * is a valid property name in JS), or a better syntax that makes the string property name optional.

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