Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload does not work with Isolated scope in a directive #600

Closed
gottfrois opened this issue Mar 3, 2015 · 4 comments
Closed

Upload does not work with Isolated scope in a directive #600

gottfrois opened this issue Mar 3, 2015 · 4 comments

Comments

@gottfrois
Copy link

Hey guys,

First of all, thanks for the great work you are putting into this lib, it's just amazing!

I'd like to extract the upload logic into a re-usable directive therefor with an isolated scope. Unfortunately as soon as I isolate the scope of the directive, upload does not work anymore.

I'm sure i'm missing something really trivial here so i'll just dump a plunker here. Any help or guidance would be much appreciated !

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

In app.js simply remove scope: {} to see it working again in web console.

Thanks,

@markvp
Copy link

markvp commented Mar 4, 2015

This seems to be an angular-wide issue related to your use of isolated scope with the controllerAs syntax in a directive. See: angular/angular.js#7635

@gottfrois
Copy link
Author

Thanks for pointing me in that direction but unfortunately, removing the controllerAs feature is still not uploading the file when isolating the scope. Any ideas?

Updated code: http://plnkr.co/edit/px1wmmVITJgLLFN2lMMQ?p=preview

@davidsielert
Copy link

Ever figure this out?

@gottfrois
Copy link
Author

More a work around, I forwared the files into the scope:

scope: {
    files: '='
}

Then watching the files:

$scope.$watch 'files', (files)->
  ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants