rpocklin / ui-router-tabs

Idiot-proof tab panes with route support using Angular.js + Bootstrap 3 + UI Router
Other
244 stars 57 forks source link

<ui-view> is added for INLINE_TEMPLATE which is not correct #74

Closed menocomp closed 8 years ago

menocomp commented 8 years ago

Starting from 1.8.0 (Added inline template by default (as requested) and allowed customer classes parameter.) there is an an issue with this: var INLINE_TEMPLATE = '<uib-tabset active="tabs.active" class="tab-container" type="{{type}}" vertical="{{vertical}}" justified="{{justified}}" class="{{class}}">' + '<uib-tab class="tab {{tab.class}}" ng-repeat="tab in tabs" ' + 'disable="tab.disable" ng-click="go(tab)">' + '<ui-view></ui-view>' + '<uib-tab-heading ng-bind-html="tab.heading"></uib-tab-heading>' + '</uib-tab>' + '</uib-tabset>' + '</div>';

First it is not valid HTML, you forgot to add <div> in the start. but the big issue here is that you are adding <ui-view> which is not correct here since it is inline template and the <ui-view> tag should be added in the page by the developer. I had to downgrade to 1.7.0 to fix this issue.

rpocklin commented 8 years ago

Yes, you're right a div was missing, thanks. The reason for the change was that people didn't want to add their own <ui-view> themselves or found it confusing, so what you say is not the case. If you are using the new default inline template, remove your own <ui-view> for the tab.

I have released v2.0.1 to fix the <div> issue. v1.8.0 did not have this issue so no fix is required.

menocomp commented 8 years ago

Thanks for your fast response. Why should I remove my <ui-view> in case of inline tabs? the idea is that I might need to display the contents of any tab inside <ui-view> the way I want so that I am adding <ui-view> and add some HTML markup as below: `

    <div class="col-md-10">
        <div class="col-md-offset-1 col-md-11">
            <ui-view></ui-view>
        </div>
    </div>
</div>`
rpocklin commented 8 years ago

Yes I understand. You can easily use the previous default template by using template-url="ui-router-tabs-custom-ui-view-template.html" which is precompiled and cached.

Basically i was getting overwhelming issues from people asking to make the opposite the default. So now it is.