Skip to content

Changing options of Function type in runtime is not supported #589

@zuzusik

Description

@zuzusik

Steps to reproduce

  1. try changing any option which type is Function in runtime

Demo: http://jsfiddle.net/95dLpcgs/

Expected behaviour

New option is applied - as stated in docs

Actual behaviour

Option is not applied

Investigation result

This is because when watching on options under the hood angular.equals is used, which ignores functions - try running angular.equals({a: () => 1}, {a: () => 2}) - it returns true though objects aren't equal (I assume this is by design)

Possible workaround

Every time when Function option is changed - add some random value to options (ugly, but works - look at demo page above)

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