Editor content does not update from Angular %scope change

4 posts, 0 answers
  1. Terry Harrison
    Terry Harrison avatar
    4 posts
    Member since:
    Oct 2004

    Posted 10 Apr 2015 Link to this post

    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?
  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 14 Apr 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Terry Harrison
    Terry Harrison avatar
    4 posts
    Member since:
    Oct 2004

    Posted 14 Apr 2015 in reply to Petyo Link to this post

    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

  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 16 Apr 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready