I have couple of questions regarding $location.path(/helpmeunderstand) . I have a login() method and ones the credentials are successful i want to navigate $location.path(/login/:username), but it does not show the name of the user who is logged in instead it just shows, /login/:username.
Please note i am doing this inside of the $scope.function, but does not work.
$scope.isValidUser = function() {
gitHubApiFactory.getUserName($scope.gitUserName)
.success(function (user) {
$scope.gitUser = user;
$scope.loaded = true;
$location.path( "/login/{{user.login}}" );
console.log(user);
})
.error(function(data, status, headers, config) {
$scope.userNotFound = true;
$log.log(data.error + ' ' + status);
});
Any suggestion is welcome.
Thanks