Update api-item-label.component.spec.ts
PR Checklist
Please check if your PR fulfills the following requirements:
- [ ] The commit message follows our guidelines: https://github.com/angular/angular/blob/main/CONTRIBUTING.md#commit
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
PR Type
What kind of change does this PR introduce? By using textContent, it will avoid the risk of HTML injection, as these properties automatically escape any HTML special characters in the provided text. This helps prevent cross-site scripting (XSS) vulnerabilities by treating the input as plain text rather than interpreted HTML.
textContent is More Useful Instead of Using InnerText By Using textContent over innerText enhances security by preventing potential vulnerabilities such as Cross-Site Scripting (XSS) attacks. textContent retrieves only the raw text content of an element, avoiding interpretation of HTML tags, thereby reducing the risk of malicious script injection and unintended content disclosure.
- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation content changes
- [ ] angular.io application / infrastructure changes
- [ ] Other... Please describe:
Does this PR introduce a breaking change?
- [ ] Yes
- [x] No