javascript - Angularjs Material $mdDialog Controller 在特定计算机上不工作

标签 javascript angularjs angularjs-material

我有如下所示的 mdDialog

function selectAddress(addressType) {
  $mdDialog.show({
    controller: function ($scope, $mdDialog) {
      var savm = $scope;
      savm.addressType = addressType;
      savm.close = $mdDialog.hide;

      savm.foo = function () {

      };

      savm.bar = function () {

      };
    },
    template: require('../views/dialog/address-select.template.view.html'),
    parent: angular.element($window.document.body),
    clickOutsideToClose: true,
  });
}

这段代码在办公室的两台 mac 上工作,但在其他操作系统(Ubuntu 和 Windows)上不工作,它给出了这个错误:

angular.js:14940 TypeError: invokeCtrl is not a function
   at MdCompilerService.MdCompilerProvider.MdCompilerService._createController (angular-material.js:2729)
   at Object.linkFn [as link] (angular-material.js:2689)
   at linkElement (angular-material.js:4375)
   at angular-material.js:4251
   at processQueue (angular.js:17318)
   at angular.js:17366
   at Scope.$digest (angular.js:18479)
   at Scope.$apply (angular.js:18867)
   at HTMLButtonElement.<anonymous> (angular.js:28028)
   at defaultHandlerWrapper (angular.js:3795)

这些计算机中的所有软件包版本都相同:

angularjs: 1.7.0,

Angular Material :1.1.9,

chrome:版本 67.0.3396.99(官方构建)(64 位)

这个问题的解决方案是什么。

PS:不要拘泥于“要求”。我们使用 WebPack。

最佳答案

正如@mvermand 所说,这是 angularjs 中的一个错误,已在 1.7.2 中解决。升级你的 angularjs。

关于javascript - Angularjs Material $mdDialog Controller 在特定计算机上不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51264111/

相关文章:

javascript - AngularJS Json 列表

javascript - Angular 模型失去了 ng-included 在指令中的范围

javascript - 如何使用 Fetch API 将照片上传到 AWS S3?

javascript - 如何将我的 current_user.id 传递给 AngularJs Controller

angularjs - 如何在自动完成字段 Angular 上启用退格

angularjs - 使用 Material 使用<md-sidenav>时如何将工具提示放在右边?

javascript - 我如何将服务响应数据放入 md 对话框 angularjs?

javascript - Object.create 复制数组和对象属性的引用

javascript - 围绕 div 框轻微 float 移动

Javascript/HTML 赋值