Skip to content

storage.bind() doesn't work inside factory  #52

Open

Description

@sqwk

storage.bind() doesn't work inside a factory, I assume because there is no scope.

Passing an object doesn't work either:

app.factory('someFactory', function(storage) {

    var settings = {
        foo: 'bar',
        lorem: 'ipsum'
    }

    storage.bind(settings,'foo');
});

This produces the error undefined is not a function at Object.publicMethods.bind

Activity

  1. renanlecaro commented on Sep 23, 2014

    @renanlecaro

    There is no reason to bind values out of a scope. One option is to make the factory a function which accepts a $scope as arg, add the value to it, and use the scope to watch the value.

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