Getting values from query string in an url using AngularJS $location

后端 未结 9 949
鱼传尺愫
鱼传尺愫 2020-11-27 04:36

Regarding $location.search, the docs say,

Return search part (as object) of current url when called without any parameter.

In my

9条回答
  •  一向
    一向 (楼主)
    2020-11-27 05:20

    If your $location.search() is not working, then make sure you have the following:

    1) html5Mode(true) is configured in app's module config

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

    2) is present in your HTML

    
      
      ...
    
    

    References:

    1. base href="/"
    2. html5Mode

提交回复
热议问题