Giter VIP home page Giter VIP logo

ng-flow's Introduction

ng-flow Build Status Test Coverage

Saucelabs Test Status

View angular2+ repo at https://github.com/flowjs/ngx-flow

ng-flow is a Flow.js extensions for angular.js framework, no 3rd party JS dependencies required!

Demo: http://flowjs.github.io/ng-flow/

How can I install it?

  1. Get the library:

Direct Download Download a latest build from https://github.com/flowjs/ng-flow/releases it contains development and minified production files in dist/ directory, they are also concatenated with core flow.js library.

Using NPM

    npm install @flowjs/ng-flow --save

Using Bower

    bower install ng-flow#~2

Git Clone

    git clone https://github.com/flowjs/ng-flow

Using Yeoman

    bower install "ng-flow#~2" --save
    grunt bower-install
  1. Add the module to your app as a dependency:

     angular.module('app', ['flow'])
    
  2. Include the files in your project

<!-- concatenated flow.js + ng-flow libraries -->
<script src="ng-flow/dist/ng-flow-standalone.min.js"></script>
<!-- or include the files separately -->
<script src="flow.js/dist/flow.min.js"></script>
<script src="ng-flow/dist/ng-flow.min.js"></script>

How can I use it?

First of all wrap places there you are going to use Flow.js

<div flow-init>
    ... other flow directives goes here ...
</div>

This directive is going to add $flow variable to current scope. Also directive can be nested, because $flow variable is going to be overridden. $flow is instance of Flow.

Secondly you need to assign some upload buttons:

<input type="file" flow-btn />
<input type="file" flow-btn flow-directory />
  Input OR Other element as upload button
<span flow-btn>Upload File</span>

First button is for normal uploads and second is for directory uploads. Note: avoid using <a> and <button> tags as file upload buttons, use <span> instead.

Now you need to display uploaded files, all you need to do is to loop files array. Files array is attached to flow object named $flow.

<tr ng-repeat="file in $flow.files">
    <td>{{$index+1}}</td>
    <td>{{file.name}}</td>
</tr>

file is instance of FlowFile.

Quick setup

<div flow-init="{target: '/upload'}"
     flow-files-submitted="$flow.upload()"
     flow-file-success="$file.msg = $message">

  <input type="file" flow-btn/>
  Input OR Other element as upload button
  <span class="btn" flow-btn>Upload File</span>

  <table>
    <tr ng-repeat="file in $flow.files">
        <td>{{$index+1}}</td>
        <td>{{file.name}}</td>
        <td>{{file.msg}}</td>
    </tr>
  </table>
</div>

Need more examples?

Clone this repository and go to "ng-flow/samples/basic/index.html". Single image upload "ng-flow/samples/image/index.html".

How can I drop files?

Use flow-drop directive:

<div class="alert" flow-drop>
    Drag And Drop your file here
</div>

Note: in most cases flow-drop must be used together with flow-prevent-drop directive on body element, because it prevents file from being loaded in the browser.

Prevent dropping files on a document

Use flow-prevent-drop directive on body element:

<body flow-prevent-drop>

</body>

How to add some styles while dropping a file?

Use flow-drag-enter directive:

<div flow-drag-enter="style={border:'4px solid green'}" flow-drag-leave="style={}"
     ng-style="style">
</div>

Note: flow-drag-leave attribute can't be used alone, it is a part of flow-drag-enter directive.

How to dynamically disable drop area?

<div class="alert" flow-drop flow-drop-enabled="config.enabled">
    Drag And Drop your file here
</div>

See example at samples/dataurl/.

How can I preview uploaded image?

Use flow-img directive:

<img flow-img="$flow.files[0]" />

Image will be automatically updated once file is added. No need to start upload.

How can I set options for flow.js?

Use config:

var app = angular.module('app', ['flow'])
.config(['flowFactoryProvider', function (flowFactoryProvider) {
    flowFactoryProvider.defaults = {
        target: '/upload',
        permanentErrors:[404, 500, 501]
    };
    // You can also set default events:
    flowFactoryProvider.on('catchAll', function (event) {
      ...
    });
    // Can be used with different implementations of Flow.js
    // flowFactoryProvider.factory = fustyFlowFactory;
}]);

also can be configured on "flow-init" directive:

<div flow-init="{target:'/uploader'}">

</div>

How can I catch events?

Events are listed inside flow-init directive:

<div flow-init
        flow-file-success="someHandlerMethod( $file, $message, $flow )"
        flow-file-progress="someHandlerMethod( $file, $flow )"
        flow-file-added="someHandlerMethod( $file, $event, $flow )"
        flow-files-added="someHandlerMethod( $files, $event, $flow )"
        flow-files-submitted="someHandlerMethod( $files, $event, $flow )"
        flow-file-retry="someHandlerMethod( $file, $flow )"
        flow-file-error="someHandlerMethod( $file, $message, $flow )"
        flow-error="someHandlerMethod( $file, $message, $flow )"
        flow-complete=" ... "
        flow-upload-started=" ... "
        flow-progress=" ... "
      >
      <div flow-file-progress=" ... events can be also assigned inside flow-init ... "></div>

</div>

How can I catch an event in a controller?

If controller is on the same scope as flow-init directive or in a child scope, then we can catch events with $on. Events are prefixed with flow::.

$scope.$on('flow::fileAdded', function (event, $flow, flowFile) {
  event.preventDefault();//prevent file from uploading
});

second argument is always a flow instance and then follows event specific arguments.

How can I assign flow to a parent scope?

Use flow-name attribute and set it to any variable in the scope.

<div flow-init flow-name="obj.flow">
    ... Flow is set to obj.flow  ...
    I have uploaded files: #{{obj.flow.files.length}}
</div>
$scope.obj = {}; // variable "obj" must be initialized on the scope

How can I initialize flow with an existing flow object ?

Use flow-object attribute and set it with the existing flow object on scope.

<div flow-init flow-object="existingFlowObject">
    ... Flow is initialized with existingFlowObject, no new Flow object  is created ...
    There are already {{ existingFLowObject.files.length }} files uploaded,
    which is equal to {{ $flow.files.length }}.
</div>

How can I support older browsers?

Go to https://github.com/flowjs/fusty-flow.js and add to your config:

var app = angular.module('app', ['flow'])
.config(['flowFactoryProvider', function (flowFactoryProvider) {
    flowFactoryProvider.factory = fustyFlowFactory;
}]);

Contribution

To ensure consistency throughout the source code, keep these rules in mind as you are working:

  • All features or bug fixes must be tested by one or more specs.

  • With the exceptions listed below, we follow the rules contained in Google's JavaScript Style Guide:

    • Wrap all code at 100 characters.

    • Instead of complex inheritance hierarchies, we prefer simple objects. We use prototypical inheritance only when absolutely necessary.

ng-flow's People

Contributors

adrianthedev avatar aidask avatar bygiro avatar codebakery-ch avatar decklord avatar evilaliv3 avatar ja9ad335h avatar jlcarvalho avatar johnfraney avatar kazarena avatar milosstanic avatar rashidul0405 avatar rhynodesigns avatar roccivic avatar thorn0 avatar twilczak avatar urigo avatar vrana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ng-flow's Issues

Ajax upload inside form with other fields.

This is not an issue but a question rather. How can I combine the flow within a form that submits with ajax but not automatically as file is added. through angular controller method? The version I have on the site at the moment is rather clunky and not very angular best practice as it uses native httprequest over angular $http in order to catch progress events. Is there a way to use angular with flow to show upload progress over ajax on submit? Thanks again for great module!

I can't get this module to work

Hi,

I have discovered this module to Angular and it looks great, but as hard as I am trying, I can't figure out how to use it.

I have a directive, in which I have this code

