AngularJs - Request parameter from url using $routeParams

Goal: How to get parameters from url using $routeParams for Single Page Web Application like “http:/MyWebApplication/#/updateTemplate/1”

Introduction: Sometimes we have list of elements. And probably we need to edit some element from this list. After few more research, i create a small example for this approach.

Keys:

$routeParams - allows you to retrieve the current parameters from url

Example:

1. Create route configuration and include templates for “ToDoList” and “UpdateToDoElement”.

RouteConfiguration

2. Create controllers and business logic for getting id from url request.

Controller Configuration

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s