How to get multiple parameters in AngularJS from a link -
i'm trying data link i'm getting first name , last name. code work fine if use 1 parameter #/firstname/{{firstname}} when try add parameter doesn't show anything. please help.
my link in 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 }}!
Comments
Post a Comment