I believe I have everything set up correctly, but $location.search() 
returns "{}". I am using Angular 1.5.8

Here is my code:

var app = angular.module('newsArticleListing', 
['angularUtils.directives.dirPagination', 'ui.bootstrap']);

app.controller('articleListing', ['$scope', '$http', '$location', 
function($scope, $http, $location){
    
// only absUrl returns something and the returned url does have several 
queries on it
    $scope.absUrl = $location.absUrl();
    
// returns nothing
    $scope.path = $location.pathl();

// returns nothing
    $scope.url = $location.url();
    
// returns {}
    $scope.urlQuery = $location.search();

    $http.get(jsonFeed).success(function(response){ 
        // JSON Data
$scope.articles = response.articles;
        $scope.allCategories = response.allCategories;
            
        // Pagination Initialization
        $scope.pagination = { current: 1 }; 
        $scope.pageSize = 9; 
      
// configure locationProvider  
   app.config(['$locationProvider', function($locationProvider){
       $locationProvider.html5Mode(true);
   }]);

    // Add 'site:' to list of safe urls
    app.config( [

        '$compileProvider',
        function( $compileProvider )
        {   
            
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|site):/);
        }
    ]);
       
// Reset page to 1 when search input changes
    $scope.changeHandler = function() {
        $scope.pagination = {
            current: 1
        };
    };
}]);

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to