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.