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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Load partial view using treeview

Thread ID:





119282 Jun 1,2015 12:00 PM UTC Jun 3,2015 03:40 AM UTC JavaScript 1
Tags: ejTreeView
Asked On June 1, 2015 12:00 PM UTC

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 3, 2015 03:40 AM UTC

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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon