Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
94 views
in Technique[技术] by (71.8m points)

javascript - Does Angular have an public API for removing HTML?

I'm looking at a Pipe implementation that strips HTML from a string like this:

    const withoutHtml = str.replace(/(<([^>]+)>)/gi, '');

Just curious whether Angular CDK or Angular Core (DomSanitizer ... ?) has an API built in for doing this?

I looked at this question but no love there:

How to remove html tags from text in angular 2

question from:https://stackoverflow.com/questions/65859992/does-angular-have-an-public-api-for-removing-html

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...