Mantvydas Ozerenskis Mantvydas Ozerenskis - 1 year ago 142
AngularJS Question

Kendo uploader with angular doesn't update scope

Why Kendo Uploader with angular doesn't apply changes in UI?

Let's say on select event (same on success):

$scope.onSelect = function(e) {
var message = $.map(e.files, function(file) { return; }).join(", ");
kendoConsole.log("event :: select (" + message + ")");
$scope.uiUpdate = "doesn't work";

Dojo eg.:

If I run scope apply function then it works, but I don't like this solution.

Answer Source

Unfortunately, you will have to use $scope.$apply because the event is triggered without Angular knowing about it. This Kendo Upload component seems to be a jQuery thing that was made somewhat compatible with Angular.

The best thing you can do is to create a function that you can use all around:

function kendoEvent($scope, eventHandler) {
    return $scope.$apply(eventHandler);

$scope.onSelect = kendoEvent($scope, function (event) {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download