Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

Scope changes not reflected outside <tabset> #1553

@jrupac

Description

@jrupac

Changes made to variables that are part of an enclosing controller's scope are not reflected outside of the <tabset> within which those changes are made. The changes are also not visible programmatically (e.g., $scope.foo is not updated in the controller code).

Here is an example. In the code below, the {{text}} is not updated when changes are made to the <input> box within the <tabset>. It is reflected when changes are made to the <input> box outside the <tabset>:

<div ng-controller="TabsDemoCtrl">
  {{text}}
  <input ng-model="text">
  <tabset>
    <tab heading="Tab">
      <input ng-model="text">
    </tab>
  </tabset>
</div>

This functionality differs from the behavior of previous versions (I have tested it against 0.6.0, where {{text}} is always correctly updated). I have created examples below:

Working (0.6.0): http://plnkr.co/edit/2LJUcRyaRROjFVaCYhXu?p=preview
Not working (0.9.0): http://plnkr.co/edit/W8i8VqWwriGY7tXjPPBm?p=preview

This bug may have been introduced in c9acebb when the following line was removed:

tabsetCtrl.$scope = scope;

within the compile function of <tabset> (but this is just a guess and I'm not certain).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions