Since upgrading from Angular 1.3.0 RC-2 to RC-3, the hash sign in my links created by ui-sref has disappeared. The link is clickable, and the status is transferred correctly, but if I copy the link address and paste it into the browser, it will land on the wrong page. I do not want to use HTML5Mode.
1.3.0-RC-2
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="style.css"> </head> <body ng-app="myApp"> <div ui-view></div> <script src="https://code.angularjs.org/1.3.0-rc.2/angular.js"></script> <script src="https://rawgit.com/angular-ui/ui-router/0.2.11/release/angular-ui-router.js"></script> <script> angular.module('myApp', ['ui.router']) .config(function($stateProvider, $urlRouterProvider, $locationProvider) { $urlRouterProvider.otherwise('/foo'); $stateProvider.state('foo', { url: '/foo', template: 'This is foo <a ui-sref="foo.bar">Go to bar</a><div ui-view></div>' }) .state('foo.bar', { url: '/bar', template: 'This is bar' }) $locationProvider.html5Mode(false); </script> </body> </html>
Plunkr demonstrates a working example
1.3.0-rc.4
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="style.css"> </head> <body ng-app="myApp"> <div ui-view></div> <script src="https://code.angularjs.org/1.3.0-rc.4/angular.js"></script> <script src="https://rawgit.com/angular-ui/ui-router/0.2.11/release/angular-ui-router.js"></script> <script> angular.module('myApp', ['ui.router']) .config(function($stateProvider, $urlRouterProvider, $locationProvider) { $urlRouterProvider.otherwise('/foo'); $stateProvider.state('foo', { url: '/foo', template: 'This is foo <a ui-sref="foo.bar">Go to bar</a><div ui-view></div>' }) .state('foo.bar', { url: '/bar', template: 'This is bar' }) </script> </body> </html>
Plunkr demonstrates the problem
Am I doing something wrong or is the ui-router not compatible with the latest candidate for Angular?
source share