I'm trying to get angular UI router to work. It was all fine in a standard web project, until I imported into a .net project and everything seemed to break. Namely:
<a ui-sref="someUrl">Click here</a>
does not work, when it did in the previous project. The interesting catch is, if I add an href attribute with a value (can't be an empty string), the click works. This is annoying because my two environments with the same code are acting differently.
Does anyone know why the ui-router would break without an explicit href attribute set on the tag? The git docs state expressly with a code example that the anchor tag only needs the ui-sref attribute, because it will write the href tag on its own when applicable.
I'm using angular 1.3.2 and angular-ui-router.0.2.11.
Code:
<h2>Home Page</h2>
<a href="#" ui-sref="someState">Click for profile</a>
<div ui-view="someStateContainer"></div>
That is literally all of the base html inside the body.
main.js:
/**
* Primary application definition
*/
var App = App || angular.module("App", [
"ui.router"
]);
App.config(["$stateProvider", "$urlRouterProvider",
function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise("/");
$stateProvider
.state("someState", {
views: {
"someStateContainer": {
templateUrl: "states/testState"
}
}
})
}]);