-
Notifications
You must be signed in to change notification settings - Fork 27.5k
rc11 seems to have added extra encoding to links #1037
Comments
I found a similar issue discussed in Google Groups at https://groups.google.com/d/msg/angular/p6TkKUmXOhA/_LJ8Rf2Q71wJ |
Your link seems to be incorrect. Instead of :
It should be:
Does that resolve the problem? (PS: if you are using hash(bang) urls then your links must start with # and not /#, this is how HTML works and is not in any way related to Angular) |
Thanks for the pointer about the leading slash being incorrect, that's good to know! However, I can confirm that removing the leading slash does not resolve the issue, the link |
Use |
Thanks for the suggestion. I just changed to ng-href instead of href, and still see the same problem. And as someone pointed out in the Google Groups thread (https://groups.google.com/d/msg/angular/-/bdJwu5Jd_MwJ), this problem also occurs in angular-seed for rc11 (click the View 1/View 2). |
ngHref is not going to fix this. This is a regression. I was able to We'll issue a fix today. /i On Mon, Jun 11, 2012 at 1:59 PM, andyn3 <
|
Thanks Igor! Can't wait to sink my teeth into Angular |
Maybe I'm doing something wrong, but this still isn't working for me with hashbang urls. In Angular-seed I made these changes. app.js angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives']).
config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$routeProvider.when('/view1', {templateUrl: 'partials/partial1.html', controller: MyCtrl1});
$routeProvider.when('/view2', {templateUrl: 'partials/partial2.html', controller: MyCtrl2});
//$routeProvider.otherwise({redirectTo: '/view1'});
$locationProvider.hashPrefix('!');
}]); index.html <ul class="menu">
<li><a href="#!/view1">view1</a></li>
<li><a href="#!/view2">view2</a></li>
</ul> Clicking view2 changes the url to: _http://localhost:8000/app/index.html#!/!/view2_ Is the Thank you, Kyle |
we are looking into this |
can you please verify that this build works well for you: http://ci.angularjs.org/job/angular.js-misko/594/artifact/build/pkg/1.0.0rc12/ |
Yes it's working now. Thank you! |
This is a second fix for a regression that was introduced by 92a2e18. The fix addresses scenarios when the $location service is configured with a hash prefix. Closes angular#1037
I apologize for not including a jsFiddle, I couldn't figure out how to get a routing example working there!
In my module config I also add routing like (CoffeeScript):
In my HTML (inside an
ng-repeat
) I have links similar to this:Until today clicking the link would navigate to
/#/products/123
(for example), and properly route to that controller.However, this morning I upgraded to rc11, and followed the upgrade steps (e.g., change template to templateUrl), and now when I click the link it navigates to
/#/dashboard#%2Fproducts%2F123
I'm not sure if there's extra encoding being added now in rc11, or if the
$routeProvider.otherwise
functionality has changed, but as far as I can tell I'm using routing the way the tutorial says, and now it's not working w/ rc11.The text was updated successfully, but these errors were encountered: