Angular 1.6 Introduces Hash-Bang Prefix (#!/) in URLs
Q: Why did my AngularJS app's URLs change from "/admin#/” to "/admin#!/"?
Since AngularJS 1.6, a new hash prefix has been added to URLs.
According to the documentation:
Due to aa077e8, the default hash-prefix used for $location hash-bang URLs has changed from the empty string ('') to the bang ('!').
Q: Why the change?
The hash prefix is used to differentiate AngularJS hash-bang URLs from other hash values in the URL. This helps prevent conflicts and ensures correct operation.
Q: How can I revert to the old behavior?
To remove the hash-bang prefix, add the following code to your AngularJS module configuration:
appModule.config(['$locationProvider', function($locationProvider) { $locationProvider.hashPrefix(''); }]);
The above is the detailed content of Why Did AngularJS 1.6 Change Hash Prefixes from \'/admin#\' to \'/admin#!/\'?. For more information, please follow other related articles on the PHP Chinese website!