query-parameters

How to set query parameters to url Angular2?

心已入冬 提交于 2019-12-03 01:23:51
I have a requirement to set a url with query parameters like /Questions?id=1234&pageid=0 . I have tried to do it via router.Navigate['/Questions?id=1234&pageid=0'] but no luck. After navigation browser shows like /Questions%3Fid%3D1234%26pageid%3D0 . I have also tried it with setting routerLink="/Questions?id=1234&pageid=0" , but same result. Please suggest any solution to do it.I am using rc5 for angular2 . You can pass them as item in the router, but outside the commands array: [routerLink]="["/Questions"], {queryParams: {id:1234, pageid:0}}" this generates what you want: /Questions?id=1234

AngularJS - Using $resource.query with params object

一世执手 提交于 2019-12-02 17:58:43
I'm trying to pick up angular.js and working on figuring out some of the things that are a bit less documented. Consider this - I have a search method on the server that accepts query params and returns a collection of search results, and responds to GET /search.json route (Rails FWIW). So with jQuery , a sample query would look like this: $.getJSON('/search', { q: "javascript", limit: 10 }, function(resp) { // resp is an array of objects: [ { ... }, { ... }, ... ] }); I'm trying implement this using angular, and wrap my head around how it works. This is what I have now: var app = angular

Using the same parameter twice

倾然丶 夕夏残阳落幕 提交于 2019-12-02 14:31:09
问题 I have the following SQL query: SELECT SUM(OpenInterest) *(SELECT DISTINCT Future FROM MTM WHERE Expiry = [dbo].fx_GetRelativeExpiry(@date, 1, @Code) and TradeDate = @date and Code = @Code and type = @Type and Class = 'Foreign Exchange Future') / 1000 FROM MTM WHERE Expiry = [dbo].fx_GetRelativeExpiry(@date, @N, @Code) and TradeDate = @date and Code = @Code and type = @Type and Class = 'Foreign Exchange Future' Which I want to use as a function in Excel. The issue is that I reuse parameters

Using the same parameter twice

坚强是说给别人听的谎言 提交于 2019-12-02 08:03:20
I have the following SQL query: SELECT SUM(OpenInterest) *(SELECT DISTINCT Future FROM MTM WHERE Expiry = [dbo].fx_GetRelativeExpiry(@date, 1, @Code) and TradeDate = @date and Code = @Code and type = @Type and Class = 'Foreign Exchange Future') / 1000 FROM MTM WHERE Expiry = [dbo].fx_GetRelativeExpiry(@date, @N, @Code) and TradeDate = @date and Code = @Code and type = @Type and Class = 'Foreign Exchange Future' Which I want to use as a function in Excel. The issue is that I reuse parameters many times in the above query and I don't know how to do that in excel without creating a new (and

ZF2: using url helper and reuse query parameters

笑着哭i 提交于 2019-12-02 03:57:15
I'm trying to reuse query params using Url helper in a view. This is my current url: http://localhost/events/index?__orderby=name&__order=asc I'm using this code in the view: $this->url('events/index', array('__page' => '2'), true); I want to obtain this url: http://localhost/events/index?__orderby=name&__order=asc&__page=2 But instead i get this: http://localhost/events/index?controller=Application\Controller\Events&__page=2 This is my route inside module.config.php file: 'events' => array( 'type' => 'segment', 'options' => array( 'route' => '/eventos[/:action]', 'constraints' => array(

Angular ui-router with url query parameter containing a “dot”

我的梦境 提交于 2019-12-01 16:54:49
In our Angular app we have to deal with id's that contain a "dot". For example: book = { id: '123.456' } We have problems using such id's as url parameters. All works well if navigation occurs through "Angular", namely clicking on the link that invokes $state.go('bookDetails', {bookId: book.id}); . But things do not work when reloading the page "Cannot GET /bookDetails?bookId=123.456" in the controller: $scope.viewBookDetails = function() { $state.go('bookDetails', {bookId: book.id}); } in the view <a href="" ng-click="viewBookDetails(); $event.stopPropagation();"> in the router: .state(

Angular ui-router with url query parameter containing a “dot”

一曲冷凌霜 提交于 2019-12-01 16:00:56
问题 In our Angular app we have to deal with id's that contain a "dot". For example: book = { id: '123.456' } We have problems using such id's as url parameters. All works well if navigation occurs through "Angular", namely clicking on the link that invokes $state.go('bookDetails', {bookId: book.id}); . But things do not work when reloading the page "Cannot GET /bookDetails?bookId=123.456" in the controller: $scope.viewBookDetails = function() { $state.go('bookDetails', {bookId: book.id}); } in

psycopg2 difference between AsIs and sql module

拈花ヽ惹草 提交于 2019-12-01 12:59:50
To choose dynamically a table name in a query I used to use AsIs() from psycopg2.extensions ( http://initd.org/psycopg/docs/extensions.html#psycopg2.extensions.AsIs ), with the following syntax: cur.execute("SELECT * FROM %s WHERE id = %s;", (AsIs('table_name'), id)) However, the documentation now recommends to use the new psycopg2.sql module available in version 2.7 ( http://initd.org/psycopg/docs/sql.html#module-psycopg2.sql ) with the following syntax: from psycopg2 import sql cur.execute( sql.SQL("SELECT * FROM {} WHERE id = %s;") .format(sql.Identifier('table_name')), (id, ) What's the

psycopg2 difference between AsIs and sql module

拜拜、爱过 提交于 2019-12-01 10:31:18
问题 To choose dynamically a table name in a query I used to use AsIs() from psycopg2.extensions ( http://initd.org/psycopg/docs/extensions.html#psycopg2.extensions.AsIs ), with the following syntax: cur.execute("SELECT * FROM %s WHERE id = %s;", (AsIs('table_name'), id)) However, the documentation now recommends to use the new psycopg2.sql module available in version 2.7 ( http://initd.org/psycopg/docs/sql.html#module-psycopg2.sql ) with the following syntax: from psycopg2 import sql cur.execute(

How to filter a request that has an invalid parameter in JAX-RS?

偶尔善良 提交于 2019-12-01 05:36:01
问题 By "invalid" I mean a parameter that is not expected. For example: @Path("/") public interface ExampleInterface { @GET @Path("/example") public Response test( @QueryParam("param1") String param1, @QueryParam("param2") String param2 ); } And then I call ".../example?param3=foo" 回答1: You can check use a ContainerRequestFilter and compare the passed parameters with the defined parameters: @Provider public class RequestParamFilter implements ContainerRequestFilter { @Context private ResourceInfo