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

Reopen the popover, it's scope has changed #1191

Closed
someok opened this issue Oct 21, 2013 · 1 comment
Closed

Reopen the popover, it's scope has changed #1191

someok opened this issue Oct 21, 2013 · 1 comment

Comments

@someok
Copy link

someok commented Oct 21, 2013

First Time: click the button, open the popover, the scope is right:
snapshot-20131021183428

2nd Time: reopen the popover, the scope become the page's scope:
snapshot-20131021183518

The snapshots is snap at http://angular-ui.github.io/bootstrap/#/popover

I test it at local browse:

function showTooltipBind() {
       // add a log
    console.log('show: ', tooltip.scope())

    if (scope.tt_popupDelay) {
        popupTimeout = $timeout(show, scope.tt_popupDelay);
    } else {
        scope.$apply(show);
    }
}

The output is:
snapshot-20131021185917

@chrisirhc
Copy link
Contributor

Did a quick look at this. Looks like it's because doing .remove() in jqLite/jQurey removes the data of the element (see https://github.com/angular/angular.js/blob/master/src/jqLite.js#L782-L786). The scope is stored in the data element so it's no longer bound to the scope after the first removal.

tooltip should be doing .detach but this isn't available in jqLite.

Just a quick look, haven't thought about any way to resolve this.

chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this issue Dec 24, 2013
Isolate scope contents should be the same after hiding and showing the
tooltip. The isolate scope's parent should also always be set to the
directive's scope correctly.

Reproduces angular-ui#1191
chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this issue Dec 24, 2013
Isolate scope contents should be the same after hiding and showing the
tooltip. The isolate scope's parent should also always be set to the
directive's scope correctly.

Reproduces angular-ui#1191
chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this issue Dec 24, 2013
- Calling $digest is enough as we only need to digest the watchers in
  this scope and its children. No need to call $apply.

- No need to test for cached reference when tooltip isn't visible as
  the tooltip has no scope.

Fixes angular-ui#1450 and angular-ui#1191
chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this issue Dec 28, 2013
Isolate scope contents should be the same after hiding and showing the
tooltip. The isolate scope's parent should also always be set to the
directive's scope correctly.

Reproduces angular-ui#1191
chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this issue Dec 28, 2013
- Calling $digest is enough as we only need to digest the watchers in
  this scope and its children. No need to call $apply.

- Set invokeApply to false on $timeout for popUpDelay

- No need to test for cached reference when tooltip isn't visible as
  the tooltip has no scope.

Fixes angular-ui#1450 and angular-ui#1191
chrisirhc added a commit that referenced this issue Dec 29, 2013
Isolate scope contents should be the same after hiding and showing the
tooltip. The isolate scope's parent should also always be set to the
directive's scope correctly.

Reproduces #1191
chrisirhc added a commit that referenced this issue Dec 29, 2013
- Calling $digest is enough as we only need to digest the watchers in
  this scope and its children. No need to call $apply.

- Set invokeApply to false on $timeout for popUpDelay

- No need to test for cached reference when tooltip isn't visible as
  the tooltip has no scope.

Fixes #1450 and #1191
chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this issue Dec 30, 2013
Isolate scope contents should be the same after hiding and showing the
tooltip. The isolate scope's parent should also always be set to the
directive's scope correctly.

Reproduces angular-ui#1191
chrisirhc added a commit to chrisirhc/angular-ui-bootstrap that referenced this issue Dec 30, 2013
- Calling $digest is enough as we only need to digest the watchers in
  this scope and its children. No need to call $apply.

- Set invokeApply to false on $timeout for popUpDelay

- No need to test for cached reference when tooltip isn't visible as
  the tooltip has no scope.

Fixes angular-ui#1450 and angular-ui#1191
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants