title: ng-flow.js, how to display responsed JSON data in HTML or controller
body: <p>I'm using ng-flow, script named ng-flow-standalone.js from here: <a href="https://github.com/flowjs/ng-flow" rel="nofollow">https://github.com/flowjs/ng-flow</a></p>
  
  <p>My concept is when user adding a new item, only upload field is showing and once the photo is uploaded the additional form fields will be showing up e.g. Title, Description.</p>
  
  <p>In code, app will create product_id, image_id and then saving the file.
  Once saving process is complete, it will return product_id, image_id and etc in json format.
  HTML, hidden form fields will be displayed once product_id is defined.</p>
  
  <p>I see JSON responded by the server in console log but do not know how to display it in HTML or angular controller. I can't see this how-to in the docs and demo. Can anyone help me?</p>
  
  <p>Thanks</p>
  
  <p>Example code:</p>
  
  <pre><code>..
  &lt;script src="/assets/js/ng-flow-standalone.js"&gt;&lt;/script&gt;
  ..
  &lt;div class="row"&gt;
    &lt;div class="col-md-4" flow-init="{target:'upload_image.json'}" flow-file-added="!!{png:1,gif:1,jpg:1,jpeg:1}[$file.getExtension()]"&gt;
      &lt;div class="panel panel-default"&gt;
        &lt;div class="panel-heading"&gt;
          &lt;h3 class="panel-title"&gt;Photos&lt;/h3&gt;
        &lt;/div&gt;
        &lt;div class="panel-body"&gt;
          &lt;div class="row"&gt;
            &lt;div ng-repeat="file in $flow.files"&gt;
              &lt;div class="col-md-3"&gt;
                &lt;div class="thumbnail"&gt;
                  &lt;img flow-img="file" /&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div&gt;
            &lt;span class="btn btn-primary" flow-btn flow-files-submitted="$flow.upload()"&gt;Upload&lt;/span&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="col-md-8" ng-show="{{ xxx.product_id }}"&gt;
      &lt;form class="panel panel-default form-horizontal"&gt;
        &lt;div class="panel-heading"&gt;
          &lt;h3 class="panel-title"&gt;Infomation&lt;/h3&gt;
        &lt;/div&gt;
        &lt;div class="panel-body"&gt;
          &lt;div class="form-group"&gt;
            &lt;label class="col-sm-2 control-label"&gt;Title&lt;/label&gt;
            &lt;div class="col-sm-6"&gt;
              &lt;input name="name" type="text" class="form-control" required&gt;
            &lt;/div&gt;
            &lt;div class="col-sm-4"&gt;&lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
            &lt;label class="col-sm-2 control-label"&gt;Description&lt;/label&gt;
            &lt;div class="col-sm-6"&gt;
              &lt;textarea class="form-control" rows="3" required&gt;&lt;/textarea&gt;
            &lt;/div&gt;
            &lt;div class="col-sm-4"&gt;Write useful info e.g. appearance, purpose and recommendations&lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="panel-footer"&gt;
          &lt;input type="hidden" name="product" value="{{ xxx.product_id }}"&gt;
          &lt;button type="submit" class="btn btn-primary"&gt;Save changes&lt;/button&gt;
        &lt;/div&gt;
      &lt;/form&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Notice at "xxx.product_id", xxx is what I don't know, may be somehting like $flow.fileSuccess.message.product_id.</p>
  
  <p><strong>SOLUTIONS:</strong>
  Using callback method in Controller as recommended by Aidas</p>
  
  <pre><code>$scope.$on('flow::filesSubmitted', function (event, $flow, flowFile)
    products.save($scope.product)
    .$promise.then(function(result) {
      $scope.product = result;
      if ($scope.product.id) {
        $flow.opts.target = apiUrl + '/products/' + $scope.product.id + '/images';
        $flow.upload();
      }
    });
  });
  </code></pre>