javascript - Angular Material 和 meteor 的控制台错误

标签 javascript angularjs meteor material-design angular-material

我正在使用 Meteor 根据此处提供的示例构建一个简单的应用程序:

https://material.angularjs.org/latest/demo/tabs

当遵守 meteor 并安装相关软件包( Angular Material 、 Angular 、 Angular 动画等)时。

但是,我在两台具有不同安装的计算机上尝试过此操作,当编译网站时,我一直在 chrome 控制台中收到此错误(它在 meteor 控制台中没有错误)。然后,它不会在选项卡之间切换,并且每次单击都会出现错误。

我查看了这里的解决方案,但我不明白这对我有什么影响,因为我正在使用 meteor 包管理器。

https://github.com/angular/angular.js/issues/11658

    TypeError: runner.setHost is not a function
    at angular-animate.js:2686
    at Scope.$digest (angular_angular.js?hash=c17a5a9…:15961)
    at Scope.$apply (angular_angular.js?hash=c17a5a9…:16175)
    at angular_angular.js?hash=c17a5a9…:17942
    at completeOutstandingRequest (angular_angular.js?hash=c17a5a9…:5567)
    at angular_angular.js?hash=c17a5a9…:5844(anonymous function) @ angular_angular.js?hash=c17a5a9…:12535(anonymous function) @ angular_angular.js?hash=c17a5a9…:9307Scope.$digest @ angular_angular.js?hash=c17a5a9…:15963Scope.$apply @ angular_angular.js?hash=c17a5a9…:16175(anonymous function) @ angular_angular.js?hash=c17a5a9…:17942completeOutstandingRequest @ angular_angular.js?hash=c17a5a9…:5567(anonymous function) @ angular_angular.js?hash=c17a5a9…:5844
angular_angular.js?hash=c17a5a9…:12535 TypeError: animationRunner.done is not a function
    at Array.triggerAnimationStart (angular-animate.js:3075)
    at nextTick (angular-animate.js:423)
    at scheduler (angular-animate.js:393)
    at angular-animate.js:3087
    at Scope.$digest (angular_angular.js?hash=c17a5a9…:15961)
    at Scope.$apply (angular_angular.js?hash=c17a5a9…:16175)
    at angular_angular.js?hash=c17a5a9…:17942
    at completeOutstandingRequest (angular_angular.js?hash=c17a5a9…:5567)
    at angular_angular.js?hash=c17a5a9…:5844

main.html

<head>
  <title>simple</title>
</head>


<body ng-app= 'myApp'>
<div ng-cloak>
  <md-content>
    <md-tabs md-dynamic-height md-border-bottom>
      <md-tab label="one">
        <md-content class="md-padding">
          <h1 class="md-display-2">Tab One</h1>
          <p>...</p>
        </md-content>
      </md-tab>
      <md-tab label="two">
        <md-content class="md-padding">
          <h1 class="md-display-2">Tab Two</h1>
          <p>...</p>
        </md-content>
      </md-tab>
      <md-tab label="three">
        <md-content class="md-padding">
          <h1 class="md-display-2">Tab Three</h1>
          <p>...</p>
        </md-content>
      </md-tab>
    </md-tabs>
  </md-content>
</div>
</body>

main.css:

    import angular from 'angular';
import angularMeteor from 'angular-meteor';
import ngMaterial from 'angular-material';
//import ngAnimate from 'angular-animate';
//import ngAria from 'angular-aria';

var app = angular.module('myApp', ['ngMaterial']);

预先感谢您的帮助!

最佳答案

我自己也遇到过同样的麻烦。

将我的 Angular 版本从 1.48 更新到 1.5.3_1 解决了这个问题。

从命令行:

meteor update angular:angular

运行该命令还会更新依赖的 animate 和 sanitize 包。

关于javascript - Angular Material 和 meteor 的控制台错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37101456/

相关文章:

mongodb - 为什么我的更新 $set 代码会删除我的整个文档?

javascript - 将变量从 ascx 传递到 javascript 时出现问题

javascript - $scope 值更改后不刷新

javascript - 在 Meteor Method 中,为什么 this.connection.clientAddress 未定义?

javascript - 动画完成后旋转的图标会弹回

javascript - 如何将非字符串值传递给 Angular 指令?

javascript - 更新数组对象会创建一个新的空对象

javascript - 模型中的 NodeJs Express 4 异步函数似乎在完成之前返回

javascript - 为什么这个 for 循环返回字符的索引而不是整个属性?

javascript 初始化为 undefined 或 null 或 ""