class Slot { props = { content: String, context: Object, }; useModules = ["$compile"]; watch = { content: (newValue) => { if (newValue !== undefined) { if (/<[^>]+>/.test(newValue)) { this.parentElement.empty().append( $compile(newValue)( $scope.context ? $scope.context : $scope ) ); } else { $element.text(newValue); } } }, }; constructor() { this.parentElement = $element.parent(); } }