![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
angular-validate-directive
Advanced tools
An angular directive for doing one-off custom validation.
Under the hood this directive uses the validator API introduced in angular 1.3. See NgModelController's $validators and $asyncValidators properties:
https://docs.angularjs.org/api/ng/type/ngModel.NgModelController
validate.js
on your page after angular.js
dbrans.validate
as a dependency of your app.<form name="myForm">
<input name="foo" ng-model="foo" dbrans-validate="{odd: isOdd}">
<div ng-messages="myForm.foo.$error">
<div ng-message="odd">You need to pick an odd number.</div>
</div>
</form>
angular.module('yourModule')
.controller('MyController', function($scope) {
$scope.isOdd = function(x) { return x % 2 === 1; };
});
<form name="myForm">
Choose a unique username:
<input name="username" ng-model="username"
dbrans-validate-async="{unique: isUsernameUnique}">
<div ng-messages="myForm.username.$error">
<div ng-message="unique">Sorry, that username is taken.</div>
</div>
</form>
angular.module('yourModule')
.controller('MyController', function($scope, $http, $q) {
$scope.isUsernameUnique = function(username) {
$http.get('/api/user/' + username).then(function() {
return $q.reject(); // 200 - user exists
}, function() {
return true; // 404 - user does not exist
});
};
});
FAQs
simple AngularJS validation directive
The npm package angular-validate-directive receives a total of 2 weekly downloads. As such, angular-validate-directive popularity was classified as not popular.
We found that angular-validate-directive demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.