Angular2 Auxiliary Routing - angular2-routing

I am creating multiple router outlets. The following is the router link to a component I want to load in an outlet called "campaigns".
List
However, it appears to link to /campaigns(campaigns%3Alist) and fails.
How do I get the ":" not to escape?

you have to provide routerLink as below
[routerLink]="['campaigns', {outlets: {campaigns: 'list'}}]"
Hope this helps!!

Related

Firebase Deep Link with custom parameter at the end

I created a Firebase Deep Link for my Flutter app to open the app after the registration process was successful. The link looks like the following:
https://myLinkDomain.page.link/routeName/
During the registration process, a parameter must be appended to the end of the link, which I must read out in the app for successful completion.
The problem is that if I append the parameter to the end of the link, I can no longer access it. The link in this case looked like this:
https://myLinkDomain.page.link/routeName/?myCustomParam=myValue
If the parameter is given in the middle of the link, I can use it in the app. Like this:
https://myLinkDomain.page.link/routeName/?myCustomParam=myValue&apn=someStuff&isi=someStuff&ibi=someStuff&ifl=someStuff
However, the registration process requires that the parameter be added to the end of the link.
Is there a way to build the Firebase Deep Link so that the parameter can be added at the end and still be recognised in the app?
Thanks for any help!
No matter when this parameter goes - at start or at the end of the line.
I had the same problem with passing some custom parameters to my app.
Here is we should start with manual url construction:
firebase manual link construction
I have no easy way to pass parameters, so I just change the link parameter body to put here more parameters:
https://example.page.link/?link=https://example.com/?route%3Dprofile%26param1%3DA%26param2%3DB&apn=some&isi=some&ibi=some
prefix: https://redecor.page.link/
main body in link parameter (should be encoded). There is the place for all needed parameters you want to pass (route=profile&param1=A&param2=B) - all parameters should be encoded!
encoded should be like this: route%3Dprofile%26param1%3DA%26param2%3DB
other parameters (what are they means you could read here) for firebase proposes (no needs to encode):
apn=some&isi=some&ibi=some
Never mind. The solution is to change the order of the url parameters: myLinkDomain.page.link/routeName/…

How do I localize routes with next.js and next-i18next?

I need to change the name of the route when I change the language. For example, I have a route /en/career but when I change to Czech language, I need a route /cs/kariera. Basically I need the URLs to be localized. Right now, when I'm on /en/career and change language to cs, I get /cs/career. This page should not exist at all and when I render the page on server, I correctly get 404. Can I do something like this with next-i18next package? If so, how?
I found this package https://github.com/vonschau/next-routes-with-locale which probably does exactly what I need but it's apparently no longer maintained and doesn't work under next.js 8.
What I did eventually was to use next-routes package and defined specific route for every page, such as:
module.exports = routes()
.add('en-career-listing', '/en/career/:listing', 'career/listing')
.add('cs-career-listing', '/cs/kariera/:listing', 'career/listing')
.add('en-career', '/en/career', 'career')
.add('cs-career', '/cs/kariera', 'career')
.add('en-our-story', '/en/our-story', 'our-story')
.add('cs-our-story', '/cs/nas-pribeh', 'our-story')
And I also had to create a custom Link component based on next/link where I manually added the language to URL.
next-i18next supports this functionality, it called locale subpaths.
You need to configure: new NextI18Next({ localeSubpaths: 'foreign' }), and then use the Link & Router that NextI18Next instance has on it, not the next/router.

magic route for presenter in nette framework

Is it possible to create magic route with nette route ?
what i mean of magic route is i dont need to declare any route array on routelist... but when i type address on browser address bar such as :
http:somesite.com/product/detail/123.
it would point to presenter product -- renderDetail
(this magic route is known in other framework, and i think for some reason it would make complicated if i would type every single action/presenter redirection on routelist array)
thanks in advance.
Do you mean $router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');?
It's in the documentation: https://doc.nette.org/en/2.3/routing#toc-route.
Route from Matěj is working. You just need to type SomePresenter::actionTwoWords as some/two-words in url.
But don't construct urls by hand, use {link} macro in latte templates or Nette\Application\LinkGenerator in code.

How to enable route security when using AngularFire with Angular ui-router?

Is it possible to use theAngularFire routeSecurity module with angular UI-ROUTER instead of the standard ng-route provider? Is there a version of routeSecurity that would work with ui-router?
#mattvv Gave me this gist while I was talking on him in the angular irc channel. So essentially you would just need to replace the routesecurity.js file in angularfire directory assuming that you used yeoman to scaffold your application.
A neat thing to do is just to create another file named routesecurity-ui-router.js instead of replacing the content of the routesecurity.js.
So to give a little bit of information about the gist, basically mattvv just modified the routes term and use state instead.

How to modify the SignalR Hub URL

I would like to use a different base hub URL than ~/signalr/hubs. How to modify this url, for example to ~/api/hubs?
Second question, may I use a different url for a different sets of hubs? For example:
~/api/chat/hubs
~/api/email/hubs
Thanks.
Ran across this, possible now with 0.5+:
RouteTable.Routes.MapHubs("~/api");
No you may not, it's hardcoded in the source.
No the proxy generated is for all hubs.
Well this question is old (4 years? wtf.. I always thought web sockets was kinda new).
... Well they(Microsoft) have new descriptive well written documentation on their website now
This could be a link only answer but if you are in a hurry.... On the server side at the startup or owin app config have somthing like this...
app.MapSignalR("/newCoolUrl", new HubConfiguration());
Ehhh sure you need to replace everything "/signalr" on whichever clients you are using to "/newCoolUrl" example
var connection = $.hubConnection("/newCoolUrl", { useDefaultPath: false });

Resources