Calling angular controller method from kendo template?

2 posts, 0 answers
  1. Xavier
    Xavier avatar
    29 posts
    Member since:
    Jun 2014

    Posted 05 Sep 2014 Link to this post

    How to call an angular controller method from kendo template? Controller is defined as data-ng-controller="feedbacksSurveyReportCtrl as vm" and the call to vm.couponStatusAsString fails with vm as undefined.

    <script type="text/x-kendo-template" id="responder-template">
        <table class="table table-striped">
                    <th>Redeemed Date</th>
                    <th>Coupon Status</th>
                # for (var i = 0; i < coupons.length; i++) { #
                    <td>#= coupons[i].name #</td>
                        #= kendo.toString(new Date(coupons[i].redeemedDate), "g") #
                        #= vm.couponStatusAsString(coupons[i].status) #
                # } #
  2. Petyo
    Petyo avatar
    2444 posts

    Posted 09 Sep 2014 Link to this post

    Hi Xavier,

    I am afraid that this scenario is not supported - the kendo templates are not aware of the angular controller context. You should use the angular template syntax for that purpose. 

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top