JSFiddle - React, Tailwind, and code Playground
by angie2020
HTML
<div ng-app="app" ng-controller="passwordCheck">
<form name="signUp" novalidate>
<input type="password" name="password" ng-model="password" required>
<input type="password" name="confirmPassword" ng-model="passwordconfirm" required>
<button type="submit"> Submit</button>
</form>
<hr>
<span>Do they match?</span> {{signUp.password.$viewValue == signUp.confirmPassword.$viewValue}}
</div>
JavaScript
var app = angular.module("app", []);
console.log(app);
app.controller("passwordCheck", function($scope) {
$scope.submitForm = function() {
if ($scope.signUp.$valid && $scope.signUp.password.$viewValue == $scope.signUp.confirmPassword.$viewValue) {
alert('Its a match!');
};
};
});