0

I'm stuck in situation where I have a Main html & js files which includes same Sub page (html & js) containing ng-upload component two times.

In Main page's controller I have defined different javascript filename arrays to both ng-included Sub pages instances. To Sub page's controller I pass an argument in ng-include directive so, that Sub page's controller should know witch filename array it should be using.

I have also $watch for both Main page's filename arrays in sub page's controller because all added files are copied and uploaded from sub page's controller.

There is also a Servlet which moves file content from ng-upload from Sub page to BackEnd.

Problem is that when updating one Upload component in Main page it also updates second Upload component's file list. I have tried to avoid that using different javascript filename arrays.

But I want to know is that can I use same Sub page containing ng-upload directive using ng-include directives in Main page? Is that allowed?

I would not like to write two all most same kind of Sub pages / Controllers to get this issue to work.

Has anyone of you used same instance of Sub page/controller in Main page and succesfully handling upload from each Sub page?

An example would be great,

Best Regards, Michael

4
  • It's allowed. please show your code or a plunker. Jan 16, 2014 at 17:06
  • Hello, thanks for reply. I can't get source for that code because it's quite large project, But are there any samples or something else around that could help? Br Michael Jan 16, 2014 at 20:15
  • Your problem could be caused by so much reasons. Obviously it's a scope issue ( maybe you bind to a primitive , read more) but also I cannot understand how your controllers and files are structured. Maybe you can post only the related parts of the code. Jan 16, 2014 at 20:32
  • Actually I passed parameters from Main page using ng-repeat in ng-include. I passed an Object containing all data and parameters for both cases and that solved the whole problem. Jan 22, 2014 at 16:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.