angularjs 1.6.0 (latest now) routes not working

前端 未结 5 682
北恋
北恋 2020-11-22 03:57

I was expecting to see this question on Stackoverflow but didn\'t. Apparently I\'m the only one having this problem that seems to me to be very common.

I have a basi

5条回答
  •  庸人自扰
    2020-11-22 04:18

    Simply use hashbang #! in the href:

     Add Quote
    

    Due to aa077e8, the default hash-prefix used for $location hash-bang URLs has changed from the empty string ('') to the bang ('!').

    If you actually want to have no hash-prefix, then you can restore the previous behavior by adding a configuration block to your application:

    appModule.config(['$locationProvider', function($locationProvider) {
      $locationProvider.hashPrefix('');
    }]);
    

    For more information, see

    • AngularJS GitHub Pull #14202 Changed default hashPrefix to '!'
    • AngularJS Guide - Migration - aa0077e8

    Sorry to get on my high horse but... How did this get released? This is massive, breaking bug. — @MiloTheGreat

    The breaking change as by #14202 should be reverted as the reference specification was already officially deprecated #15715

    I'm going to close this issue because we haven't got any feedback. Feel free to reopen this issue if you can provide new feedback.

    — https://github.com/angular/angular.js/issues/15715#issuecomment-281785369

提交回复
热议问题