0

How can the "go back to the root path" function in C#: "~/", be expressed in Javascript if at all. (e.g. "~/myfolder/anotherfolder/file.html").

The problem that I encountered is actually related to DNN, AngularJS and the use of routes. I have a DNN page on which I defined an angular module (call it app). The module's js files are located inside the DNN skin which I named 'mySkin' and defined a variable like so:

  var skin path = "/Portals/​_default/​Skins/​mySkin/"

and the template's path is:

  var template = "/Portals/​_default/​Skins/​mySkin/templates/template.html"

The route as:

  var routes = {
      main: { templateUrl: template, controller: 'mainController' },
   }

With this configuration ng-view is not being populated with anything and i suspect that it is because the DNN page is executed at a route:

mydomain.com/services#/

Any ideas?

David Barel
  • 285
  • 5
  • 18
  • It's related but its not a duplication. I believe that many DNN developers will move to using Angular soon. This then might be a common problem. Anyway this post might help them look in the right direction. – David Barel Oct 23 '14 at 15:45
  • I guess it can help link DNN and this specific problem, which is often hard to do. I'll remove my close vote. – samy Oct 23 '14 at 15:48

1 Answers1

0

Actually I was looking in the wrong direction. Apparently the paths I defined above were perfectly fine. But for some UNKNOWN reason, something was adding zero width spaces to my path. To resolve the issue i used the following code:

 skinPath = skinPath.replace(/[\u200B-\u200D\uFEFF]/g, '');

Which was originally suggested in this StackOverflow question:

http://stackoverflow.com/questions/11305797/remove-zero-width-space-characters-from-a-javascript-string
David Barel
  • 285
  • 5
  • 18