如您所知,Angular会重写网址,因此我已经提供了以下代码来照顾,仅供参考我不在Angular中使用路由提供程序。
我已经使用$ locationProvider.html5Mode
解决了Phil提出的问题 'use strict';
(function () {
angular.module('ngDocument', ['ngAnimate', 'ngSanitize', 'ui.bootstrap'])
})();
angular
.module('ngDocument')
.config(configState);
function configState($locationProvider) {
if (window.history && window.history.pushState) {
$locationProvider.html5Mode({
enabled: true,
requireBase: false,
rewriteLinks: false
}).hashPrefix('*');;
}
else {
$locationProvider.html5Mode(false);
}
}
///#source 1 1 /App/Services/sq-service.js
angular.module('ngDocument')
.service('sqService', ['$http', function ($http) {
// Service Code -- This comeplete code is not hitting when you go to this URL
}]);
///#source 1 1 /App/Services/sq-controller.js
angular.module('ngDocument')
.controller('sqWidgetInternetController', ['$scope', '$rootScope', '$http', 'sqService', function ($scope, $rootScope, $http, sqService) {
// Comeplete Contrller Code ---- This comeplete code is not hitting when you go to this URL
}]);
现在我的问题是:以下网址
http://localhost:62395/#tv?mobile=1
被重写为:
http://localhost:62395/#tv%3Fmobile=`enter code here`1
我在这里或代码中遗漏了什么?