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
..
About.cshtml
AboutController.js
The Anglular controllers and attributes are working fine outside the PanelBar.
Thanks!
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!