-
-
Save lsg-vtaran/28b5b2a118c9fb6ac6020caa2a4a827e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//app.component.ts | |
import { Component} from '@angular/core'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html' | |
}) | |
export class AppComponent{ | |
//define a variable with user input | |
test = "<script>alert(1)</script><h1>test</h1>"; | |
} | |
//app.component.html | |
<div [innerHTML]="test"></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment