javascript - Dynamically load tabs corresponding to particular Node into View onclick of a node AngularJS -


i have ten nodes coded using drag , drop , after drop, on click of node want display tabs corresponding node dynamically, tabs not required nodes. displaying tabs controller common nodes.. want disply tabs corresponding each node. in advance..

<div id="tabs" ng-controller="tabsctrl" ng-hide="!isvisible"> <ul class="nav nav-tabs"> <li ng-repeat="tab in tabs"  ng-class="{active:isactivetab(tab.url)}"  ng-click="onclicktab(tab)"><a>{{tab.title}}</a></li> </ul> <div id="mainview"> <div ng-include="currenttab"></div> </div> </div> 

my controller tabs is:

app.controller('tabsctrl', ['$scope', function ($scope) { $scope.tabs = [ {title: 'item',url: 'item.html'}, {title: 'bom',url: 'two.tpl.html'}, {title: 'sourcing rule',url:'three.tpl.html'}, {title: 'item attributes',url: 'one.tpl.html'}, {title: 'categories',url: 'one.tpl.html'}, {title: 'cross refrences',url: 'one.tpl.html'}, {title: 'effective categories',url:'one.tpl.html'}, {title: 'din',url: 'one.tpl.html'}, {title: 'coustomer limit',url: 'one.tpl.html'}, {title: 'cicr',url:'one.tpl.html'},  {title: 'co-products',url:'one.tpl.html'}, {title: 'org assign',url: 'one.tpl.html'}];  $scope.currenttab = 'one.tpl.html'; $scope.onclicktab = function (tab) {   $scope.currenttab = tab.url; } $scope.isactivetab = function(taburl) {   return taburl == $scope.currenttab; } }]); 


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -