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

Editor content does not update from Angular %scope change

3 Answers 222 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Terry Harrison
Top achievements
Rank 1
Terry Harrison asked on 10 Apr 2015, 12:14 PM
I have the following code.
html
<textarea ng-bind-html="html" style="height:440px" kendo-editor k-options="editorOptions"></textarea>

JS
angular.module('SplashApp', ['ngRoute', 'kendo.directives', 'ngSanitize'])
    .controller("MainController", function ($scope, $location, $route, $http, $sce) {
        $scope.html = "<h1>Kendo Editor</h1>\n\n" +
          "<p>Note that 'change' is triggered when the editor loses focus.\n" +
              "<br /> That's when the Angular scope gets updated.</p>";
});

When the page renders it is fine. If the user updates the page it also makes the changes to $scope.html. BUT if I change the $scope.html from javascript the contents of the editor do not change. How do I get this to occur?

3 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 14 Apr 2015, 07:14 AM
Hello,

the textarea binding (and its value update) is not tracked by the editor widget. I may suggest that you use the ng-model / k-ng-model directives instead. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Terry Harrison
Top achievements
Rank 1
answered on 14 Apr 2015, 12:07 PM

Thanks this works fine. Can you tell me where using this is documented in the Telerik online data. I have hunted and found very little docs on angular.

Thanks,
Terry

0
Kiril Nikolov
Telerik team
answered on 16 Apr 2015, 09:01 AM

Hello Terry,

I have provided you with a link to the AngluarJS documentation in the other support ticket that you had opened. So I will go ahead and close this one, but in case something comes up - do not hesitate to contact us.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Editor
Asked by
Terry Harrison
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Terry Harrison
Top achievements
Rank 1
Kiril Nikolov
Telerik team
Share this question
or