i struggling $routeparams work. want populate unsubscribe field email address contained in link url. using angularjs , after reading around subject seemed $routeparam way go cannot work
my html:
<form class="form-signin" name="regform"> <input type="email" id="email" name="email" class="form-control" ng-model="user.email"> </form>
my .config $routeprovider
.config(['$routeprovider', function ($routeprovider) { $routeprovider .when('/unsubscribe/:email', { templateurl: 'unsubscribe/unsubscribe.html', controller: 'unsubscribectrl' }) }]);
my .controller $routeparams
.controller('unsubscribectrl', ['$scope', '$location', '$routeparams', function ($scope, $location, $routeparams) { var param1 = $routeparams.email console.log(param1) }]);
now when navigate myurl/app/#/unsubscribe?email=some_text browser remains blank , not errors in console. mis-understanding how $routeparams supposed work?
the url trying access doesn't match given route in $routeparams
table. should try navigate app/#/unsubscribe/some_text
. $routeparams
understand email some_text
Comments
Post a Comment