when i call a function which is defined in controller am getting function not defined error.
Uncaught ReferenceError: deleteBook is not defined
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title></title>
<body>
<div ng-app="myApp" ng-controller="customersCtrl">
<ul style="list-style:none;">
<li ng-repeat="x in name">
<a onclick="deleteBook({{ x.id }})" href="javascript:void(0);">{{ x.name + ' - ' + x.author }}</a>
</li>
</ul>
</div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script type="text/javascript">
var app = angular.module('myApp', [] );
app.controller('customersCtrl', function( $scope , $http ) {
$scope.deleteBook = function ( pId ) {
console.log( pId );
}
$http.get("http://localhost/tangu/books.php")
.then(
function(response) {
console.log(response);
$scope.name = response.data;
}
);
});
</script>
</body>
</html>