Skip to content

Instantly share code, notes, and snippets.

View vstymkovskyi's full-sized avatar

Vitalii Stymkovskyi vstymkovskyi

View GitHub Profile
@vstymkovskyi
vstymkovskyi / AngularJScustomValidator.html
Created April 18, 2019 20:05 — forked from iladarsda/demo.html
Create a custom $parser and add it to the ngModel controller, which in more human translation could mean for example, adding a custom validator to the ng-model of the input.
<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
<meta charset="UTF-8">
<title>$parsers demo</title>
</head>
<body>
<form name="sampleForm">
<input name="strongSecret" type="text" ng-model="strongSecret" strong-secret required>
<dir ng-messages="sampleForm.strongSecret.$error">