您需要使用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