Modal W3.CSS conflicts with AngularJS [closed]

1

I'm trying the AngularJS that until then used Bootstrap CSS.

But the W3.CSS uses an anchor to open, already AngularJS interprets the anchors as routes and redirects to the route .

As an otherwise , it redirects to / and does not open the modal. If I enter a route to the modal, AngularJS opens as a page and not as modal.

I would like guidance on how to proceed in this case.

    
asked by anonymous 03.09.2015 / 14:57

1 answer

0

Use the $AnchorScroll service. Example implementation:

app.run(function($rootScope, $location, $anchorScroll) {
  $rootScope.$on('$routeChangeSuccess', function(newRoute, oldRoute) {
    if($location.hash()) $anchorScroll();  
  });
});

You can then create links containing the route and the desired anchor, like this:

<a href="#/rota#ancora">Rota/Âncora</a>

Source.

    
03.09.2015 / 15:41