angularjs - Dynamic Tabs for ng-class -


I'm trying to change the active status of the dynamically created tab, depending on which value Selected, it will determine which view I will see and change the $ location. I can not get the status of the dynamically-generated tab to change this code I need some guidance on what I am doing wrong thanks to my code snippet

HTML

  & lt; Ul id = "tabBarList" & gt; & Lt; Li ng-class = "{active: isActive ('/ list')}" ng-model = "all" & gt; & Lt; A href = "# / list" id = "newRequest" & gt; All requests & lt; / A & gt; & Lt; / Li & gt; & Lt; Li ng-class = "{active: isActive ()}" ng-click = "getDetails (tabs.name, post.status)" ng-repeat = "tab in tab" "gt; & lt; a href =" " Id = "idNumber" & gt; # {{tabs.name}} & lt; / a & gt; & lt; a href = "id =" exitTab "ng-click =" Selection tab (tab name) " & Lt; / li & gt; & lt; / ul & gt; & lt; tr ng-repeat = "Post in posts" & gt; & lt; td id = "TicketId"> an id = "listlink" href = "" ng-click = "addTab (post.ticketId, post.status)" & gt; {{post.ticketId}} & lt; / A & gt; & lt; / TD & gt; & lt; / tr & gt;  

Controller

  $ scope.isActive = function (path ) {If ($ location.path () == path) {return true} else {description is false}};  
< P> Work to get place for created tabs

$ scope.getResults = function (status) {

  if (position == "off") {var Path = "/ list / off"; $ Location.path (path); $ Scope.getActive ($ location.path ());} if (position == "active") {}}  

$ scope.tabList = []; $ Scope.addTab = function (ticketId) {

  $ scope.tabList.push ({'name': ticketId}); };  

please check it

and make changes like

& lt; Ul id = "tabBarList" & gt; & Lt; Li ng-class = "{active: isActive ('list')}" ng-model = "all" & gt; & Lt; A href = "# / list" ID = "new request" & gt; All requests & lt; / A & gt; & Lt; / Li & gt; & Lt; "Ng-repeat =" tab "" tab in the tab "" = "# / {{Tabs.name}}" id = "idNumber" & gt; # {{tabs.name}} & lt; / a & gt; & lt; a href = "" id = "exitTab" ng - Click = "selectTab (tab name)" & gt; x & lt; / a & gt; & lt; / li & gt; & lt; / ul & gt;

$ scope.isActive = function (path) {if ($ location.path () == '/' + path) {back true;} other {return false;}};


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -