【问题标题】:Angularjs Material $mdDialog Controller Not Working On Specific ComputersAngularjs Material $mdDialog 控制器在特定计算机上不起作用
【发布时间】:2018-12-18 05:36:14
【问题描述】:

我有如下图所示的 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,

角材料:1.1.9,

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

这个问题有什么解决办法。

PS:不要坚持“要求”。我们使用 WebPack。

【问题讨论】:

标签: javascript angularjs angularjs-material


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-06
    • 1970-01-01
    • 2016-07-27
    相关资源
    最近更新 更多