Вопрос

I am using a third party service on my site with its own authentication flow. There is an opportunity to reset password. This feature has the following flow. You become the email with the link on yoursite.com/#xxx=123456

After you enter this page third party library is downloaded, and after some init process it checks the location url for #xxx=\d+ fragment to make some ajax call and prompt some ui modals

var hashKeyElements = window.location.toString().match('#xxx=(.*)'); 

There is no way to change the way they are doing it. And here is the problem - Angular rewrites yoursite.com/#xxx=123456 to yoursite.com/#/xxx=123456 and after that regexp is not matched

I tried to create double # in url but it causes errors.

UPDATE: Using angular 1.2.4, it's not a SPA and all of the related links should not be prevented and pushed via pushState

Thank you

Это было полезно?

Решение

update

After you mentioned that you are not using client-side routing I checked again and it seems that angular.js (all versions) does not add hashes (/#/) to URL unless you use $locationProvider or $routeProvider even when html5Mode=false. `


If you do client-side routing or using $location:

you need to use html5Mode - docs:

app.config(function($locationProvider){
  $locationProvider.html5Mode(true)
})
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top