小编sjt*_*003的帖子

如何在angularjs ui-router中的状态之间共享$ scope数据?

如果不在父控制器中使用服务或构建观察者,那么如何让儿童状态访问主控制器$scope.

  .state("main", {
      controller:'mainController',
      url:"/main",
      templateUrl: "main_init.html"
  })  
  .state("main.1", {
      controller:'mainController',
      parent: 'main',
      url:"/1",
      templateUrl: 'form_1.html'
  })  
  .state("main.2", {
      controller:'mainController',
      parent: 'main',
      url: "/2",
      templateUrl: 'form_2.html'
  })  
Run Code Online (Sandbox Code Playgroud)

我无法在子状态下访问mainController范围 - 或者说我正在获取该范围的另一个实例 - 而不是我想要的.我觉得我错过了一些简单的事情.状态对象中有一个共享数据配置选项,但我不确定是否应将此类用于此类.

javascript angularjs angularjs-scope angular-ui-router

71
推荐指数
4
解决办法
9万
查看次数

是否有针对npm审核的纱线替代品?

需要固定纱线的分辨率特征,还要审核npm audit吗?有替代纱线npm audit吗?或者,交替地,将依赖的依赖关系的分辨率工作npm

security audit dependencies npm yarnpkg

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

ZFS快照如何在实践中使用空间?

  1. 创建了一个快照
  2. 删除了一个巨大的文件
  3. zfs list过去的三个快照中,Delta仍为0(快照不再使用空间)

增量或已用空间是否应该是已删除文件的大小.我知道ZFS是COW,但我很困惑为什么我不能回滚/usr/home/xxxx孩子

# ls /home/xxxxx/testing12345.txt 
/home/xxxxx/testing12345.txt
# ls -alh /home/xxxxx/testing12345.txt                                                                                                                                 
-rw-r--r--  1 root  xxxxx   254M Aug 28 00:06 /home/xxxxx/testing12345.txt
# zfs list -rt snapshot tank1/usr/home/xxxxx
NAME                                        USED  AVAIL  REFER  MOUNTPOINT
tank1/usr/home/xxxxx@myRecursiveSnapshot   291M      -   804M  -
tank1/usr/home/xxxxx@devEnv                 71K      -  1.39G  -
tank1/usr/home/xxxxx@xfce                     0      -  1.39G  -
tank1/usr/home/xxxxx@testhome                 0      -  1.39G  -
tank1/usr/home/xxxxx@testagain               1K      -  1.39G  -
tank1/usr/home/xxxxx@27082015                 0      -  1.39G  -
tank1/usr/home/xxxxx@270820150                0      -  1.39G  -
tank1/usr/home/xxxxx@2708201501               0      -  1.39G  -
# 
# 
# …
Run Code Online (Sandbox Code Playgroud)

freebsd zfs snapshot

11
推荐指数
1
解决办法
799
查看次数

在测试angular指令时,isolateScope()返回undefined

使用Angular v1.2.25和rails资产管道,我试图测试指令的隔离范围确实已经更新.由于isolateScope()返回undefined我得到预期未定义的定义...'

describe("cool directive", function() {

  beforeEach(module('necessaryModule'));

  var scope, $rootScope, $compile, elem,
    baseElement = '<div auto="mock_a" inc="mock_p" method="mock_m" reset-method="mock_r"></div>';

  beforeEach(inject(function( _$rootScope_, _$compile_, _$httpBackend_, $http){
    $compile = _$compile_;
    $rootScope = _$rootScope_;
    scope = $rootScope.$new();
    angular.extend(scope, {
      mock_a: [
        {name: "example1"},
        {name: "example2"}
      ],  
      mock_m: function(){
        return $http.get('/mockBackend', {
          params:{
            page:  scope.mockPage
          }   
        }); 
      },  
      mock_r: function() {
        scope.page = 1;
        scope.list = []; 
        load();
      },  
      mock_p: 1
    }); 
    $httpListGet = _$httpBackend_;
    $httpListGet.whenPOST('/api/something').respond({});
    $httpListGet.whenGET('/mockBackend').respond({name: "example3"});
    $httpListGet.whenGET('/mockBackend?page=1').respond({name: "example3"});
    $httpListGet.whenGET('/mockBackend?page=2').respond({name: "example4"});
  }));

    var create …
Run Code Online (Sandbox Code Playgroud)

jasmine angularjs angularjs-directive

7
推荐指数
1
解决办法
3733
查看次数

什么是elm-make:Map.!:给定键不是地图中的元素

当我用榆木0.18进行编译时elm-make: Map.!: given key is not an element in the map,我似乎无法找到任何错误List.map.

编辑:我有一个修复程序(在下面发布),但我仍然想知道这个错误的含义以及来自何处.

elm

7
推荐指数
1
解决办法
856
查看次数

如何在symfony2.X控制器中设置标头并渲染没有renderView()方法的树枝模板

如何在symfony2.X控制器中设置标题(内容类型)和渲染没有renderView()方法的树枝模板?

http-headers symfony

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

如何减少Circle CI或Travis CI上的Elm编译时间?

cm上的elm编译非常慢(circle/travis).对于一个相当小的榆树项目,我个人在圈子上的构建时间超过30米.https://github.com/elm-lang/elm-compiler/issues/1473建议"CPU计数检测是问题",并建议使用libsysconfcpus返回1个CPU代替实际检测到的数量.还有另一种方法来缓解这个漫长的编译时间吗?

cpu travis-ci elm circleci

6
推荐指数
2
解决办法
440
查看次数

Testcafe 可以看到按钮但不能点击它

在 testcafe 测试中,我如何点击一个清晰可点击的元素(t.debug()我可以点击该元素)并且不使用ClientFunctiont.eval- 在 testcafe 的 github 问题中推荐的这些“解决方法”不起作用。

一些额外的考虑:

  • 我正在测试的代码是 Angular 1.7。
  • Selector被验证为正确的(我尝试了各种类型的选择)
  • 测试咖啡厅版本 1.8.4
  • t.wait在选择之前和之后尝试了不同的时间,然后单击
  • 我试过改变元素类型(<button>to<div>等)

javascript testing automated-tests angularjs testcafe

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

Express JWT错误:socket.io初始身份验证中没有足够或太多的段

在通过令牌和用户名的初始握手期间,我抓住了这个奇怪的错误 -

    { handle: 10,
      type: 'error',
      className: 'Error',
      constructorFunction: { ref: 11 },
      protoObject: { ref: 12 },
      prototypeObject: { ref: 3 },
      properties: 
      [ { name: 'stack',
          attributes: 2,
          propertyType: 3,
          ref: 3 },
        { name: 'arguments',
          attributes: 2,
          propertyType: 1,
          ref: 3 },
        { name: 'type',
          attributes: 2,
          propertyType: 1,
          ref: 3 },
        { name: 'message',
          attributes: 2,
          propertyType: 1,
          ref: 13 } ],
        text: 'Error: Not enough or too many segments' }
Run Code Online (Sandbox Code Playgroud)

畸形的JWT?初始令牌格式错误?

javascript authentication socket.io jwt express-jwt

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

错误:[$ injector:unpr]未知提供者:$$ rAFProvider

使用Karma测试Angular获取错误:

    Error: [$injector:modulerr] Failed to instantiate module ngMock due to:
    Error: [$injector:unpr] Unknown provider: $$rAFProvider
Run Code Online (Sandbox Code Playgroud)

Angular mock,Angular版本错误?我听过详细说明角度模拟版本或角度版本更改的解决方案 - 这似乎是一个坏主意,因为我想测试与应用程序开始时相同的版本.其他人有这样的错误吗?

angularjs karma-runner angular-mock

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