I'm using Angular and UI router. I'm trying to get a link shown on the page that the user can copy and share. This thread has shown me that
$state.href
localhost
localhost/dev/app/
$scope.url = $state.href('survey', { survey: "asd" }, {absolute: true});
.state('survey', {
url: "/:survey/survey?ao",
templateUrl: "views/survey/survey.html",
controller: "surveyController",
},
data: {
requireLogin: false,
requireAdmin: false
}})
http://localhost/dev/app/#/asd/survey
http://localhost/#/asd/survey
ui-sref="survey({survey: "asd"})
Adding a base
tag to my app page solved this issue for me. It defines the base URL for the page with the router references. For legacy support reasons, I'm on version 0.2.15 of Angular UI Router. I don't know if this is still necessary for more current versions.
<base href="http://localhost/dev/app/" />