Having trouble accessing the scope attribute fullName
from the controller method login. What could be causing this issue?
App.controller('LoginController', ['$scope', 'LoginService', '$location', function(scope, LoginService, location) {
scope.fullName = "Full name";
// Issue may arise here, reference to dynamic variable 'data' instead of hardcoded form input values
scope.login = function(data, scope) {
LoginService.login(data).then(function(data) {
// Potential logic error, modifying fullName in an unexpected way
scope.fullName = LoginService.getFirstName() + " " + LoginService.getLastName();
});
};
// Logout function does not seem to have any issues based on provided code
scope.logout = function(data) {
LoginService.logout();
location.path("/index.html#/login");
};
}]);