I'm doing AngularJS research for a Proof of Concept presentation in a few weeks to show the benefits of AngularJS.
Edit Here's my plunk as I work through this challenge
The company I work for has a fantastic Theme site that answers a lot of our UI design questions. Everything from the header to the footer and all the form elements, tabs, buttons, etc...is answered for us.
What I've been doing is "Angularizing" the theme with directives. So, instead of the developer copying and pasting 10 lines for the company header, I've put the company header in a directive so now the developer can just include a one line element such as <companyHeader />.
Now I'd like to do the same thing for our jQuery tabs. We have different types of tabs for different reasons. Instead of having the developer worry about that, I'd like to simply put those tabs in directives.
So, instead of this:
<div id="example-subTabs">
<nav class="module-sub-nav">
<section class="subNavigation clearfix">
<ul>
<li><a href="#sub-1">Subtab 01</a></li>
<li><a href="#sub-2">Subtab 02</a></li>
</ul>
</section>
</nav>
<div class="app-wrapper" style="border-top: 0;">
<div id="sub-1">
<div class="content">
<p>Subtab Content 01</p>
</div>
</div>
<div id="sub-2">
<div class="content">
<p>Subtab Content 02</p>
</div>
</div>
</div><!-- // end content -->
</div><!-- // end subTabs -->
$("#example-subTabs").tabs();
I'd like for the developer to simply do this:
<company-sub-tabs>
<tab title='Subtab 01'>
Subtab Content 01
</tab>
<tab title='Subtab 02'>
Subtab Content 02
</tab>
</company-sub-tabs>
And the AngularJS would handle the theme and the jQueryUI tabs() initialization
Is that a reasonable expectation of Angular?
If so, would I capture the contents of <company-sub-tabs> and loop through each <tab> and put the contents in a new "app-wrapper" element that I would create in my "companySubTabs" directive??
Thanks, Duane