Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

Tabs - Dynamically created tabs do not respond to "select" or execute it immediately on creation #1496

Closed
@epitka

Description

@epitka

If one creates a dynamic tab like this

 $scope.tabs = [{ title: "Profile", content: "app/insured/profile/inProfile.html",  select: activateTab(), name: "profile" }, { title: "Coverage", content: "app/insured/profile/inCoverage.html", select: activateTab(), name: "coverage" }]

then function specified for "select" will execute right away while tabs are being constructed. I tried also using just "activateTab" without parenthesis and that does not do anything. You can try it also just using a plunker supplied with tabs example and try to put select for dynamic tab 1

{ title:"Dynamic Title 1", content:"Dynamic content 1", select:onSelect() },
 function onSelect(){
    console.log("onSelectCalled");
    alert("onSelectCalled");
  }

and you will see the issue. Also setting the "active" attribute to true from javascript code does not do anything either. My markup for the tabs is like this

  <tabset >
            <tab data-ng-repeat="tab in tabs" heading="{{tab.title}}" active="{{tab.active}}"  class="fullwidthtabs">
               <div ng-include="tab.content"></div>
            </tab>        
        </tabset>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions