200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > html页面间传递用户名 无法从Angular js的html页面中将用户名和密码传递给控制器...

html页面间传递用户名 无法从Angular js的html页面中将用户名和密码传递给控制器...

时间:2023-01-07 06:04:26

相关推荐

html页面间传递用户名 无法从Angular js的html页面中将用户名和密码传递给控制器...

您需要使用ngController指令将控制器绑定到HTML模板。请参见以下示例:

var app = angular.module('homeapp', []);

app.controller('HomeController', function($scope, $http) {

$scope.username = '';

$scope.btntext = "Login";

$scope.login = function() {

console.log($scope.username, $scope.password);

//$http.get("/account/loginverify")

// .then(function(response) {

// $scope.myWelcome = response.data;

// if (response.data == "1") {

// window.location.href = 'home.html'

// } else {

// alert("Invalid username or password...!!!")

// }

// });

}

});

Remember me

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。