0

As you are aware that Angular rewrites the url and hence I have given the following code to take care, FYI I am not using the route provider in Angular.

I have already resolved the issue raised by Phil using $locationProvider.html5Mode

  '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



}]);

Now my issue is: the following url

http://localhost:62395/#tv?mobile=1

is rewritten to:

http://localhost:62395/#tv%3Fmobile=`enter code here`1

Am I missing something here or in the code?

Santanu
  • 7
  • 5
  • Possible duplicate of [angularjs 1.6.0 (latest now) routes not working](http://stackoverflow.com/questions/41211875/angularjs-1-6-0-latest-now-routes-not-working) – Phil Feb 08 '17 at 05:55
  • angularjs 1.6.0 (latest now) routes not working – Phil 17 hours ago - the solution for that is different from mine, because I am not using the route provider in Angular. I have also given the part of Phil's solution in my code. But I am still facing the problem after I fixed the issue as mentioned in detail in the [angular documents](https://docs.angularjs.org/guide/$location)? – Santanu Feb 09 '17 at 00:00

1 Answers1

0

Looks like a simple change is taking care of this issue, by moving the querystring as follows

http://localhost:62395?mobile=1/#tv

Santanu
  • 7
  • 5