我需要的函數內部的Ajax調用,但如果我使用$ HTTP我得到$ HTTP是沒有定義請給我建議我的代碼是
<script type="text/javascript">
function ContactController($scope) {
$scope.contacts = ["[email protected]", "[email protected]"];
$scope.add = function() {
alert("panduuuu")
$scope.contacts.push($scope.newcontact);
$scope.newcontact = "";
$http.get('http://localhost:8080/ProjectManagement/REST/Login/Check?usename='+usename+'&password='+password+'')
.success(function(data, status, headers, config,response){
alert("insideee")
var json = JSON.stringify(data);
var getresponseText = JSON.parse(json);
var value=getresponseText.responseText;
}).error(function(data, status, headers, config,response) {
});
}
}
</script>
這裏嘗試注入$ http服務 功能的ContactController($範圍,$ HTTP){ –