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

controller/scope reference inside upload event

2 Answers 74 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 16 Feb 2016, 05:57 PM

I'm using TypeScript and the this object inside the upload event is the instance of the kendoupload, not the angular controller.

To get at a value on the controller, I'm currently using this.$angular_scope.vm.datavariable but is this the best way to access controller variables within the upload event?

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimiter Madjarov
Telerik team
answered on 18 Feb 2016, 03:31 PM

Hello Shawn,

You are correct. This is the approach to access a controller variable in the event handler. Are you experiencing any issues with it?

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Shawn
Top achievements
Rank 1
answered on 18 Feb 2016, 04:43 PM
It works.  Only minor issue is that Visual Studio flags $angular_scope as unknown because it is thinking this is the class.  I just created a dummy declaration $angular_scope: any; on the class to clear the warning.
Tags
Upload
Asked by
Shawn
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Shawn
Top achievements
Rank 1
Share this question
or