I'm trying to get data from the link where I'm getting first name and last name. The code work just fine if I use one parameter that is #/firstName/{{firstName}} but when I try to add another parameter then it doesn't show anything. Please help.
My link in the template
<a href="#/firstName/{{firstName}}/lastName/{{lastName}}">Profile</a>
My Route Provider configuration
$routeProvider.
when('/firstName/:fn/lastName/:ln', {
templateUrl: 'profile.php',
controller: 'ProfileController'
})
My Controller
allControllers.controller('ProfileController', ['$scope', '$routeParams', function($scope, $routeParams) {
$scope.firstName = $routeParams.fn;
$scope.lastName = $routeParams.ln;
}]);
My View
Welcome, {{ firstName }} {{ lastName }}!