Defining the Tabs Template
Next, you need to define a template to act as the container for the pane elements to support multiple panes in the tabbed view. The tabs container needs to support defining multiple pane elements. Listing 29.5 shows the tabs template code.
You assign a tabs class to an element for styling. To implement multiple panes, you define a <span> element that implements the ng-repeat directive on a panes array defined in the custom directive code. Notice that the ng-click directive calls select(pane) to select the pane and make it visible.
Also, you use the ng-class directive to add the activeTab class if pane.selected is true. Line 8 defines the <div> element, where the pane content is transcluded.
Listing 29.5 rich_tabs.html ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access