var app = angular.module('plunker', ['ngMobile']);
app.controller('MainCtrl', function($scope) {
$scope.username = null;
$scope.testClick = function() {
alert('You clicked me!');
};
});
<!DOCTYPE html>
<html ng-app="plunker">
<head>
<meta charset="utf-8" />
<title>AngularJS Plunker</title>
<script>document.write('<base href="' + document.location + '" />');</script>
<link rel="stylesheet" href="style.css" />
<script data-require="angular.js@1.1.x" src="http://code.angularjs.org/1.1.5/angular.min.js" data-semver="1.1.5"></script>
<script data-require="angular-mobile.js@1.1.x" src="http://code.angularjs.org/1.1.5/angular-mobile.min.js" data-semver="1.1.5"></script>
<script src="app.js"></script>
</head>
<body ng-controller="MainCtrl">
<form name="testForm" novalidate>
<p>ngMobile directive ignores the disabled state of the button</p>
<p>Visit this page on a desktop browser and the disabled attribute of the button is respected</p>
<p>Visit this page on a mobile browser and the disabled attribute of the button is ignored</p>
<input type="text" name="username" id="username" ng-model="username" placeholder="Leave blank and click →" required />
<button ng-click="testClick()" ng-disabled="!testForm.$valid">Click Me</button>
</form>
</body>
</html>
/* Put your css in here */