Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Getting multiple views on the dom. #6711

Closed
emgould opened this issue Mar 17, 2014 · 23 comments
Closed

Getting multiple views on the dom. #6711

emgould opened this issue Mar 17, 2014 · 23 comments

Comments

@emgould
Copy link

emgould commented Mar 17, 2014

Post upgrading to 1.2.14 I am getting multiple views on the dom when I did not previously and it is unexpected. Worked fine previously. My .config looks like the following:

myApp.gwWebApp
    .config(['$routeProvider','$locationProvider', function($routeProvider, $locationProvider) {
        $routeProvider
          .when('/login', {
            controller: 'LoginController',
            templateUrl: '/app/views/login.html'
          })
          .when('/profiles', {
            controller: 'ProfileController',
            templateUrl: '/app/views/profile.html'
          })
          .when('/group/view/:id', {
            controller: 'GroupController',
            templateUrl: '/app/views/group.html'
          })
          .when('/calendar', {
            controller: 'CalendarController',
            templateUrl: '/app/views/calendar.html'
          })
          .when('/invite/:id', {
            controller: 'InviteController',
            templateUrl: '/app/views/invite.html'
          })
          .when('/notifications', {
            controller: 'NotificationsController',
            templateUrl: '/app/views/notifications.html'
          })
          .otherwise({
            redirectTo: '/main'
          });
    /* $locationProvider.html5Mode(true); */
}]);

One of many route command might be like this href tag:

<td ng-show='nav.unRespondedCount > 0'><a href="#calendar" class="fa fa-calendar pink" data-bubble={{nav.unRespondedCount}} >

If I inspect the dom i see the both the current and past view with the angular animate classes now added:

<div ng-view class="center-area center-canvas ng-scope ng-animate ng-leave ng-leave-active" style=""><!--div collapse="!showAlert">

<div ng-view class="center-area center-canvas ng-scope ng-animate ng-enter ng-enter-active" style=""><!--div collapse="!showAlert">

Very strange...

After some experimentation, I am seeing different behaviors depending upon how the location.path is updated or how the href is specified. I have experimented with href set to: "#/[route]' or location.path('/[route]').

@caitp
Copy link
Contributor

caitp commented Mar 17, 2014

Hi, can you please post a reproduction?

@tbosch tbosch assigned tbosch and unassigned tbosch Mar 17, 2014
@IgorMinar IgorMinar self-assigned this Mar 17, 2014
@IgorMinar
Copy link
Contributor

this might be related to some animation changes we made, but we do need a better example in order to reproduce the problem.

@matsko do you by chance know what's going on?

@IgorMinar IgorMinar added this to the Purgatory milestone Mar 17, 2014
@IgorMinar IgorMinar removed their assignment Mar 17, 2014
@matsko
Copy link
Contributor

matsko commented Mar 18, 2014

@emgould what does your CSS code look like? Is there any change in your CSS code between 1.2.13 and 1.2.14? This commit may be causing an issue: e988199

@matsko matsko self-assigned this Mar 18, 2014
@emgould
Copy link
Author

emgould commented Mar 18, 2014

I went straight from 1.2.8 to 1.2.14. I am troubled at how to show more info. My app is roughly 5K lines of code. All I can tell you is that I downgraded back to 1.2.8 and no issues. However as you can imaging it makes it unusable.

When you ask for a repro are you talking about jsfiddle/plunker?? I am sure if I grossly simplify my app that it won't happen. All I can tell you is that I have been coding with Angular for about 1year. So I am not new to constructs. My CSS is rather involved. Compiled down from less. I will look at the CSS issue that you reference. To see if it is relevant.

@caitp
Copy link
Contributor

caitp commented Mar 18, 2014

I don't think the css should be involved in getting duplicate DOM nodes.. ngView uses element transclusion, it's possible/likely that $animate.enter() is getting called twice, or the underlying DOM manipulation is happening twice, without removing the old. It's hard to be sure though, so trying to reproduce would help.

I guess it's possible specific css properties are involved, but start with a simple repro first before worrying about that, it should take like 5 minutes

@IgorMinar
Copy link
Contributor

the css could be causing animations to misfire, which could cause duplicate
views. we need more info.

On Tue Mar 18 2014 at 6:42:56 AM, Caitlin Potter [email protected]
wrote:

I don't think the css should be involved in getting duplicate DOM nodes..
ngView uses element transclusion, it's possible/likely that
$animate.enter() is getting called twice, or the underlying DOM
manipulation is happening twice, without removing the old. It's hard to be
sure though, so trying to reproduce would help.

I guess it's possible specific css properties are involved, but start with
a simple repro first before worrying about that, it should take like 5
minutes

Reply to this email directly or view it on GitHubhttps://github.com//issues/6711#issuecomment-37933287
.

@matsko
Copy link
Contributor

matsko commented Mar 18, 2014