<form class="ui form">
    <div class="content ui segment">
        <div class="field">
            <input type="text" data-ng-model="data.title" placeholder="{{ 'Title'|translate }}">
        </div>

        <div flow-init="{target: '/api/outfit'}">
            <button type="button" class="ui button" flow-btn data-ng-show="!$flow.files.length">Select file with photo</button>
            <div class="field" data-ng-show="$flow.files.length">
                <img flow-img="$flow.files[0]">
            </div>
            <input type="submit" class="ui blue submit button" value="{{ 'Add outfit'|translate }}" data-ng-show="$flow.files.length">
        </div>
    </div>
</form>

What do I have to do, to:

  1. Begin file upload right after it is selected
  2. Begin file upload after the form is submitted?

Thanks a lot in advance.

Cannot catch event from controller with the $on

This is not working in the controller:
$scope.$on('flow::fileAdded', function (event, $flow, flowFile)

I've changed the L1562 to $rootScope.$broadcast(event.name) and worked but I do not get the fileName!

Additional File Info

How do I attach additional file information to the uploaded file?

I need to pass in a job number along with the uploaded file so I know where to store it and how to update a database.

As a quick fix, I have (in CoffeeScript)

    fileSubmitted: (event, flow) =>
        angular.forEach flow.files, (file) =>
            file.uniqueIdentifier = "#{@$scope.jobNumber}_#{file.name}"
        flow.upload()

I do not know if updating all uniqueIdentifiers with every submission is going to be a problem.

Modify target at later date

I have this working in my project, but I am using a variable that uses model data like this:

flow-init="{target: flowUrl}"

It uses the url before the model data is loaded in. The url is "/api/uploads", but once the model data is loaded it should be something like "/api/uploads/2". Is there a way to modify the target after the fact, like after the model data is loaded?

Using ng-flow + ui-router

I'm using ng-flow on one of the pages in my route. For HTML5 compliant browsers everything works fine. But for IE8+9, which I unfortunately have to support (insert head banging) it's throwing an error. I've added the fusty flow files, but the directive (flow-init) is throwing an error that FustyFlow is undefined. Any ideas/suggestion on how to tackle this would be appreciated. Thanks!

image not uploaded

I was trying to upload an image using flow.js .it is just creating a temp folder but not upload file. please help me

ReferenceError: Flow is not defined

Hello !
I don't get the module to work. It throws this error :

ReferenceError: Flow is not defined at factory (http://client.local/lib/ng-flow.min.js:2:136) [...]

I included the javascript file like this at the end of my html file:

<script src="/lib/ng-flow.min.js" type="text/javascript"></script>

Load the module into my angularjs app like this:

var myApp = angular.module('myApp', ['flow','ngRoute', 'ui.bootstrap','ngResource']);

And this is where I call the directive :

<div class="row" flow-init>
</div>

What am I doing wrong ?

Thanks in advance for your support !

events unsubscribe

Hi! thank you for great module.
My question is : if $flow is registered in root scope how can I unsubscribe from events? Should I pop event and callback every time I navigate away from controller?

Pass FlowJS an image file from Cordova camera API

I have a Cordova feature that allows me to fetch images from a users gallery.

I really like your solution and was wondering if it's possible to add an image via File URI to the current instance of Flow in the getPicture() callback you see here:

$cordovaCamera.getPicture(options).then(function(imageData) {
  window.resolveLocalFileSystemURI(imageData, function(file) {
    //Could I pass flow a new image programmatically somehow?
    //$scope.uploader.flow.addFile(file);
  });
});

I see in your docs you have addFile() but it's described as "Add a HTML5 File object to the list of files." and I'm not sure this would work because this isn't an HTML5 file object right?

Could any file be passed from the Cordova File API?

ng-flow not working

First, am I supposed to use ng-flow-standalone? or just ng-flow? Is there documentation on how to use both?

When I use ng-flow-standalone I am getting this error:

TypeError: Cannot call method 'assignBrowse' of undefined

and

TypeError: Cannot call method 'assignDrop' of undefined

Thanks.

Preview from stored images in server

I am trying to preview image from server which is user already uploaded before. Basically I want to initialize the $flow object with already uploaded file in server. So this way when user will try to do edit they will see already uploaded image in preview and from there they can Select one or Remove.
Is it possible? Please help me out.

Problem with uploading files, flow-php-server and Laravel

I ran into a problem of files not being uploaded today using flow-php-server together with Laravel. For me the problem was that the 404 header wasn't properly returned on the test function of flow.js. Instead it would just return a 200 which in turn caused flow.js to not send the POST request after the GET request to check for the chunk existence.

In Laravel you should do something like this in the controller method that handles the flow.js requests. (taken from the basic example):

if (\Flow\Basic::save('./uploads/name_of_new_file', './chunks_temp_folder')) {
  // file saved successfully and can be accessed at './final_file_destination'
} else {
  // This is not a final chunk or request is invalid, continue to upload.
  $response = Response::make('', 404);
  return $response;
}

When I started I left the else block empty. Now the whole thing makes sense to me, but I haven't done much backend before, so all in all this took me a couple of hours. I figured maybe posting this here helps someone else.

Bower tagged releases aren't releases

i'm using bower to get ng-flow. What it in bower_components is just src, there is not unified/minified dist file anywhere. I was expecting to see a dist/ng-flow.min.js.

Could I post the image as base64 in JSON?

Hi,

Maybe it's a stupid idea buy I am using a groovy server and I wouldn't mind if I could get the image as base64. I don't want to use the upload.php file. Is there a way to bind the base64 string to a ng-model?

Many thanks!
Tom

Using ng-flow with requirejs

This isn't an issue but a question. I'm trying to use ng-flow with my app. We use requirejs to load modules, and I can't get it to work for some reason. Does anyone have experience getting ng-flow to work with requirejs?

I have these lines in the paths in requirejs's config object:
'flow': 'lib/dist/ng-flow/ng-flow-standalone'

And the controller where I want to use flow starts as such ('angular' pointing to angular):

define([
    'angular',
    'flow'
], function (angular, flow) {

And this is the HTML code controlled by that controller:

<div flow-init>
    <input type="file" flow-btn />
    <table><tr ng-repeat="file in $flow.files">
        <td>{{$index+1}}</td>
        <td>{{file.name}}</td>
    </tr></table>
</div>

The code isn't working though. I get a regular file input button, but no text appears underneath that input after I select some files.

Per FlowFile Target/URL

Is it possible to set a target/URL for each inviidual file? Our REST API uses endpoints like /api/file/1/data, /api/file/2/data, etc so we need the ability to set a URL target per file.

Thanks.

Uploading to dynamic directories

Hi, first off, great little library here. I've been implementing it into my website and I like it a lot!

I was wondering if it's possible to specify a custom upload directory based on certain ids in my application (product id, and/or user id)?

Thanks.

Not workin in Safari browser(5.1.7)

In safari browser it is giving following error on load

'undefined' is not an object (evaluating 'this.events.hasOwnProperty')
ng-flow-standalone.js line:152

So many files

Whats the reason for having to include so many files? Why not consolidate into one src file or have a build?

Drag and drop folders does not work

Hello,

By using the samples found in ng-flow repository (e.g., samples/basic) I'm unable to drag and drop a folder. Note that I'm able to select a folder with the button and to upload them.

When a folder is dragged and dropped to a flow-drop zone, the following error occurs in Chrome's console:

    Uncaught #<FileError>                            ng-flow-standalone.js:243
    readError

Problem occurred with angularjs 1.2.3, 1.2.15 and 1.2.16.

The demo (http://flowjs.github.io/ng-flow/) which seems to use a former version of ng-flow supports folder drag'n drop.

What do I need to do in order to enable folder drag'n drop?

Getting HTTP 415 Error Using ASP.Net WebApi

Using the example code I'm getting a 415 error when trying to do a GET to an ASP.net WebApi service. Am I missing some config settings for WebApi? Here is the http header info:

Remote Address:127.0.0.1:80
Request URL:http://ramapi.localhost/Blog/SavePostImage?flowChunkNumber=1&flowChunkSize=1048576&flowCurrentChunkSize=37709&flowTotalSize=37709&flowIdentifier=37709-primeshine-logopng&flowFilename=primeshine-logo.png&flowRelativePath=primeshine-logo.png&flowTotalChunks=1
Request Method:GET
Status Code:415 Unsupported Media Type
Request Headersview source
Accept:/
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8,de;q=0.6,it;q=0.4
Cache-Control:no-cache
Connection:keep-alive
Host:ramapi.localhost
Origin:http://ramadmin.localhost
Pragma:no-cache
Referer:http://ramadmin.localhost/
User-Agent:Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36
Query String Parametersview sourceview URL encoded
flowChunkNumber:1
flowChunkSize:1048576
flowCurrentChunkSize:37709
flowTotalSize:37709
flowIdentifier:37709-primeshine-logopng
flowFilename:primeshine-logo.png
flowRelativePath:primeshine-logo.png
flowTotalChunks:1
Response Headersview source
Access-Control-Allow-Headers:Content-Type
Access-Control-Allow-Origin:*
Cache-Control:no-cache
Content-Length:0
Date:Wed, 28 May 2014 15:18:31 GMT
Expires:-1
Pragma:no-cache
Server:Microsoft-IIS/8.5
X-AspNet-Version:4.0.30319
X-Powered-By:ASP.NET

Ubuntu file drag effect.

File drag must be in movement so that drop area effect would be active. This seems to be Ubuntu specific issue, because this does not occur on windows.

Binding to existing image

Hello,

Congrats on ng-flow. Great module. I am working on a CRUD angular page and I need to provide edit image functionality. I simply link to a rest api to get an image for a particular thumbnail id and the image will show if it exists. I need to make this image editable or should I say replaceable. I am not sure how can I set this image as $flow.files[0] so I can update the preview later if the user chooses to upload a new image to replace the old one. What is the relationship of $flow and $scope? What kind of elements does the files array hold?

Thanks
Dino

ng-flow and RESTful API

Hi Guys,

Great plugin, thanks for the efforts! I'm looking to integrate this with a RESTFUL PHP API and it makes sense that when sending data it is POSTED (Possibly using PUT if its the 2nd chunk, but lets ignore that for now) and when checking a chunk has uploaded it should be a GET request. Is this possible?

Thanks in advance,
Ben

Initialize flow-init with an existing $flow obj

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 !

Uploading multiple files sequentially

My need is pausing upload for a while after each file is uploaded and resume. In this i can only find pause and resume option but i could find any option to upload files sequentially (uploading one file after another). I find only concurrent uploading but i need sequential uploading.

Please help me how can achieve using this library?.

Accessing file data with AngularJS without exchanging data to server

Hello,

I would like to know how to access the content of the files selected/droped by the user.

I guess, listening to 'flow::fileAdded' events is a good starting point. Then, is there a need to instantiate a standard FileReader() object or are there ng-flow specifics?

Thanks

img element?

Am I correct in my understanding that any <img> within the element that contains the flow-init attr is not a regular html element? Reusing the name is a little confusing.

Target issue

I dont use PHP and have not installed it on my computer. After getting the latest from the github site, in the apps.js, I changed the target to be '/temp/uploader', however the Upload button does not work correctly (errors on browser console) when running the samples\basic\index.html; please see the attachments. Everything else seems to be working fine, such as drag-and-drop, file selection, page layout (bootstrap), and so on.

what am do I need to do set be able to upload a selected file to c:\temp\uploader destination folder?

Thanks

app
error

How do I removeFile() from controller?

I've binded flow to the parent scope and have access to it inside my controller method.

In the view:

<div flow-init flow-name="uploader.flow" flow-file-added="fileAdded($file)">
...
</div>

In the controller:

$scope.fileAdded = function(file){
  if(file.size < 90000){

    //Custom logic
    showError('Image is too small!');

    //Tried all of these but no dice.
    file.cancel();
    $scope.uploader.flow.removeFile(0);
    $scope.uploader.flow.removeFile(file);
    $scope.uploader.flow.removeFile(file.file);
  }
}

What am I doing wrong here?

How and where save uploaded files

My files are uploaded, I log the event in console.
But I don't understand where and how to save them.

Here is my html code, upload is called.

<div flow-init flow-files-submitted="$flow.upload()">
  <div class="drop" flow-drop ng-class="dropClass">
    <span class="btn btn-default" flow-btn>Upload File</span>
    <span class="btn btn-default" flow-btn flow-directory ng-show="$flow.supportDirectory">Upload Folder</span>
    <b>OR</b>
    Drag And Drop your file here
  </div>

Here is my config

app.config(['flowFactoryProvider', function (flowFactoryProvider) {
  flowFactoryProvider.defaults = {
    target: 'upload.php',
    permanentErrors: [404, 500, 501],
    maxChunkRetries: 1,
    chunkRetryInterval: 5000,
    simultaneousUploads: 4,
    singleFile: true
  };
  flowFactoryProvider.on('catchAll', function (event) {
    console.log('catchAll', arguments);
  });
  // Can be used with different implementations of Flow.js
  // flowFactoryProvider.factory = fustyFlowFactory;
}]);

upload.php is called, and $_GET is full with data,

<script>alert('alert' + array(8) {
  ["flowChunkNumber"]=>
  string(1) "1"
  ["flowChunkSize"]=>
  string(7) "1048576"
  ["flowCurrentChunkSize"]=>
  string(6) "807855"
  ["flowTotalSize"]=>
  string(6) "807855"
  ["flowIdentifier"]=>
  string(11) "807855-3png"
  ["flowFilename"]=>
  string(5) "3.png"
  ["flowRelativePath"]=>
  string(5) "3.png"
  ["flowTotalChunks"]=>
  string(1) "1"
}
)</script>

but when I'm here what I have to do to save my files?
I tried to do move_uploaded_file() on flowFilename and flowRelativePath but nothing append.

Thank you.

Cant Select files to upload

Hi,

If I click Select files in Basic example there is no dialog opening to choose the files.
So for some reason directive flow-btn doesnt work inside a-tag. Only works with input.
Could you have a look what the problem is please?

Thanks.

filesSubmitted and filesAdded event with empty file array

When submitted the same image second time file array is empty.

$scope.$on('flow::filesSubmitted', function (flowEvent, flowObj, files, event) {
    event.preventDefault();//prevent file from uploading
    console.log(files);
});

On first time files array have files objects on second time is empty.

Set testChunks to false by default?

I don't know if it's only me but it took me some times to find out about the testChunks option and set it to false in order to avoid GET request.

2.0.0 build zip includes 1.0.0-beta3 code

TL;DR Did zip files get mixed up during the release process?

I just downloaded the 2.0.0 build zip from the Releases page, but the zip file includes builds of the 1.0.0-beta3 code. At the top of the 2.0.0 minified file is:

/*! ng-flow 1.0.0-beta3 */

It doesn't seem to be just a comment issue, either — the module usage still needs to be prefixed with ng, which appears to have been removed (yay!) with 2.0.0. When I clone the repo myself, do npm install, then grunt build, I get a proper 2.0.0 build.

Event complete is not fired

Hi!
I'm trying to execute something when upload is completed but nothing happens.
HTML:

<div ng-show="isEditingPolitician()" flow-init="flowConfig" flow-name="politician.flow">
</div>

Controller:

$scope.flowConfig = {
  target: '/politico/upload',
  singleFile: true,
  query: function(flowFile, flowChunk) {
    return {politician_id: $scope.politician.id};
  }
};
$scope.$on('flow::complete', function (event, $flow, flowFile) {
  $scope.politician = angular.copy($scope.editedPolitician);
  $scope.cancelPoliticianEdition();
});

When i click in the button

<button ng-click="savePoliticianEdition()" type="button" class="btn btn-primary">

The function savePoliticianEdition is called, the upload is done but the event is not fired.

$scope.savePoliticianEdition = function() {
  politicianService.updatePolitician($scope.editedPolitician).then(function(response) {
    $scope.politician.flow.upload();
  });
};

What i'm doing wrong ?
Thank you in advance for this awesome module!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.