Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 7578744

Browse files
cironunescaitp
authored andcommitted
docs(compile): document $attrs.$normalize
Closes #10345
1 parent 14409d7 commit 7578744

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
@@ -653,6 +653,21 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
653653
};
654654

655655
Attributes.prototype = {
656+
/**
657+
* @ngdoc method
658+
* @name $compile.directive.Attributes#$normalize
659+
* @kind function
660+
*
661+
* @description
662+
* Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or
663+
* `data-`) to its normalized, camelCase form.
664+
*
665+
* Also there is special case for Moz prefix starting with upper case letter.
666+
*
667+
* For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}
668+
*
669+
* @param {string} name Name to normalize
670+
*/
656671
$normalize: directiveNormalize,
657672

658673

@@ -1986,13 +2001,6 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
19862001
var PREFIX_REGEXP = /^(x[\:\-_]|data[\:\-_])/i;
19872002
/**
19882003
* Converts all accepted directives format into proper directive name.
1989-
* All of these will become 'myDirective':
1990-
* my:Directive
1991-
* my-directive
1992-
* x-my-directive
1993-
* data-my:directive
1994-
*
1995-
* Also there is special case for Moz prefix starting with upper case letter.
19962004
* @param name Name to normalize
19972005
*/
19982006
function directiveNormalize(name) {

0 commit comments

Comments
 (0)