3

I want to pass dynamic url to flow-init's target property. the URL was generated at runtime.

If I assign a scope object which contains the properties for flow-ini. Then it return parse error.

2 Answers 2

1

I had the same issue:

flow-init="{target: baseUrl + 'some_url_location/another_url_location/{{entityID}}/'}"

and changed to

flow-init="{target: baseUrl + 'some_url_location/another_url_location/' + entityID + '/'}"

where entityID is $scope.entityID in my js controller. This $scope.entityID is taken from the current URL.

Sign up to request clarification or add additional context in comments.

Comments

1

In your controller create a function to the scope taking the $flow variable and setting it's target to your dynamic url, also use the $flow.upload function here:

$scope.submitFlow =  function($flow) {
    $flow.opts.target = '/user/'+ $scope.user.id +'/submit-file';
    $flow.upload();
  };

Then in your html, in the flow-init div, set the flow-files-submitted to our function:

<div flow-init
         flow-files-submitted="submitFlow($flow)"
         flow-file-success="$file.msg = $message">

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.