This is a migrated thread and some comments may be shown as answers.

Access to access $scope variable from k-success event

1 Answer 60 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Linh
Top achievements
Rank 1
Linh asked on 27 Feb 2017, 02:26 AM

Hi,

I am using upload control as below: 

 <input type="file"
                                       kendo-upload
                                       k-async="{ saveUrl: "/api/upload/",autoUpload: true }"
                                       k-success="onImportSuccess" />

On onImportSuccess function, I need to access to $scope for doing something after uploaded. How can I do that?

  onImportSuccess = function(e) { 
            console.log($scope); // --> show scope is undefined 
        }

Thanks.

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 28 Feb 2017, 12:56 PM
Hello Linh,

Here you will find a Dojo sample, implementing the discussed scenario. You will notice that the $scope object is available in the success event handler (logged on the console).

Regards,
Veselin Tsvetanov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Upload
Asked by
Linh
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or