Skip to content

State param not passed by reference when using ui-sref? #3310

Closed
@cadilhac

Description

@cadilhac

Hi,

I am used, when using angular 1.5 components, to be able to modify a property of a one-way binding in a child component and get the value also modified in the parent since the binding is passed by reference. So I was expecting the same when passing an object as the param of a target state.

<a ng-repeat="game in $ctrl.games" ui-sref="myState({ game: game})">Go</a>

Unfortunately, when I modify a property of game in the controller of MyState, it doesn't change it in parts of the page that also reference the game object. Is it possible that the object is cloned when passed as a param?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions