올바른 절차를 수행 했더라도 삭제 기능에 대해 경고를받을 수 없으므로 동일한 도움을주십시오. 내 문제를 해결하기 위해 미리 감사드립니다. 경고를받을 수 없습니다. 삭제 기능을 위해 내가 잘 절차를 완료 한 경우에도 그래서 당신의 각도 응용 프로그램의 한 부분으로 등록해야Angular Js에서 삭제 기능이 작동하지 않습니다
<html ng-app="crudApp">
<head>
<meta charset="UTF-8">
<title>Angular js</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
</head>
<body>
<form name="addForm" ng-submit="Add" ng-controller="employeecontroller">
First Name: <input type="text" ng-model="firstname"><br/><br/>
Last Name: <input type="text" ng-model="lastname"><br/><br/>
<input type="submit" name="btnInsert" value="Insert" ng-click='insertData()'/>
</form>
<div ng-controller="DbController">
<table border="1">
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr ng-repeat="detail in details">
<td>{{detail.firstname}}</td>
<td>{{detail.lastname}}</td>
<td><input type="button" value="Delete" ng-click="deleteInfo()"/></td>
</tr>
</table>
</div>
<script>
function employeecontroller($scope, $http) {
$scope.insertData = function() {
$http.post("insert.php", {
'firstname': $scope.firstname,
'lastname': $scope.lastname,
}).success(function (data, status, headers, config) {
console.log("Data Inserted Successfully");
});
}
}
var crudApp = angular.module('crudApp', []);
crudApp.controller("DbController", ['$scope', '$http', function ($scope, $http) {
// Sending request to EmpDetails.php files
getInfo();
function getInfo() {
$http.post('select.php').success(function (data) {
// Stored the returned data into scope
$scope.details = data;
console.log(data);
});
}
}]);
function DbController($scope,$http) {
$scope.deleteInfo = function() {
alert("hello");
}
}
</script>
</body>
</html>
'employeecontroller'로 작업 했습니까? 앱에 등록되지 않은 것처럼 보입니다. 오류가 없습니까? – AranS
자신을 반복 할 필요가 없습니다 ... –