Below is the code snippet for 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,
});
}
This code is functional on two mac computers in the office, but encounters issues on other operating systems (Ubuntu and Windows) with the following error:
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)
All packages have the same versions across all computers:
angularjs: 1.7.0,
angularMaterial: 1.1.9,
chrome: Version 67.0.3396.99 (Official Build) (64-bit)
What could be the solution to this problem?
PS: We are using WebPack, so do not focus solely on the 'require' statement.