【发布时间】:2017-07-01 06:10:11
【问题描述】:
我是 Aurelia 框架的新手。
我想调用一个 SOAP 网络服务,并找到模块 jquery.soap (https://www.npmjs.com/package/jquery.soap) 来处理它。
我已在 aurelia.json 的依赖项中添加了该模块
..."jquery",
"jquery.soap",
{
"name": "bootstrap",
"path": "../node_modules/bootstrap/dist",
"main": "js/bootstrap.min",
"deps": ["jquery"],
"exports": "$",
"resources": [
"css/bootstrap.css"
]
},...
现在我将它导入 app.ts 并尝试像这样使用它
import $ from "jquery.soap"
export class App {
$.soap({
url: 'http://my.server.com/soapservices/',
method: 'helloWorld',
data: {
name: 'Remy Blom',
msg: 'Hi!'
},
success: function (soapResponse) {
console.log("success");
},
error: function (SOAPResponse) {
console.log("error");
}
});
}
我的问题是它找不到模块“jquery.soap”... 那么问题来了,如何正确导入“jquery.soap”模块呢? 我也对使用该模块有疑问。应该用在 app.ts 还是 app.html 中?
【问题讨论】: