$compile is a service that compiles HTML strings or DOM elements into a template, linking it with a scope. It’s often used in custom directives to add dynamic behavior to elements.
$compile
const compiledElement = $compile('<div>{{message}}</div>')($scope);