arbus / ng-aria Goto Github PK
View Code? Open in Web Editor NEWAngular module to added ARIA tags automatically
Angular module to added ARIA tags automatically
Please do not use the angular-reserved namespaces in your APIs. See: https://github.com/angular/angular-component-spec
Specifically, I would recommend against naming the module ngAria
, and recommend against $
-prefixed names for services.
A PR for this into angular core (as we discussed) could use these names, but it's important that 3rd party plugins don't use these names or there might be unexpected behavior for consumers of this module if this does land in core.
The ariaProvider publishes the following
var ariaFactory = function(){
return {
ariaHidden: watchClass('ng-hide', 'ariaHidden'),
ariaChecked: watchAttr('checked', 'ariaChecked', false),
ariaDisabled: watchAttr('disabled', 'ariaDisabled', false),
ariaRequired: watchAttr('required', 'ariaRequired', false),
ariaInvalid: watchClass('ng-invalid', 'ariaInvalid')
};
};
return{
enable: function(config){
if(angular.isUndefined(config)){
currentConfig = defaultConfig;
}else{
this.setConfig(config);
}
},
setConfig: function(config){
currentConfig = angular.extend(defaultConfig, config);
},
$get: ariaFactory
};
I suggest that the ariaFactory
variable is superfluous since the aria
Provider is instantiated only one time.
return {
enable: function(config){
if(angular.isUndefined(config)){
currentConfig = defaultConfig;
}else{
this.setConfig(config);
}
},
setConfig: function(config){
currentConfig = angular.extend(defaultConfig, config);
},
$get: function(){
return {
ariaHidden: watchClass('ng-hide', 'ariaHidden'),
ariaChecked: watchAttr('checked', 'ariaChecked', false),
ariaDisabled: watchAttr('disabled', 'ariaDisabled', false),
ariaRequired: watchAttr('required', 'ariaRequired', false),
ariaInvalid: watchClass('ng-invalid', 'ariaInvalid')
};
}
};
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.