Skip to content

Angular binding problem #46

Open
Open

Description

@garagenisse

Can't get this excellent tool to work for me when binding objects from cache to selectbox. When hitting F5 the value of the select is lost, the correct value is there but the select wont initiate correct.

Example:
http://plnkr.co/edit/dpdANDKAq8eeHPMj5CbG?p=preview

Any ideas?

Regards Andreas

Activity

  1. cDima commented on Apr 21, 2014

    @cDima

    Not sure what's going on, but add the cookie dependency
    http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular-cookies.min.js

  2. garagenisse commented on Apr 21, 2014

    @garagenisse
    Author

    Didn't help, whats going on is that above the upper drop a value is printed that's persisted in local storage, works fine on F5, but below that text the drop fails to initiate on that value "data-ng-init" should position the drop to the value printed above.

    The lower drop is just there to test without local storage and works fine.

    Regards Andreas

  3. thombrg commented on Apr 22, 2014

    @thombrg

    I believe the problem stems from the tracking mechanism angular uses with
    object-based array of options. And, the version of angular you're using
    doesn't have the "track by" feature which would allow you to map object
    selections by an object property of your choosing, for example id. The only
    solution I could think of was to force the store bound variable to
    reference its matching object in the options array upon controller
    instantiation. (see plunker)

    http://plnkr.co/edit/RsS4ylLMKedC5iyA35z9?p=preview

    On Mon, Apr 21, 2014 at 1:27 PM, garagenisse notifications@github.comwrote:

    Didn't help, whats going on is that above the upper drop a value is
    printed that's persisted in local storage, works fine on F5, but below that
    text the drop fails to initiate on that value "data-ng-init" should
    position the drop to the value printed above.

    The lower drop is just there to test without local storage and works fine.

    Regards Andreas

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/46#issuecomment-40961198
    .

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions