AAE-4879 Update tooltip card to receive custom HTML (#6930)

This commit is contained in:
Pablo Martinez Garcia
2021-04-16 10:39:19 +02:00
committed by GitHub
parent e9bf84e13c
commit 684cdb88ea
5 changed files with 34 additions and 13 deletions

View File

@@ -14,8 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component, Input } from '@angular/core';
import { Component, Input, SecurityContext } from '@angular/core';
import { animate, style, transition, trigger } from '@angular/animations';
import { DomSanitizer } from '@angular/platform-browser';
@Component({
selector: 'adf-tooltip-card-component',
@@ -37,5 +38,12 @@ import { animate, style, transition, trigger } from '@angular/animations';
export class TooltipCardComponent {
@Input() image = '';
@Input() text = '';
@Input() htmlContent = '';
@Input() width = '300';
constructor(private sanitizer: DomSanitizer) { }
sanitizedHtmlContent(): string {
return this.sanitizer.sanitize(SecurityContext.HTML, this.htmlContent);
}
}