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

Initialize flow-init with an existing $flow obj #17

Closed
manuelmazzuola opened this issue Mar 27, 2014 · 8 comments
Closed

Initialize flow-init with an existing $flow obj #17

manuelmazzuola opened this issue Mar 27, 2014 · 8 comments

Comments

@manuelmazzuola
Copy link

I would like to override the $flow object created by the flow-init directive with an existing one.
For example, when I am on the A view I upload a file, the listener on flow::fileAdded save the $flow object. Then I browser to view B and then return to the view A, now, I would like to initialize the flow-init directive with the $flow saved before.
Thanks !

@manuelmazzuola manuelmazzuola changed the title Initialize flow-init with an exists $flow Initialize flow-init with an existing $flow obj Mar 27, 2014
@AidasK
Copy link
Member

AidasK commented Mar 27, 2014

I would suggest you to init flow on top of <html> tag. This way flow will be initialized on all pages with the same instance.

@AidasK AidasK closed this as completed Apr 8, 2014
@themcguy
Copy link

I think the problem is that I'm attempting to use ng-flow inside a modal. Should I be able to do this? It seems that $flow is undefined when I do.

@amerjx
Copy link

amerjx commented Jul 16, 2014

@themcguy did you get an answer to your question? i am trying the the same too

@mparisi76
Copy link

I ended up going with a different solution using node fs. Flow seems to be a good solution when you expect large file sizes where chunking would benefit, but it wasn't in my requirements. Good luck.

@AidasK
Copy link
Member

AidasK commented Jul 17, 2014

It should work ok in modals if they don't use isolated scope.
UI bootstrap allows you to set scope option, which is by default a root scope. You could set it to controller scope and it should work.

If flow is initialized on <html> or <body> it should be available to use in modals by default, because they inherit root scope.

@dtrack
Copy link

dtrack commented Aug 2, 2014

AidasK I just ran into the problem that themcguy was having.
Even If I make the modal scope be a child of my controller scope, I have an error because the flow directives inside the modal (I need the drop and img directive) require "^flowInit" which are not in their ancestor line.
Also I do need flow to be limited to the scope of my controller, as I could have different flow obj initiated in different controllers.
It might be worth to have flowInit accept an existing $flow obj

@AidasK
Copy link
Member

AidasK commented Aug 3, 2014

@dtrack You can make a pull request for this feature.
https://github.com/flowjs/ng-flow/blob/master/src/directives/init.js#L5
If $attrs.flowObject is defined, do not create new flow object.

@bjDesign
Copy link

bjDesign commented May 8, 2015

Holy crap, AidasK. Thanks for your answer on Mar 27, 2014. I fought with this all day today. So simple.

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

7 participants