Hi,
I working with angular material. I am opening $mdDialog in my controller js and $mdDialog uses template as:
eventApp.controller('FooterController', ['$scope', 'geoService', '$mdDialog',
function ($scope, geoService, $mdDialog) {
$scope.showLoadingMessage = function (show, message) {
$scope.popLoading = show;
$scope.LoadingMessage = message;
};
$scope.contactEvent = function (event) {
$mdDialog.show({
controller: ['$scope', '$mdDialog', '$mdConstant', 'footerService', DialogeventController],
templateUrl: 'event.tmpl.html',
parent: angular.element(document.body),
targetEvent: event,
clickOutsideToClose: true
});
};
}]);
function DialogeventController($scope, $mdDialog, $mdConstant, footerService) {
$scope.currencyVal;
$scope.showHints = true;
$scope.submitted = false;
$scope.sendTo = [];
$scope.sendContactMessageEvent = function (form) {
if ($scope[form].$valid) {
$mdDialog.hide();
var contactMessageViewModel = {
Name: $scope.cntName,
Email: $scope.cntEmail,
PhoneNo: $scope.cntPhone,
Category: $scope.cntCategory,
SubCategory: $scope.cntSubCategory,
Message: $scope.cntMessage
};
$scope.showLoadingMessage(true, "Loading");
var getMessageData = footerService.sendContactMessage(contactMessageViewModel);
getMessageData.then(function (d) {
$scope.showLoadingMessage(false, "");
}, function () {
});
} else {
$scope.submitted = true;
}
};
}
In the above I am try to show loading message on form submit in dialog. But unable to do this. It always show message undefined method '$scope.showLoadingMessage'.
Thanks