答案 0 :(得分:1)
如果你看一下plunkr的源代码,你会发现:
service.Login = function (username, password, callback) {
/* Dummy authentication for testing, uses $timeout to simulate api call
----------------------------------------------*/
$timeout(function(){
var response = { success: username === 'test' && password === 'test' };
if(!response.success) {
response.message = 'Username or password is incorrect';
}
callback(response);
}, 1000);
/* Use this for real authentication
----------------------------------------------*/
//$http.post('/api/authenticate', { username: username, password: password })
// .success(function (response) {
// callback(response);
// });
};
因此,虚拟身份验证不会发送任何HTTP请求,因为它是一个“模拟”HTTP调用的虚拟超时函数。
您看到GET请求有一个AJAX调用来加载部分home.html
视图。