小编kan*_*itw的帖子

如何让JetBrains webstorm知道量角器测试规范中的`element`,`by`?

现在在我的量角器测试规范中,Webstorm抱怨所有我的element并且by是"无法解析的类型或元素"

webstorm protractor

10
推荐指数
2
解决办法
3770
查看次数

Angular"="范围不适用于camelCase

我是指令的范围属性

当我show用作attr名称时,它工作正常.

<span ng-repeat="field in fields">
  <field-pill field="field" show="true"></field-pill>
</span>
Run Code Online (Sandbox Code Playgroud)

app.js

angular.module('app',[]);

angular.module('app')
  .controller('AppCtrl', function($scope){
      $scope.fields = [1,2,3,4];
    });

angular.module('app')
  .directive('fieldPill', function () {
    return {
      template: '<div class="pill">{{field}}:{{show}}--<span ng-show="show">x</span></div>',
      restrict: 'E',
      scope:{
        field: "=",
        "show": "="
      }
    };
  });
Run Code Online (Sandbox Code Playgroud)

(请参阅此plunkr http://plnkr.co/edit/AcqmxeCerCOtGaw9dq9t?p=preview)

但是当我x-show用作属性名时,该指令根本不加载布尔数据.

<span ng-repeat="field in fields">
  <field-pill field="field" x-show="true"></field-pill>    
</span>
Run Code Online (Sandbox Code Playgroud)

app.js

angular.module('app',[]);

angular.module('app')
  .controller('AppCtrl', function($scope){
      $scope.fields = [1,2,3,4];
    });

angular.module('app')
  .directive('fieldPill', function () {
    return {
      template: '<div class="pill">{{field}}:{{xShow}}--<span ng-show="xShow">x</span></div>',
      restrict: 'E',
      scope:{
        field: …
Run Code Online (Sandbox Code Playgroud)

angularjs angularjs-directive angularjs-scope

6
推荐指数
1
解决办法
4667
查看次数

无法运行npm install browserify

我尝试npm install browserify在本地和全局运行(-g)

但我总是得到以下错误

npm ERR! peerinvalid The package bn.js does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer miller-rabin@1.1.2 wants bn.js@^0.16.0

npm ERR! System Darwin 14.0.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "browserify"
npm ERR! cwd /Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite/npm-debug.log
npm ERR! not ok code 0
Run Code Online (Sandbox Code Playgroud)

不知道如何解决它. …

install npm browserify

5
推荐指数
1
解决办法
2280
查看次数