In AngularJS route is it possible to add default query parameters? -


if route setup, i'd "otherwise" route redirect '/inbound?page=0&size=20&sort=number,desc" "?" in route escaped "%3f".

  .config(function ($routeprovider) {     $routeprovider       .when('/outbound', {         templateurl: 'views/shipments.html',         controller: 'shipmentctrl'       })       .when('/inbound', {         templateurl: 'views/receipts.html',         controller: 'receiptsctrl'       })       .otherwise({         redirectto: '/inbound'       });   }); 

continuing previous answer, should set default values in inbounds route controller like

var search=$location.search(); var page=search.page||0; var size=search.size||20; var sort=search.sort||'number,desc'; 

the exact way of doing depend on how permissive empty strings , 0 size requests thats kinda idea


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -