Wijmo Tab Panels

Posted by: jason.brandt on 14 December 2018, 6:50 am EST

    • Post Options:
    • Link

    Posted 14 December 2018, 6:50 am EST

    How can a child component get the ID or Index of the tab it is within?

    Example =

    <wj-tab-panel #tabPanel [selectedIndex]="selTabindex">		
    		<wj-tab *ngFor="let tab of tablist">
    			<a>{{tab}}</a>
    			<div>
    				<app-entitymanagement-details></app-entitymanagement-details>
    			</div>
    		</wj-tab>
    	</wj-tab-panel>
    

    How does Component app-entitymanagement-details know if it is in Tab 2 or Tab 7?

  • Posted 16 December 2018, 4:21 pm EST

    Hi,

    You may create additional input properties on to pass info about the tab in which it is hosted.

    Please refer to the following code snippet and sample:

    <wj-tab *ngFor="let tab of tabList; index as i">
    		<a>{{tab}}</a>
    		<div>
    			<app-entitymanagement-details[tabHeader]="tab" [tabIndex]="i"></app-entitymanagement-details>
    		</div>
    	</wj-tab>
    

    https://stackblitz.com/edit/angular-vsny7f?file=src%2Fapp%2Fapp.component.html

    ~Sharad

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels