Skip to content

Commit fbbf6ac

Browse files
cironunescaitp
authored andcommitted
docs(compile): document $attrs.$normalize
Closes angular#10345
1 parent a1c5f2b commit fbbf6ac

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/ng/compile.js

+15-7
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,21 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
907907
};
908908

909909
Attributes.prototype = {
910+
/**
911+
* @ngdoc method
912+
* @name $compile.directive.Attributes#$normalize
913+
* @kind function
914+
*
915+
* @description
916+
* Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or
917+
* `data-`) to its normalized, camelCase form.
918+
*
919+
* Also there is special case for Moz prefix starting with upper case letter.
920+
*
921+
* For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}
922+
*
923+
* @param {string} name Name to normalize
924+
*/
910925
$normalize: directiveNormalize,
911926

912927

@@ -2485,13 +2500,6 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
24852500
var PREFIX_REGEXP = /^((?:x|data)[\:\-_])/i;
24862501
/**
24872502
* Converts all accepted directives format into proper directive name.
2488-
* All of these will become 'myDirective':
2489-
* my:Directive
2490-
* my-directive
2491-
* x-my-directive
2492-
* data-my:directive
2493-
*
2494-
* Also there is special case for Moz prefix starting with upper case letter.
24952503
* @param name Name to normalize
24962504
*/
24972505
function directiveNormalize(name) {

0 commit comments

Comments
 (0)