We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Load partial view using treeview

Thread ID:





119282 Jun 1,2015 08:00 AM Jun 2,2015 11:40 PM JavaScript 1
Tags: ejTreeView
Asked On June 1, 2015 08:00 AM

I have to to following functionality using angularjs

controller code...

<div ng-controller="SidebarController">
    <a id="treeView" ej-treeview e-fields-datasource="dataList" e-fields-id="id" e-fields-parentid="pid" e-fields-text="name" e-datasource="localdata" e-fields-haschild="hasChild" e-fields-expanded="expanded" e-fields-imageurl="imageUrl" e-nodeselect="selected" />
    <div   ng-include="viewurl"/>


i want t oload partial view at ng-include

view code....

var UrlData = [{ id: 2, pid: 1, url: '../view/fictionbooks/FictionBook1.html' },
               { id: 3, pid: 1, url: "../view/fictionbooks/FictionBook2.html" },

    $scope.dataList = ListViewData;

  $scope.selected = function (args) {

        for (var i = 0; i < UrlData.length; i += 1) {
            var jsonobject = UrlData[i];
            if (jsonobject.id == args.id) {
                $scope.viewurl = jsonobject.url;
                //$scope.show = true;
                CommonService.Url = UrlData.url;


Sasikala Nagarajan [Syncfusion]
Replied On June 2, 2015 11:40 PM

Hi Gomtesh,

Thanks for using Sycnfusion products,

We have analyzed your requirement and prepared the sample based on your requirement. Please get the sample from below location


To set the scope variable as src to ng-inlcude, please refer the below code snippet


<ng-include src="viewPage"></ng-include>

To bind the updated scope variable value, we have to call $scope.$apply() method for binding. Please refer the below code snippet

Angular controller:

$scope.loadpage = function (args) {

for (var i = 0; i < UrlData.length; i += 1) {

var jsonobject = UrlData[i];

if (jsonobject.id == args.id) {

$scope.viewPage = jsonobject.url;





Please check with the given sample and let us know if you have further queries,


Sasikala Nagarajan


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.