【发布时间】:2016-04-18 07:09:42
【问题描述】:
当我尝试调用 ng-submit - submitForm() 函数时,我无法调用该函数并且它不执行任何操作。我该如何解决?
(function () {
'use strict';
/**
* @ngdoc function
* @name app.controller:MainCtrl
* @description
* # MainCtrl
* Controller of the app
*/
angular.module('app')
.controller('MainCtrl', ['$scope', 'cordova', function ($scope, cordova) {
console.log("Hello...");
cordova.ready.then(function () {
alert('Cordova is ready');
console.log("Ready....");
});
// function to submit the form after all validation has occurred
this.submitForm = function() {
console.log("Submit form...");
// check to make sure the form is completely valid
if ($scope.userForm.$valid) {
alert('our form is amazing');
console.log("For submitted..")
}
};
}]);
})();
【问题讨论】:
标签: javascript angularjs cordova angular-controller