vodkabears / Remodal

No longer actively maintained.
http://vodkabears.github.io/remodal/
MIT License
2.75k stars 771 forks source link

Remodal in Angularjs triggers new route #224

Closed brenolf closed 8 years ago

brenolf commented 8 years ago

The issue #163 is the same as this, but the answer there wasn't helpful for me. I have used the modal as a directive as follows:

<div class="remodal" data-remodal-id="soon"
  data-remodal-options="hashTracking: false, closeOnOutsideClick: false">

  <button data-remodal-action="close" class="remodal-close"></button>
  <h1>{{'home.soon' | translate}}</h1>
  <br>
  <button data-remodal-action="confirm" class="remodal-confirm">OK</button>
</div>

But whenever I call angular.element('[data-remodal-id=soon]').remodal().open() I get redirected to the root page. Moreover, I can see a '/#/soon' blinking and going to '/#/', since there is no route matching soon.

brenolf commented 8 years ago

Reading the source code I found that

angular.element('[data-remodal-id=soon]').remodal({
  hashTracking: false
}).open()

Fixed my issue.