When to use “client-side routing” or “server-side routing”?

tl;dr: with server-side routing you download an entire new webpage whenever you click on a link, with client-side routing the webapp downloads, processes and displays new data for you. Imagine the user clicking on a simple link: <a href=”https://stackoverflow.com/hello”>Hello!</a> On a webapp that uses server side routing: The browser detects that the user has clicked … Read more

Laravel – Using (:any?) wildcard for ALL routes?

Laravel 5 This solution works fine on Laravel 5: Route::get(‘/admin’, function () { // url /admin }); Route::get(‘/{any}’, function ($any) { // any other url, subfolders also })->where(‘any’, ‘.*’); Lumen 5 This is for Lumen instead: $app->get(‘/admin’, function () use ($app) { // }); $app->get(‘/{any:.*}’, function ($any) use ($app) { // });

Draw path between two points using Google Maps Android API v2

First of all we will get source and destination points between which we have to draw route. Then we will pass these attribute to below function. public String makeURL (double sourcelat, double sourcelog, double destlat, double destlog ){ StringBuilder urlString = new StringBuilder(); urlString.append(“http://maps.googleapis.com/maps/api/directions/json”); urlString.append(“?origin=”);// from urlString.append(Double.toString(sourcelat)); urlString.append(“,”); urlString.append(Double.toString( sourcelog)); urlString.append(“&destination=”);// to urlString.append(Double.toString( destlat)); urlString.append(“,”); … Read more

Angularjs, passing scope between routes

You need to use a service since a service will persist throughout your app’s life. Lets say you want to save data pertaining to a user This is how you define the service : app.factory(“user”,function(){ return {}; }); In your first controller: app.controller( “RegistrationPage1Controller”,function($scope,user){ $scope.user = user; // and then set values on the object … Read more

How to use router.navigateByUrl and router.navigate in Angular

navigateByUrl routerLink directive as used like this: <a [routerLink]=”/inbox/33/messages/44″>Open Message 44</a> is just a wrapper around imperative navigation using router and its navigateByUrl method: router.navigateByUrl(‘/inbox/33/messages/44’) as can be seen from the sources: export class RouterLink { … @HostListener(‘click’) onClick(): boolean { … this.router.navigateByUrl(this.urlTree, extras); return true; } So wherever you need to navigate a user … Read more

Angular 2 – Submodule routing and nested

The html page will look like this. Main Page <top-navbar></top-navbar> <router-outlet></router-outlet> Sub Module Page <sub-navbar></sub-navbar> <router-outlet name=”sub”></router-outlet> on clicking navigation in top-nav bar the main route outlet will route respectively. while clicking on sub-navbar the router-outlet [sub] will route respectively. HTML is fine, the trick will came at writing app.routing app.routing.ts const appRoutes: Routes = … Read more