Pregunta

I am trying to open an application client side and I have developed this entire application using only angularjs as a front end. It seems to be hijacking the routing and disallowing this.

In old javascript I used to be able to do

var wnd = window.open("dynamicsnav://arbitraryLinkDetails", "_blank");
wnd.close(); // this opens the protocol to start the application client 
             // side and closes the extra browser window

to open the Nav application client side and the details of what to open in place of arbitraryLinkDetails.

Now when I do this inside of my angular app it appends localhost to the url(really it is the base domain it attaches) like this

    "http://localhost/"dynamicsnav://arbitraryLinkDetails""

which does not work.

Things I have tried

  1. appending "//" to the url to break out of the angularjs routing, this tacks on a %22 to the beginning and removed the : for the protocol like "%22dynamicsnav//arbitraryLinkDetails"
  2. I have tried modifying the routing so

    var redirectFunction(){
        return theUrl; //this gets the full url of dynamicsnav://arbitraryLinkDetails
    }
    $routeProvider
       .when('/NavUrl', {redirectTo: redirectFunction}) 
    

    and that again appended base url to it.

This is a requirement for my current project and I simply cannot figure out a way to open this like I used to with angularjs.

I verified the url's I am testing with work in another application not using angular. Thanks for any help!

¿Fue útil?

Solución

The AngularJS $routeProvider service manage routes that deep link controllers with views, wich is not your case, why don't you try this :

var redirectFunction(){
    window.open("dynamicsnav://arbitraryLinkDetails", "_blank");
}
$routeProvider
   .when('/NavUrl', {redirectTo: redirectFunction}) 
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top