Below is my code in AngularJS. i have created controller but i am getting error :
Error: [ng:areq] Argument 'forgetController' is not a function, got undefined
app.controller("forgetController", function ($scope, forgetService) {
$scope.OperType = 1;
// 1 MEANS NEW ENTRY
GetAllUserRecords();
function GetAllUserRecords() {
debugger;
var promiseGet = userService.GetUserRecords();
promiseGet.then(function (p1) { $scope.User = p1.data }, function (err) {
console.log("Error");
});
}
$scope.submit = function () {
debugger;
var user = {
FirstName: $scope.FirstName,
LastName: $scope.LastName,
Email: $scope.Email,
Password: $scope.Password,
Phone: $scope.Phone,
Postcode: $scope.Postcode,
Address: $scope.Address,
Street: $scope.Street,
Town: $scope.Town,
CreateDate: new Date()
};
if ($scope.OperType === 1) {
var promisePost = userService.AddUser(user);
promisePost.then(function (p1) {
GetAllUserRecords();
alert("New Record Inserted");
$("#addUserTable").css('display', 'none');
clearClientDetail();
}, function (err) {
console.log("Error");
});
}
}
function clearClientDetail() {
$("#FirstName").val('');
$("#LastName").val('');
$("#Email").val('');
$("#Password").val('');
$("#Phone").val('');
$("#Postcode").val('');
$("#Address").val('');
$("#Street").val('');
$("#Town").val('');
}
});
i am stuck over here, i google everything but i do not get any result.