Custom directive .directive calls the directive by class name.

1. Add restrict: "C" to the .directive, and the class name on the label: is the name of the directive. For example: the name of the directive is nameDir, and the class name is name-dir

2. Call the instruction through the comment.

html:<!-- directive: name-dir-->

The name of the directive is nameDir

restrict : "M",

replace : true

3. Both element and attribute names can be used.

Note: The restrict value can be the following:
E ​​as the element name,
A as the attribute
, C as the class name,
M as the annotation
, and restrict The default value is EA, that is, the instruction can be called by the element name and attribute name.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324969509&siteId=291194637