我遇到範圍問題。我無法從控制器方法登錄訪問範圍屬性fullName
。爲什麼?無法從控制器功能訪問示波器
App.controller('LoginController', ['$scope', 'LoginService', '$location', function(scope, LoginService, location) {
scope.fullName = "Full name";
scope.login = function(data, scope) {
LoginService.login(data).then(function(data) {
scope.fullName = LoginService.getFirstName() + " " + LoginService.getLastName();
});
};
scope.logout = function(data) {
LoginService.logout();
location.path("/index.html#/login");
};
}]);