try uploader.onSuccessItem(){alert('test')}, you don't need the function 
key word with typescript

On Sunday, January 24, 2016 at 3:59:39 AM UTC-5, Christoph wrote:
>
> Hi there,
>
> I'm new to Angular, and starting with Angular2 with Typescript, so it 
> might be a newbie question.
>
> I looked at http://valor-software.github.io/ng2-file-upload/ and wanted 
> to do something with the response once a file is uploaded successfully.
> Based on: 
> https://github.com/valor-software/ng2-file-upload/blob/master/components/file-upload/file-uploader.ts
> it seems it uses the same callbacks as 
> https://github.com/nervgh/angular-file-upload/wiki/Module-API
>
> So I tried modifying the examples simple-demo.ts to create an alert:
>
> @Component({
>   selector: 'simple-demo',
>   template: template,
>   directives: [FILE_UPLOAD_DIRECTIVES, NgClass, NgStyle, CORE_DIRECTIVES, 
> FORM_DIRECTIVES]
> })
> export class SimpleDemo {
>   private uploader:FileUploader = new FileUploader({url: URL});
>   private hasBaseDropZoneOver:boolean = false;
>   private hasAnotherDropZoneOver:boolean = false;
>
> *  uploader.onSuccessItem = function () {*
> *    alert('test');*
> *  } *
>
>   private fileOverBase(e:any) {
>     this.hasBaseDropZoneOver = e;
>   }
>
>   private fileOverAnother(e:any) {
>     this.hasAnotherDropZoneOver = e;
>   }
> }
>
> which doesn't seem to work - can anyone give me a little push in the right 
> direction please?
>
> Thanks a lot,
> Christoph
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to