Tag: false direct default template directive return condition CTI Str
Replace is an optional parameter, and if this parameter is set, the value must be true because the default value is False. The default value means that the template is inserted as a child element inside the element that invokes the directive:
Such as:
<my-directive></my-directive>
. directive ("Mydirective", function () {
return {
Template: "
}
})
The result after invoking the instruction is as follows (this is the case when the default replace is false):
<my-directive>
</my-directive>
If replace is set to true:
. directive ("Mydirective", function () {
return {
Replace:true,
Template: "
}
})
Then the result of the command invocation will be:
Attention:
The Replace parameter must have a comma (,), or an error will occur.
Angularjs Optional parameters for custom directives replace