小编Glo*_*opy的帖子

某些软件包(sqlite3,socket.io)的npm安装失败,Windows 7上出现错误MSB8020

当我尝试npm install socket.io在我的Windows 7机器上使用Visual Studio 2012(而不是2010)安装一些node.js软件包(特别是sqlite3和socket.io )时,我遇到了一些看起来像这样的故障:

C:\ Program Files(x86)\ MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(35,5):错误MSB8020:Visual Studio 2010的构建工具(Platform Toolset ='v100 ')无法找到.要使用v100构建工具进行构建,请单击"项目"菜单或右键单击解决方案,然后选择"更新VC++项目...".安装Visual Studio 2010以使用Visual Studio 2010构建工具进行构建.

sqlite node.js npm socket.io visual-studio-2012

46
推荐指数
2
解决办法
2万
查看次数

如何在AngularJS e2e测试中检查复选框时验证?

我一直在尝试AngularJS e2e测试,并且确定是否选中了复选框.

我用端到端测试复选框输入作为样品(见端到端测试中的标签实施例).

Html代码段:

Value1: <input type="checkbox" ng-model="value1"> <br/>

控制器片段:

function Ctrl($scope) {
  $scope.value1 = true;
}
Run Code Online (Sandbox Code Playgroud)

这是我尝试过的:

1) expect(binding('value1')).toEqual('true');

只要value1在屏幕上显示,这适用于样本端到端测试{{value1}}.如果在本地测试并删除`{{value1}},绑定测试将失败.在我的大多数现实世界的例子中,我没有在屏幕上的任何地方显示复选框值.

2) expect(input('value1').val()).toEqual('true');

该值将始终默认为on与复选框是否处于已检查状态无关(取自此帖子).


注意:看来Angular E2E测试将来会被Protractor取代(参见文档)

angularjs angularjs-e2e

30
推荐指数
2
解决办法
3万
查看次数

AngularJS正则表达式路由为类似的URL加载不同的控制器和视图

我有一个类似的路由,应根据参数是否为数字加载不同的视图和控制器.例:

  • /artists/2应该ArtistsIndexController有一个观点/www/artists/index.html
  • /artists/name应该ArtistsProfileController有一个观点/www/artists/profile.html

理想情况下,我会使用类似的东西:

$routeProvider.when("/artists/:page", {
  templateUrl: "/www/artists/index.html",
  controller: "ArtistsIndexController"
});

$routeProvider.when("/artists/:name", {
  templateUrl: "/www/artists/profile.html",
  controller: "ArtistsProfileController"
});
Run Code Online (Sandbox Code Playgroud)

数字在哪里:page:name不是.

注意我看到一个相关的github问题(从这个问题中找到),但我想知道是否有解决方案或首选解决方案.

javascript routes angularjs

9
推荐指数
2
解决办法
1万
查看次数

如何使用 node-soap 为 SOAP 请求中的元素指定 xsi:type

我正在尝试使用 node-soap 包调用Create传入TriggeredSend名为 ExactTarget SOAP Web 服务的类型化对象的方法。Objects

我需要创建看起来像这样的东西(注意xsi:type="ns0:TriggeredSend"):

<SOAP-ENV:Envelope xmlns:etns="http://exacttarget.com" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:ns0="http://exacttarget.com/wsdl/partnerAPI" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header>
   </SOAP-ENV:Header>
   <ns1:Body>
      <ns0:CreateRequest>
         <ns0:Objects xsi:type="ns0:TriggeredSend">
            <ns0:TriggeredSendDefinition>
               <ns0:CustomerKey>abc</ns0:CustomerKey>
            </ns0:TriggeredSendDefinition>
         </ns0:Objects>
      </ns0:CreateRequest>
   </ns1:Body>
</SOAP-ENV:Envelope>
Run Code Online (Sandbox Code Playgroud)

通过下面的代码,我接近了:

var soap = require('soap')

soap.createClient(url, function(err, client){
    client.Create({
        Objects: {
            TriggeredSendDefinition: {
                CustomerKey: 'abc'
            }
        },
        function(err, response) {})
    });
});
Run Code Online (Sandbox Code Playgroud)

这给了我这个(没有xsi:type):

<ns0:CreateRequest>
   <ns0:Objects>
     <ns0:TriggeredSendDefinition>
        <ns0:CustomerKey>abc</ns0:CustomerKey>
     </ns0:TriggeredSendDefinition>
  </ns0:Objects>
</ns0:CreateRequest>
Run Code Online (Sandbox Code Playgroud)

如何指定元素TriggeredSend的类型Objects

soap web-services node.js exacttarget

2
推荐指数
1
解决办法
3283
查看次数