Access to access $scope variable from k-success event

2 posts, 0 answers
  1. Linh
    Linh avatar
    1 posts
    Member since:
    Feb 2017

    Posted 26 Feb 2017 Link to this post

    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.

  2. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1201 posts

    Posted 28 Feb 2017 Link to this post

    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.
Back to Top