I have a directive tree list view with checks box, (aleardy developed by another developer), i want to display it to the user when he clicks on button, so i used ng-if/ng-show/ng-hide/ng-class with hidden. they takes a lot of time to display the directive (tree list), (more then 20sec)
the directive use ng-if, ng-repeat, ng-show...
When i use: ng-if: 1- page loading is ok 2- display tree list after click button is slowly ng-hide/ng-show/ng-class with hidden: 1- page loading is noy ok (too slowly) 2- display tree list after click button is OK
any advices for this problem ?
the template of my directive is:
template: [
'<div>',
'<div>',
'<span ivh-treeview-toggle="node">',
'<span class="ivh-treeview-twistie">',
'<span class="ivh-treeview-twistie-expanded">',
ivhTreeviewOptions().twistieExpandedTpl,
'</span>',
'<span class="ivh-treeview-twistie-collapsed">',
ivhTreeviewOptions().twistieCollapsedTpl,
'</span>',
'<span class="ivh-treeview-twistie-leaf">',
ivhTreeviewOptions().twistieLeafTpl,
'</span>',
'</span>',
'</span>',
'<span ng-if="ctrl.useCheckboxes()"',
'ivh-treeview-checkbox="node">',
'</span>',
'<span class="ivh-treeview-node-infos" ng-class="{\'billable\': ctrl.billable(node), \'associatedToUser\': ctrl.associatedToUser(node), \'hasAncestorAssociatedToUser\': ctrl.hasAncestorAssociatedToUser(node), \'nonClickable\': !ctrl.clickable(node)}" ivh-treeview-click>',
'<span class="ivh-treeview-node-additionalInfo" ng-if="ctrl.showUserGroupUserCount()">',
'<span ng-if="ctrl.userCount(node)" title="{{\'USERGROUP_USER_COUNT\' | translate}}" class="cursorHelp"><i class="fa fa-users fa-spr"></i>{{ctrl.userCount(node)}}</span>',
'</span>',
'<span class="ivh-treeview-node-additionalInfo" ng-if="ctrl.showRoleUserCount()">',
'<span ng-if="ctrl.userCount(node)" title="{{\'ROLE_USER_COUNT\' | translate}}" class="cursorHelp"><i class="fa fa-users fa-spr"></i>{{ctrl.userCount(node)}}</span>',
'</span>',
'<span class="ivh-treeview-node-label">',
'<span title="{{\'ROLE_ASSOCIATED_TO_USER\' | translate}}" class="cursorHelp labelIcon" ng-if="ctrl.associatedToUser(node)"><i class="fa fa-tag fa-spr"></i></span>',
'<span title="{{\'USERGROUP_BILLABLE\' | translate}}" class="cursorHelp labelIcon" ng-if="ctrl.billable(node)"><i class="fa fa-credit-card fa-spr"></i></span>',
'<span ng-if="ctrl.translate()">{{ctrl.label(node) | translate}}</span>',
'<span ng-if="!ctrl.translate()">{{ctrl.label(node)}}</span>',
'</span>',
'<span class="ivh-treeview-node-description" ng-if="ctrl.showDescription()">',
'{{ctrl.description(node)}}',
'</span>',
'</span>',
'</div>',
'<ul ng-if="getChildren().length" class="ivh-treeview">',
'<li ng-repeat="child in getChildren()"',
'ng-hide="ctrl.hasFilter() && !ctrl.isVisible(child)"',
'ng-class="{\'ivh-treeview-node-collapsed\': !ctrl.isExpanded(child) && !ctrl.isLeaf(child)}"',
'ivh-treeview-node="child"',
'ivh-treeview-depth="childDepth">',
'</li>',
'</ul>',
'</div>'
].join('\n')
};
}])