小编Ber*_*rdo的帖子

有没有办法在Travis CI的节点环境中使用ruby?

我遇到了问题.我必须测试在我的Travis CI中将.scss文件编译成.css的某个任务.要做到这一点,我需要在我的环境中安装ruby和sass.但是因为我正在开发一个node.js应用程序并且我正在使用节点设置,所以我不知道如何在Travis环境中包含ruby.

这是我非常简单的travis.yml

language: node_js
node_js:
  - "0.11"
  - "0.10"
script:
  'mocha test/test.js'
Run Code Online (Sandbox Code Playgroud)

提前致谢.

ruby node.js travis-ci

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

当复选框更改时,AngularFire 3向数据绑定不会更新firebase

我正在使用AngularFire模块开发一个使用Angular和Firebase的简单todo应用程序.

所以我的模型中有一个布尔属性,由模板中的复选框表示,问题是我正在尝试使用AngularFire的三路数据绑定,使用该$bind方法保持所有更改同步(firebase数据,DOM和ng) -model)但是当我选中一个复选框时,firebase数据没有更新.

这是我使用AngularFire $bind方法的控制器:

angular.module('singularPracticeApp')
  .controller('TodoCtrl', ['$scope', 'TodoService', function ($scope, todoService) {
    $scope.todos = todoService;

    $scope.todos.$bind($scope, 'todo.done');

    $scope.addTodo = function () {
      $scope.todos.$add({text: $scope.todoText, done:false});
      $scope.todoText = '';
    };

    $scope.remaining = function () {
      var count = -11;
      angular.forEach($scope.todos, function(todo){
        count += todo.done? 0 : 1;
      });
      return count;
    };

    $scope.clear = function (id) {
      $scope.todos.$remove(id);
    };
  }]);
Run Code Online (Sandbox Code Playgroud)

这是tempalte文件:

<div ng-controller="TodoCtrl">
  <h4>Task runner</h4>
  <span>{{remaining()}} todos left.</span>
  <ul>
    <li ng-repeat="(id, todo) in todos">
      <input type="checkbox" ng-model="todo.done">
      <span …
Run Code Online (Sandbox Code Playgroud)

javascript data-binding angularjs firebase angularfire

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

未能使用grunt,phantomjs和mocha设置测试环境

我正在尝试使用自耕农设置grunt,phantomjs和mocha的测试环境.问题是当运行测试任务时我得到以下警告:

Warning: PhantomJS timed out, possibly due to a missing Mocha run() call. Use --force to continue.
Run Code Online (Sandbox Code Playgroud)

但我mocha.run()在我的index.html文件中调用.这里是:

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Mocha Spec Runner</title>
    <link rel="stylesheet" href="bower_components/mocha/mocha.css">
</head>
<body>
    <div id="mocha"></div>
    <script src="bower_components/mocha/mocha.js"></script>
    <script>mocha.setup('bdd')</script>
    <script src="bower_components/chai/chai.js"></script>
    <script>
        var assert = chai.assert;
        var expect = chai.expect;
        var should = chai.should();
    </script>

    <!-- include source files here... -->

    <!-- include spec files here... -->
    <script src="spec/test.js"></script>

    <script>
      mocha.run();
    </script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

我认为我的问题在我的Gruntfile中,我一定是在遗漏一些东西.这是我的一些Gruntfile:

connect: { …
Run Code Online (Sandbox Code Playgroud)

mocha.js phantomjs gruntjs yeoman

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