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

AngularJS attributes (ng-) and controllers are not working for dynamically loaded panelbar

1 Answer 139 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Remigijus
Top achievements
Rank 1
Remigijus asked on 03 Sep 2014, 03:09 PM
Hello,

I'm trying to setup a panelbar that uses anglularjs library in their dynamically loaded panels. Unfortunately I was not able to make my angularjs controllers and ng attributes working in the loaded panels. The code below:

Index.cshtml
..

@(Html.Kendo().PanelBar()
    .Name("panelbar")
    .ExpandMode(PanelBarExpandMode.Single)
    .Items(panelbar =>
    {
        panelbar.Add().Text("About")
            .LoadContentFrom("About", "Home"); // About - Action, Home - controller
 
        panelbar.Add().Text("Contact")
            .LoadContentFrom("Contact", "Home");
    })
)


About.cshtml
<script src="~/Scripts/Controllers/AboutController.js"></script>
<div ng-controller="AboutController">
    {{ "this one is not working..." }}
</div>

AboutController.js
(function () {
    var app = angular.module("testPanel");
    var AboutController = function() {
        console.log('not working as it supposed to work ');
    }
    app.controller("AboutController", AboutController);
}());

The Anglular controllers and attributes are working fine outside the PanelBar. 
Thanks!

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 05 Sep 2014, 08:05 AM
Hello Remigijus,

The server-side wrappers cannot be mixed with AngularJS. If you are writing an AngularJS client-side app, you need to use the Kendo UI widgets as directives, as documented in the Using Kendo UI and AngularJS help topic.

Regards,
Alex Gyoshev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
PanelBar
Asked by
Remigijus
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or