AngularJS ngRoute conflicts with CSS Animation



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















link to: actual problem



ngRoute updates the url. When clicking the main menu on top of the page, the layout jumps to the new state without the transition effect because of this url update. However when I open an activity from the menu on the left the google maps initialization is included and everything seems to work fine. (Mac Chrome only tested for now).



Inside $routeProvider no difference between both routes:




.when('/c/:id', 
controller: 'ContentController',
templateUrl: 'js/views/content.html',
resolve:
redirect: function ($route) $route.current.params.redirect = 'c';

)
.when('/a/:id',
controller: 'SearchController',
templateUrl: 'js/views/activity.html',
resolve:
redirect: function ($route) $route.current.params.redirect = 'a';

)





Inside ContentController (which doesn't work well):






app.controller('ContentController', function($scope, $route, $routeParams, content) 
let redirect = $routeParams.redirect;

content.success(function(data)
$scope.content = data;
if (redirect==='c' && $routeParams.id)
$scope.content_detail = data[$routeParams.id];

);
);





Inside SearchController (which works because of the google maps initialization):






app.controller('SearchController', function($scope, $route, $routeParams, $filter, APIsearch) 
let redirect = $routeParams.redirect;

//load results
APIsearch.success(function(data)
$scope.results = data;

if (redirect==='a' && $routeParams.id)
$scope.result_detail = $filter('getSelected')(data, $routeParams.id);

initialize($scope.result_detail.polyline);
;
);
);





What does google.maps do which makes this work?!










share|improve this question






















  • It is not only google maps and activity, if you click on any of main sections, De Clup, routes... and close them transitions come back. The problem lies in your HTML directives or css not in JS, as I'm seeing you're not using animations in any of the controllers, you need to share those.

    – Babak
    Nov 15 '18 at 14:47












  • @Babak You mean I need to use ng-animate ? Because I thought this was not necessary for my website.. And when closing them is actually true, but in that case the url isn't updated.

    – Arthur
    Nov 15 '18 at 14:58











  • ngAnimate makes lots of things easier for you as it hooks every transition to the scope and route states automatically. Doing it manually is inflicting a lot of unnecessary pain to self.

    – Babak
    Nov 15 '18 at 15:02

















0















link to: actual problem



ngRoute updates the url. When clicking the main menu on top of the page, the layout jumps to the new state without the transition effect because of this url update. However when I open an activity from the menu on the left the google maps initialization is included and everything seems to work fine. (Mac Chrome only tested for now).



Inside $routeProvider no difference between both routes:




.when('/c/:id', 
controller: 'ContentController',
templateUrl: 'js/views/content.html',
resolve:
redirect: function ($route) $route.current.params.redirect = 'c';

)
.when('/a/:id',
controller: 'SearchController',
templateUrl: 'js/views/activity.html',
resolve:
redirect: function ($route) $route.current.params.redirect = 'a';

)





Inside ContentController (which doesn't work well):






app.controller('ContentController', function($scope, $route, $routeParams, content) 
let redirect = $routeParams.redirect;

content.success(function(data)
$scope.content = data;
if (redirect==='c' && $routeParams.id)
$scope.content_detail = data[$routeParams.id];

);
);





Inside SearchController (which works because of the google maps initialization):






app.controller('SearchController', function($scope, $route, $routeParams, $filter, APIsearch) 
let redirect = $routeParams.redirect;

//load results
APIsearch.success(function(data)
$scope.results = data;

if (redirect==='a' && $routeParams.id)
$scope.result_detail = $filter('getSelected')(data, $routeParams.id);

initialize($scope.result_detail.polyline);
;
);
);





What does google.maps do which makes this work?!










share|improve this question






















  • It is not only google maps and activity, if you click on any of main sections, De Clup, routes... and close them transitions come back. The problem lies in your HTML directives or css not in JS, as I'm seeing you're not using animations in any of the controllers, you need to share those.

    – Babak
    Nov 15 '18 at 14:47












  • @Babak You mean I need to use ng-animate ? Because I thought this was not necessary for my website.. And when closing them is actually true, but in that case the url isn't updated.

    – Arthur
    Nov 15 '18 at 14:58











  • ngAnimate makes lots of things easier for you as it hooks every transition to the scope and route states automatically. Doing it manually is inflicting a lot of unnecessary pain to self.

    – Babak
    Nov 15 '18 at 15:02













0












0








0








link to: actual problem



ngRoute updates the url. When clicking the main menu on top of the page, the layout jumps to the new state without the transition effect because of this url update. However when I open an activity from the menu on the left the google maps initialization is included and everything seems to work fine. (Mac Chrome only tested for now).



Inside $routeProvider no difference between both routes:




.when('/c/:id', 
controller: 'ContentController',
templateUrl: 'js/views/content.html',
resolve:
redirect: function ($route) $route.current.params.redirect = 'c';

)
.when('/a/:id',
controller: 'SearchController',
templateUrl: 'js/views/activity.html',
resolve:
redirect: function ($route) $route.current.params.redirect = 'a';

)





Inside ContentController (which doesn't work well):






app.controller('ContentController', function($scope, $route, $routeParams, content) 
let redirect = $routeParams.redirect;

content.success(function(data)
$scope.content = data;
if (redirect==='c' && $routeParams.id)
$scope.content_detail = data[$routeParams.id];

);
);





Inside SearchController (which works because of the google maps initialization):






app.controller('SearchController', function($scope, $route, $routeParams, $filter, APIsearch) 
let redirect = $routeParams.redirect;

//load results
APIsearch.success(function(data)
$scope.results = data;

if (redirect==='a' && $routeParams.id)
$scope.result_detail = $filter('getSelected')(data, $routeParams.id);

initialize($scope.result_detail.polyline);
;
);
);





What does google.maps do which makes this work?!










share|improve this question














link to: actual problem



ngRoute updates the url. When clicking the main menu on top of the page, the layout jumps to the new state without the transition effect because of this url update. However when I open an activity from the menu on the left the google maps initialization is included and everything seems to work fine. (Mac Chrome only tested for now).



Inside $routeProvider no difference between both routes:




.when('/c/:id', 
controller: 'ContentController',
templateUrl: 'js/views/content.html',
resolve:
redirect: function ($route) $route.current.params.redirect = 'c';

)
.when('/a/:id',
controller: 'SearchController',
templateUrl: 'js/views/activity.html',
resolve:
redirect: function ($route) $route.current.params.redirect = 'a';

)





Inside ContentController (which doesn't work well):






app.controller('ContentController', function($scope, $route, $routeParams, content) 
let redirect = $routeParams.redirect;

content.success(function(data)
$scope.content = data;
if (redirect==='c' && $routeParams.id)
$scope.content_detail = data[$routeParams.id];

);
);





Inside SearchController (which works because of the google maps initialization):






app.controller('SearchController', function($scope, $route, $routeParams, $filter, APIsearch) 
let redirect = $routeParams.redirect;

//load results
APIsearch.success(function(data)
$scope.results = data;

if (redirect==='a' && $routeParams.id)
$scope.result_detail = $filter('getSelected')(data, $routeParams.id);

initialize($scope.result_detail.polyline);
;
);
);





What does google.maps do which makes this work?!






.when('/c/:id', 
controller: 'ContentController',
templateUrl: 'js/views/content.html',
resolve:
redirect: function ($route) $route.current.params.redirect = 'c';

)
.when('/a/:id',
controller: 'SearchController',
templateUrl: 'js/views/activity.html',
resolve:
redirect: function ($route) $route.current.params.redirect = 'a';

)





.when('/c/:id', 
controller: 'ContentController',
templateUrl: 'js/views/content.html',
resolve:
redirect: function ($route) $route.current.params.redirect = 'c';

)
.when('/a/:id',
controller: 'SearchController',
templateUrl: 'js/views/activity.html',
resolve:
redirect: function ($route) $route.current.params.redirect = 'a';

)





app.controller('ContentController', function($scope, $route, $routeParams, content) 
let redirect = $routeParams.redirect;

content.success(function(data)
$scope.content = data;
if (redirect==='c' && $routeParams.id)
$scope.content_detail = data[$routeParams.id];

);
);





app.controller('ContentController', function($scope, $route, $routeParams, content) 
let redirect = $routeParams.redirect;

content.success(function(data)
$scope.content = data;
if (redirect==='c' && $routeParams.id)
$scope.content_detail = data[$routeParams.id];

);
);





app.controller('SearchController', function($scope, $route, $routeParams, $filter, APIsearch) 
let redirect = $routeParams.redirect;

//load results
APIsearch.success(function(data)
$scope.results = data;

if (redirect==='a' && $routeParams.id)
$scope.result_detail = $filter('getSelected')(data, $routeParams.id);

initialize($scope.result_detail.polyline);
;
);
);





app.controller('SearchController', function($scope, $route, $routeParams, $filter, APIsearch) 
let redirect = $routeParams.redirect;

//load results
APIsearch.success(function(data)
$scope.results = data;

if (redirect==='a' && $routeParams.id)
$scope.result_detail = $filter('getSelected')(data, $routeParams.id);

initialize($scope.result_detail.polyline);
;
);
);






javascript angularjs css-animations






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 15 '18 at 13:58









ArthurArthur

112




112












  • It is not only google maps and activity, if you click on any of main sections, De Clup, routes... and close them transitions come back. The problem lies in your HTML directives or css not in JS, as I'm seeing you're not using animations in any of the controllers, you need to share those.

    – Babak
    Nov 15 '18 at 14:47












  • @Babak You mean I need to use ng-animate ? Because I thought this was not necessary for my website.. And when closing them is actually true, but in that case the url isn't updated.

    – Arthur
    Nov 15 '18 at 14:58











  • ngAnimate makes lots of things easier for you as it hooks every transition to the scope and route states automatically. Doing it manually is inflicting a lot of unnecessary pain to self.

    – Babak
    Nov 15 '18 at 15:02

















  • It is not only google maps and activity, if you click on any of main sections, De Clup, routes... and close them transitions come back. The problem lies in your HTML directives or css not in JS, as I'm seeing you're not using animations in any of the controllers, you need to share those.

    – Babak
    Nov 15 '18 at 14:47












  • @Babak You mean I need to use ng-animate ? Because I thought this was not necessary for my website.. And when closing them is actually true, but in that case the url isn't updated.

    – Arthur
    Nov 15 '18 at 14:58











  • ngAnimate makes lots of things easier for you as it hooks every transition to the scope and route states automatically. Doing it manually is inflicting a lot of unnecessary pain to self.

    – Babak
    Nov 15 '18 at 15:02
















It is not only google maps and activity, if you click on any of main sections, De Clup, routes... and close them transitions come back. The problem lies in your HTML directives or css not in JS, as I'm seeing you're not using animations in any of the controllers, you need to share those.

– Babak
Nov 15 '18 at 14:47






It is not only google maps and activity, if you click on any of main sections, De Clup, routes... and close them transitions come back. The problem lies in your HTML directives or css not in JS, as I'm seeing you're not using animations in any of the controllers, you need to share those.

– Babak
Nov 15 '18 at 14:47














@Babak You mean I need to use ng-animate ? Because I thought this was not necessary for my website.. And when closing them is actually true, but in that case the url isn't updated.

– Arthur
Nov 15 '18 at 14:58





@Babak You mean I need to use ng-animate ? Because I thought this was not necessary for my website.. And when closing them is actually true, but in that case the url isn't updated.

– Arthur
Nov 15 '18 at 14:58













ngAnimate makes lots of things easier for you as it hooks every transition to the scope and route states automatically. Doing it manually is inflicting a lot of unnecessary pain to self.

– Babak
Nov 15 '18 at 15:02





ngAnimate makes lots of things easier for you as it hooks every transition to the scope and route states automatically. Doing it manually is inflicting a lot of unnecessary pain to self.

– Babak
Nov 15 '18 at 15:02












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53321088%2fangularjs-ngroute-conflicts-with-css-animation%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53321088%2fangularjs-ngroute-conflicts-with-css-animation%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

Syphilis

Darth Vader #20