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

AngularJS controller TELERIK UI not available on init function

1 Answer 41 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Maurizio
Top achievements
Rank 1
Iron
Maurizio asked on 10 Oct 2019, 11:07 AM

The controller:

app.controller('TestController',
    ['$scope',
         
        function ($scope) {
        $scope.OnButtonClick = function () {
            $scope.grid.dataSource.fetch();
        };
            (function () {  // init
            // $scope.grid is NULL
            $scope.grid.dataSource.fetch();
            // grid is NULL
            let grid = $('#gridID').data('kendoGrid');
        })();
        }
    ]);

 

The problem: after load all the controller the INIT function is triggerd but all Telerik UI controller are NULL in this function. 

All other function run well and the Telerik UI object are available.

It's possible to have a INIT controller function with all Telerik UI component available for data loading and configuration?

 

Thanks

1 Answer, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 14 Oct 2019, 07:43 AM

Hello, Maurizio,

Thank you very much for the provided snippets.

To utilize the Kendo UI directives, they need to be made available in the module:

 angular.module("myApp", [ "kendo.directives" ])
        .controller("TestController", function($scope){

https://docs.telerik.com/kendo-ui/framework/AngularJS/introduction#basic-usage-of-the-kendo-ui-angularjs-directives

In case you face any difficulties, can you share a small runnable example that we can examine locally.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Maurizio
Top achievements
Rank 1
Iron
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or