Descargar Bh Text To Html Mozilla Angular -
@Injectable({ providedIn: 'root' }) export class TextToHtmlService {
convertText() { this.html = this.textToHtmlService.textToHtml(this.text); } } If you're looking to create a Firefox extension that does this, you'd use the WebExtensions API. You could create a browser action that, when clicked, opens a popup with a textarea and a button. When the button is clicked, it converts the text and displays it in a preview area.
constructor(private textToHtmlService: TextToHtmlService) { } descargar bh text to html mozilla angular
textToHtml(text: string): string { // Conversion logic here return text.replace(/\n/g, '</p><p>'); }
ngDoInit() { this.convertText(); }
} Then use it in a component:
@Component({ selector: 'app-example', template: ` <textarea [(ngModel)]="text"></textarea> <div [innerHTML]="html"></div> ` }) export class ExampleComponent { text = ''; html = ''; } ngDoInit() { this.convertText()
// example.component.ts import { Component } from '@angular/core'; import { TextToHtmlService } from './text-to-html.service';
已有3位网友发表了看法:
那地早没啦,怀念
你现在专业登山的说?!
貌似还是校友?认识dzxr、Yejun、Phanx、fpe、Studyboy、Simonkey?认识Airbear不?
发表评论