Steve Steve - 1 year ago 194
Javascript Question

Disabling a static tab with Angular UI Bootstrap?

I am trying to set a tab to be disabled in a Angular Ui-bootstrap 2.0 tabset.

In the example on their site, the one they are enabling and disabling (with a button) is a dynamic tab (an ng-repeat). I tried that, it works.

I am trying to disable a Tab in a set that's not created with an ng-repeat, and it does not seem to work. I have hard-coded the disabled property. I tried using a simple "true" and a controller property. The tab remains selectable.

<uib-tabset active="active">
<uib-tab index="0" heading="Static title">
Lorem ipsum dolor sit amet
<uib-tab index="1" heading="Another static title">
Consectetur adipisicing elit.
<uib-tab index="2" heading="Still another static title" disabled="amDisabled">

$scope = amDisabled = true

Here is a plunker.

Answer Source

You need to use the disable attribute not disabled

Here is the same plunker with the disable attribute

It's an easy mistake to make!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download