@caitp and @IgorMinar it isn't the CSS that is getting involved directly. It's just that $animate has no idea that it has ended. What is likely going on is that the CSS transition code is never getting triggered (maybe a missing active class or no styles are changing). This should, however, always close with the fallback timer. Or a JS animation never calls the done function.

We need more info.

@emgould
Copy link
Author

emgould commented Mar 18, 2014

Tell me how to provide more info. I can't turn over my entire code
base. So help me help you.

Best,
Eric

Eric Gould
[email protected]
(201)632-1099

On 3/18/2014 4:44 PM, Matias Niemelä wrote:

@caitp https://github.com/caitp and @IgorMinar
https://github.com/IgorMinar it isn't the CSS that is getting
involved directly. It's just |$animate| has no idea that it has ended.
What is likely going on is that the CSS transition code is never
getting triggered (maybe a missing active class or no styles are
changing). This should, however, always close with the fallback timer.

We need more info.


Reply to this email directly or view it on GitHub
#6711 (comment).

@matsko
Copy link
Contributor

matsko commented Mar 18, 2014

@emgould it would be best if we pair up on this together. Are you free sometime tomrrow? What timezone are you in and what is your availability? Please email me at the email that is on my github profile.

@emgould
Copy link
Author

emgould commented Mar 18, 2014

I am on the east coast. I could talk in my afternoon around between
noon and 2pm.

Best,
Eric

Eric Gould
[email protected]
(201)632-1099

On 3/18/2014 5:15 PM, Matias Niemelä wrote:

@emgould https://github.com/emgould it would be best if we pair up
on this together. Are you free sometime tomrrow? What timezone are you
in and what is your availability? Please email me at the email that is
on my github profile.


Reply to this email directly or view it on GitHub
#6711 (comment).

@matsko
Copy link
Contributor

matsko commented Mar 19, 2014

Thanks Eric for contacting me.

Another related issue popped up about animations and I think I will have a go at this today since the example is easy to understand: #6748.

Let me tackle that first and then, if it doesn't solve your issue, let's pair up. Sorry for the change in scheduling. We can save more time by doing it this way.

@matsko
Copy link
Contributor

matsko commented Mar 25, 2014

@emgould any news?

@emgould
Copy link
Author

emgould commented Mar 26, 2014

Matias,
Unfortunately I am traveling this week so I won't be able to test until
next week.

Best,
Eric

[email protected]
(201)632-1099
On Mar 25, 2014 11:44 AM, "Matias Niemelä" [email protected] wrote:

@emgould https://github.com/emgould any news?

Reply to this email directly or view it on GitHubhttps://github.com//issues/6711#issuecomment-38580345
.

@matsko
Copy link
Contributor

matsko commented Apr 3, 2014

@emgould any change you have some time to check this out?

@emgould
Copy link
Author

emgould commented Apr 3, 2014

I can focus on this tomorrow. What would you like me to do?

Best,
Eric

Eric Gould
[email protected]
(201)632-1099

On 4/3/2014 12:15 AM, Matias Niemelä wrote:

@emgould https://github.com/emgould any change you have some time to
check this out?


Reply to this email directly or view it on GitHub
#6711 (comment).

@matsko
Copy link
Contributor

matsko commented Apr 3, 2014

Please test out your former code using the angular.js files from http://code.angularjs.org/snapshot/

@emgould
Copy link
Author

emgould commented Apr 4, 2014

Ok. Will let you know.

Best,
Eric

Eric Gould
[email protected]
(201)632-1099

On 4/3/2014 4:50 PM, Matias Niemelä wrote:

Please test out your former code using the angular.js files from
http://code.angularjs.org/snapshot/


Reply to this email directly or view it on GitHub
#6711 (comment).

@dmaj7no5th
Copy link

What was the status of the testing? I am running into this same behavior (in IE9 only). When route changes happen, and ngView attempts to clean out the prior view, IE9 throws an 'Access Denied' error. When I inspect the DOM, I see duplicate ng-view divs.

@matsko
Copy link
Contributor

matsko commented Jul 1, 2014

@emgould any progress? Can you please try testing using the snapshot version (which is 1.3) there have been a bunch of fixes done to ngAnimate.

@matsko
Copy link
Contributor

matsko commented Jul 14, 2014

@emgould I'm closing the issue for now. Please reply back here incase you're still experiencing the issue with the latest version of Angular. And please provide a plunkr link to the bug. Thanks.

@matsko matsko closed this as completed Jul 14, 2014
@DiegoMajluf
Copy link

matsko I think I can reproduce this issue and put it in this link http://plnkr.co/edit/wm3bcTvdxCdGcWJDXstS?p=preview

please let me know your comments

@DiegoMajluf
Copy link

the problem is that jquery puts the dialog DOM outside ngView div, so every time I navigate to the page with the dialog div it is added to the document again.

the solution is to relocate de dialog div inside the ngView div

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants