Javascript AngularJS应用程序显示语法错误
我正在将wcf服务消费到angular js应用程序中。我正在尝试从angular js应用程序调用多个请求到wcf服务。但问题是,当我运行应用程序时,我在google chrome控制台窗口中遇到了以下错误 未捕获的语法错误:丢失)参数列表后 未捕获错误:[$injector:modulerr]$injector/modulerr? 下面是脚本代码Javascript AngularJS应用程序显示语法错误,javascript,angularjs,wcf,Javascript,Angularjs,Wcf,我正在将wcf服务消费到angular js应用程序中。我正在尝试从angular js应用程序调用多个请求到wcf服务。但问题是,当我运行应用程序时,我在google chrome控制台窗口中遇到了以下错误 未捕获的语法错误:丢失)参数列表后 未捕获错误:[$injector:modulerr]$injector/modulerr? 下面是脚本代码 ///// <reference path="../angular.min.js" /> var app = angular
///// <reference path="../angular.min.js" />
var app = angular.module("WebClientModule", [])
.controller('Web_Client_Controller', ["$scope", 'myService', function ($scope, myService) {
$scope.OperType = 1;
//1 Mean New Entry
//To Clear all input controls.
function ClearModels() {
$scope.OperType = 1;
$scope.Tittle = "";
$scope.First_Name = "";
$scope.Last_Name = "";
$scope.Gender = "";
$scope.DOB = "";
$scope.Mobile = "";
$scope.House_No = "";
$scope.Streent_Name = "";
$scope.Country = "";
$scope.Post_Code = "";
$scope.Occupation = "";
}
$scope.CeditCardApplication = function () {
var ApplicationDeatils = {
Tittle: $scope.Tittle,
First_Name: $scope.First_Name,
Last_Name: $scope.Last_Name,
Gender: $scope.Gender,
DOB: $scope.DOB,
Mobile: $scope.Mobile,
House_No: $scope.House_No,
Streent_Name: $scope.Streent_Name,
Country: $scope.Country,
Post_Code: $scope.Post_Code,
Occupation: $scope.Occupation
};
myService.ApplicationDeatilsCheck(ApplicationDeatils).then(function (pl) {
console.log(pl.data)
if (pl.data) {
$scope.msg = "User information is correct !"
myService.ApplicationCreditScoreCheck(ApplicationDeatils1).then(function (p2) {
console.log(p2.data)
if (p2.data) {
$scope.msg = "We can offer you £6000";
}
else {
$scope.msg = "Application failed !";
console.log("Some error Occured" + err);
}
}, function (err) {
$scope.msg = "Application failed!";
console.log("Some error Occured" + err);
});
};
}
}]);
app.service("myService", function ($http) {
this.ApplicationDeatilsCheck = function (ApplicationDeatils) {
return $http.post("http://localhost:52098/HalifaxIISService.svc/CreateCurrentAccountCheck", JSON.stringify(ApplicationDeatils));
}
this.ApplicationCreditScoreCheck = function (ApplicationDeatils) {
return $http.post("http://localhost:52098/HalifaxIISService.svc/cheekCreditScore", JSON.stringify(ApplicationDeatils));
}
})
//
var app=angular.module(“WebClient模块”,[])
.controller('Web_客户端_控制器',[“$scope”,'myService',函数($scope,myService){
$scope.OperType=1;
//1是指新条目
//清除所有输入控件。
函数ClearModels(){
$scope.OperType=1;
$scope.title=“”;
$scope.First_Name=“”;
$scope.Last_Name=“”;
$scope.Gender=“”;
$scope.DOB=“”;
$scope.Mobile=“”;
$scope.House_No=“”;
$scope.Streent_Name=“”;
$scope.Country=“”;
$scope.Post_Code=“”;
$scope.occulation=“”;
}
$scope.CeditCardApplication=函数(){
变量applicationDetails={
标题:$scope.title,
First\u Name:$scope.First\u Name,
姓氏:$scope.Last_Name,
性别:$scope.Gender,
DOB:$scope.DOB,
Mobile:$scope.Mobile,
房屋号:$scope.House号,
Streent\u Name:$scope.Streent\u Name,
国家:$scope.Country,
Post_代码:$scope.Post_代码,
职业:$范围
};
applicationDetails检查(applicationDetails).then(函数(pl){
console.log(pl.data)
if(损益数据){
$scope.msg=“用户信息正确!”
applicationCreditCoreCheck(applicationDetails1)。然后(函数(p2){
console.log(p2.data)
如果(p2.数据){
$scope.msg=“我们可以为您提供6000英镑”;
}
否则{
$scope.msg=“应用程序失败!”;
console.log(“发生了一些错误”+err);
}
},函数(err){
$scope.msg=“应用程序失败!”;
console.log(“发生了一些错误”+err);
});
};
}
}]);
app.service(“myService”,函数($http){
this.applicationDetails检查=函数(applicationDetails){
返回$http.post(“http://localhost:52098/HalifaxIISService.svc/CreateCurrentAccountCheck,JSON.stringify(applicationDetails));
}
this.applicationCreditCoreCheck=函数(applicationDetails){
返回$http.post(“http://localhost:52098/HalifaxIISService.svc/cheekCreditScore,JSON.stringify(applicationDetails));
}
})
这是HTML代码
@{
Layout = null;
}
<!DOCTYPE html>
<html ng-app="WebClientModule">
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<script src="~/Scripts/angular.min.js"></script>
<script src="~/CreditCardApplicationScript/ApplicationCheck.js"></script>
</head>
<body >
<table id="tblContainer" data-ng-controller="Web_Client_Controller">
<tr>
<td></td>
</tr>
<tr>
<td>
<table style="border: solid 4px Red; padding: 2px;">
<tr>
<td></td>
<td>
<span>Tittle</span>
</td>
<td>
<input type="text" id="Tittle" data-ng-model="Tittle" required="" />
</td>
</tr>
<tr>
<td></td>
<td>
<span>Fisrt Name</span>
</td>
<td>
<input type="text" id="first_name" required data-ng-model="First_Name" require="" />
</td>
</tr>
<tr>
<td></td>
<td>
<span>Last Name</span>
</td>
<td>
<input type="text" id="last_name" data-ng-model="Last_Name" required="" />
</td>
</tr>
<tr>
<td></td>
<td>
<span>Gender</span>
</td>
<td>
<input type="text" id="gender" required data-ng-model="Gender" require="" />
</td>
</tr>
<tr>
<td></td>
<td>
<span>Date Of Brith</span>
</td>
<td>
<input type="text" id="dob" data-ng-model="DOB" required="" />
</td>
</tr>
<tr>
<td></td>
<td>
<span> Moblie/Telephone No</span>
</td>
<td>
<input type="text" id="mobile" required data-ng-model="Mobile" require="" />
</td>
</tr>
<tr>
<td></td>
<td>
<span> House No/Door No</span>
</td>
<td>
<input type="text" id="house_no" required data-ng-model="House_No" require="" />
</td>
</tr>
<tr>
<td></td>
<td>
<span> Streent Name</span>
</td>
<td>
<input type="text" id="streent_name" required data-ng-model="Streent_Name" require="" />
</td>
</tr>
<tr>
<td></td>
<td>
<span> Country</span>
</td>
<td>
<input type="text" id="country" required data-ng-model="Country" require="" />
</td>
</tr>
<tr>
<td></td>
<td>
<span> Post Code</span>
</td>
<td>
<input type="text" id="post_code" required data-ng-model="Post_Code" require="" />
</td>
</tr>
<tr>
<td></td>
<td>
<span> Occupation</span>
</td>
<td>
<input type="text" id="occupation" required data-ng-model="Occupation" require="" />
</td>
</tr>
<tr>
<td></td>
<td></td>
<td>
<input type="button" id="CeditCardApplication" value="CeditCardApplication" data-ng-click="CeditCardApplication()" />
</td>
</tr>
</table>
<div style="color: red;">{{msg}}</div>
</td>
</tr>
</table>
</body>
</html>
@{
布局=空;
}
指数
窃窃私语
第一个名字
姓
性别
英国日期
移动电话/电话号码
门牌号
街名
国
邮政编码
工作
var app = angular.module("WebClientModule", [])
.controller('Web_Client_Controller', ["$scope", 'myService', function ($scope, myService) {
$scope.OperType = 1;
//1 Mean New Entry
//To Clear all input controls.
function ClearModels() {
$scope.OperType = 1;
$scope.Tittle = "";
$scope.First_Name = "";
$scope.Last_Name = "";
$scope.Gender = "";
$scope.DOB = "";
$scope.Mobile = "";
$scope.House_No = "";
$scope.Streent_Name = "";
$scope.Country = "";
$scope.Post_Code = "";
$scope.Occupation = "";
}
$scope.CeditCardApplication = function () {
var ApplicationDeatils = {
Tittle: $scope.Tittle,
First_Name: $scope.First_Name,
Last_Name: $scope.Last_Name,
Gender: $scope.Gender,
DOB: $scope.DOB,
Mobile: $scope.Mobile,
House_No: $scope.House_No,
Streent_Name: $scope.Streent_Name,
Country: $scope.Country,
Post_Code: $scope.Post_Code,
Occupation: $scope.Occupation
};
myService.ApplicationDeatilsCheck(ApplicationDeatils).then(function (pl) {
console.log(pl.data)
if (pl.data) {
$scope.msg = "User information is correct !"
myService.ApplicationCreditScoreCheck(ApplicationDeatils1).then(function (p2) {
console.log(p2.data)
if (p2.data) {
$scope.msg = "We can offer you £6000";
} else {
$scope.msg = "Application failed !";
console.log("Some error Occured" + err);
}
}, function (err) {
$scope.msg = "Application failed!";
console.log("Some error Occured" + err);
});
};
}); // <-- missing )
} // <-- missing }
}]);
app.service("myService", function ($http) {
this.ApplicationDeatilsCheck = function (ApplicationDeatils) {
return $http.post("http://localhost:52098/HalifaxIISService.svc/CreateCurrentAccountCheck", JSON.stringify(ApplicationDeatils));
}
this.ApplicationCreditScoreCheck = function (ApplicationDeatils) {
return $http.post("http://localhost:52098/HalifaxIISService.svc/cheekCreditScore", JSON.stringify(ApplicationDeatils));
}
});