Router

Open this example on Plunker and check the source code.

Simpler example

Open this example on Plunker and check the source code.

Further reading