UNPKG

ngx-editor-plus

Version:

WYSIWYG Editor for Angular Applications

879 lines (765 loc) 54 kB
<!doctype html> <html class="no-js" lang=""> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>NgxEditor</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="../images/favicon.ico"> <link rel="stylesheet" href="../styles/style.css"> </head> <body> <div class="navbar navbar-default navbar-fixed-top visible-xs"> <a href="../" class="navbar-brand">NgxEditor</a> <button type="button" class="btn btn-default btn-menu fa fa-bars" id="btn-menu"></button> </div> <div class="xs-menu menu" id="mobile-menu"> <div id="book-search-input" role="search"> <input type="text" placeholder="Type to search"> </div> <nav> <ul class="list"> <li class="title"> <a href="../index.html">NgxEditor</a> </li> <li class="divider"></li> <li class="chapter"> <a data-type="chapter-link" href="../index.html"><span class="fa fa-home"></span>Getting started</a> <ul class="links"> <li class="link"> <a href="../overview.html" href="../overview.html" > <span class="fa fa-th"></span>Overview </a> </li> <li class="link"> <a href="../index.html" ><span class="fa fa-file-text-o"></span>README</a> </li> <li class="link"> <a href="../license.html" > <span class="fa fa-file-text-o"></span>LICENSE </a> </li> </ul> </li> <li class="chapter"> <a data-type="chapter-link" href="../modules.html" > <div class="menu-toggler linked" data-toggle="collapse" data-target="#xs-modules-links" > <span class="fa fa-archive"></span> <span class="link-name">Modules</span> <span class="fa fa-angle-down"></span> </div> </a> <ul class="links collapse " id="xs-modules-links" > <li class="link"> <a href="../modules/NgxEditorModule.html" >NgxEditorModule</a> </li> </ul> </li> <li class="chapter"> <div class="simple menu-toggler" data-toggle="collapse" data-target="#xs-components-links" > <span class="fa fa-cogs"></span> <span>Components</span> <span class="fa fa-angle-down"></span> </div> <ul class="links collapse " id="xs-components-links" > <li class="link"> <a href="../components/NgxEditorComponent.html" >NgxEditorComponent</a> </li> <li class="link"> <a href="../components/NgxEditorMessageComponent.html" >NgxEditorMessageComponent</a> </li> <li class="link"> <a href="../components/NgxEditorToolbarComponent.html" data-type="entity-link" class="active" >NgxEditorToolbarComponent</a> </li> <li class="link"> <a href="../components/NgxGrippieComponent.html" >NgxGrippieComponent</a> </li> </ul> </li> <li class="chapter"> <div class="simple menu-toggler" data-toggle="collapse" data-target="#xs-injectables-links" > <span class="fa fa-long-arrow-down"></span> <span>Injectables</span> <span class="fa fa-angle-down"></span> </div> <ul class="links collapse " id="xs-injectables-links" > <li class="link"> <a href="../injectables/CommandExecutorService.html" >CommandExecutorService</a> </li> <li class="link"> <a href="../injectables/MessageService.html" >MessageService</a> </li> </ul> </li> <li class="chapter"> <div class="simple menu-toggler" data-toggle="collapse" data-target="#xs-miscellaneous-links" > <span class="fa fa-cubes"></span> <span>Miscellaneous</span> <span class="fa fa-angle-down"></span> </div> <ul class="links collapse " id="xs-miscellaneous-links" > <li class="link"> <a href="../miscellaneous/functions.html" data-type="entity-link" >Functions</a> </li> <li class="link"> <a href="../miscellaneous/variables.html" data-type="entity-link" >Variables</a> </li> </ul> </li> </ul> </nav> </div> <div class="container-fluid main"> <div class="row main"> <div class="hidden-xs menu"> <nav> <ul class="list"> <li class="title"> <a href="../index.html">NgxEditor</a> </li> <li class="divider"></li> <div id="book-search-input" role="search"> <input type="text" placeholder="Type to search"> </div> <li class="chapter"> <a data-type="chapter-link" href="../index.html"><span class="fa fa-home"></span>Getting started</a> <ul class="links"> <li class="link"> <a href="../overview.html" href="../overview.html" > <span class="fa fa-th"></span>Overview </a> </li> <li class="link"> <a href="../index.html" ><span class="fa fa-file-text-o"></span>README</a> </li> <li class="link"> <a href="../license.html" > <span class="fa fa-file-text-o"></span>LICENSE </a> </li> </ul> </li> <li class="chapter"> <a data-type="chapter-link" href="../modules.html" > <div class="menu-toggler linked" data-toggle="collapse" data-target="#modules-links" > <span class="fa fa-archive"></span> <span class="link-name">Modules</span> <span class="fa fa-angle-down"></span> </div> </a> <ul class="links collapse " id="modules-links" > <li class="link"> <a href="../modules/NgxEditorModule.html" >NgxEditorModule</a> </li> </ul> </li> <li class="chapter"> <div class="simple menu-toggler" data-toggle="collapse" data-target="#components-links" > <span class="fa fa-cogs"></span> <span>Components</span> <span class="fa fa-angle-down"></span> </div> <ul class="links collapse " id="components-links" > <li class="link"> <a href="../components/NgxEditorComponent.html" >NgxEditorComponent</a> </li> <li class="link"> <a href="../components/NgxEditorMessageComponent.html" >NgxEditorMessageComponent</a> </li> <li class="link"> <a href="../components/NgxEditorToolbarComponent.html" data-type="entity-link" class="active" >NgxEditorToolbarComponent</a> </li> <li class="link"> <a href="../components/NgxGrippieComponent.html" >NgxGrippieComponent</a> </li> </ul> </li> <li class="chapter"> <div class="simple menu-toggler" data-toggle="collapse" data-target="#injectables-links" > <span class="fa fa-long-arrow-down"></span> <span>Injectables</span> <span class="fa fa-angle-down"></span> </div> <ul class="links collapse " id="injectables-links" > <li class="link"> <a href="../injectables/CommandExecutorService.html" >CommandExecutorService</a> </li> <li class="link"> <a href="../injectables/MessageService.html" >MessageService</a> </li> </ul> </li> <li class="chapter"> <div class="simple menu-toggler" data-toggle="collapse" data-target="#miscellaneous-links" > <span class="fa fa-cubes"></span> <span>Miscellaneous</span> <span class="fa fa-angle-down"></span> </div> <ul class="links collapse " id="miscellaneous-links" > <li class="link"> <a href="../miscellaneous/functions.html" data-type="entity-link" >Functions</a> </li> <li class="link"> <a href="../miscellaneous/variables.html" data-type="entity-link" >Variables</a> </li> </ul> </li> </ul> </nav> </div> <div class="content component"> <div class="content-data"> <ol class="breadcrumb"> <li>Components</li> <li>NgxEditorToolbarComponent</li> </ol> <ul class="nav nav-tabs" role="tablist"> <li class="active"> <a href="#info" id="info-tab" role="tab" data-toggle="tab" data-link="info">Info</a> </li> <li> <a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a> </li> <li> <a href="#templateData" role="tab" id="templateData-tab" data-toggle="tab" data-link="template">Template</a> </li> <li> <a href="#tree" role="tab" id="tree-tab" data-toggle="tab" data-link="dom-tree">DOM Tree</a> </li> </ul> <div class="tab-content"> <div class="tab-pane fade active in" id="c-info"><p class="comment"> <h3>File</h3> </p> <p class="comment"> <code>src/app/ngx-editor/ngx-editor-toolbar/ngx-editor-toolbar.component.ts</code> </p> <section> <h3>Metadata</h3> <table class="table table-sm table-hover"> <tbody> <tr> <td class="col-md-3">selector</td> <td class="col-md-9"><code>app-ngx-editor-toolbar</code></td> </tr> <tr> <td class="col-md-3">styleUrls</td> <td class="col-md-9"><code>ngx-editor-toolbar.component.scss</code></td> </tr> <tr> <td class="col-md-3">templateUrl</td> <td class="col-md-9"><code>./ngx-editor-toolbar.component.html</code></td> </tr> </tbody> </table> </section> <section> <h3 id="index">Index</h3> <table class="table table-sm table-bordered index-table"> <tbody> <tr> <td class="col-md-4"> <h6><b>Methods</b></h6> </td> </tr> <tr> <td class="col-md-4"> <ul class="index-list"> <li> <a href="#canEnableToolbarOptions">canEnableToolbarOptions</a> </li> <li> <a href="#triggerCommand">triggerCommand</a> </li> </ul> </td> </tr> <tr> <td class="col-md-4"> <h6><b>Inputs</b></h6> </td> </tr> <tr> <td class="col-md-4"> <ul class="index-list"> <li> <a href="#config">config</a> </li> <li> <a href="#enableToolbar">enableToolbar</a> </li> <li> <a href="#showToolbar">showToolbar</a> </li> </ul> </td> </tr> <tr> <td class="col-md-4"> <h6><b>Outputs</b></h6> </td> </tr> <tr> <td class="col-md-4"> <ul class="index-list"> <li> <a href="#execute">execute</a> </li> </ul> </td> </tr> </tbody> </table> </section> <section> <h3 id="constructor">Constructor</h3> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <code>constructor()</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="15" class="link-to-prism">src/app/ngx-editor/ngx-editor-toolbar/ngx-editor-toolbar.component.ts:15</a></div> </td> </tr> </tbody> </table> </section> <section> <h3 id="inputs">Inputs</h3> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-2"> <a name="config"></a> <code>config</code> </td> <td class="col-md-10"> <p> <em>Type:</em> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code> </p> </td> </tr> <tr> <td class="col-md-2" colspan="2"> <div class="io-line">Defined in <a href="" data-line="12" class="link-to-prism">src/app/ngx-editor/ngx-editor-toolbar/ngx-editor-toolbar.component.ts:12</a></div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-2"> <a name="enableToolbar"></a> <code>enableToolbar</code> </td> <td class="col-md-10"> <p> <em>Default value: </em><code>false</code> </p> </td> </tr> <tr> <td class="col-md-2" colspan="2"> <div class="io-line">Defined in <a href="" data-line="13" class="link-to-prism">src/app/ngx-editor/ngx-editor-toolbar/ngx-editor-toolbar.component.ts:13</a></div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-2"> <a name="showToolbar"></a> <code>showToolbar</code> </td> <td class="col-md-10"> <p> <em>Default value: </em><code>true</code> </p> </td> </tr> <tr> <td class="col-md-2" colspan="2"> <div class="io-line">Defined in <a href="" data-line="14" class="link-to-prism">src/app/ngx-editor/ngx-editor-toolbar/ngx-editor-toolbar.component.ts:14</a></div> </td> </tr> </tbody> </table> </section> <section> <h3 id="outputs">Outputs</h3> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-2"> <a name="execute"></a> <code>execute</code> </td> <td class="col-md-10"> <em><code>$event</code> type:</em> <code>EventEmitter&lt;string&gt;</code> </td> </tr> <tr> <td class="col-md-2" colspan="2"> <div class="io-line">Defined in <a href="" data-line="15" class="link-to-prism">src/app/ngx-editor/ngx-editor-toolbar/ngx-editor-toolbar.component.ts:15</a></div> </td> </tr> </tbody> </table> </section> <section> <h3 id="methods"> Methods </h3> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="canEnableToolbarOptions"></a> <span class="name"> <b> canEnableToolbarOptions </b> <a href="#canEnableToolbarOptions"><span class="fa fa-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <code>canEnableToolbarOptions(value: )</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="24" class="link-to-prism">src/app/ngx-editor/ngx-editor-toolbar/ngx-editor-toolbar.component.ts:24</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"><p>enable or diable toolbar based on configuration</p> </div> <div class="io-description"> <b>Parameters :</b> <table class="params"> <thead> <tr> <td>Name</td> <td>Type</td> <td>Optional</td> <td>Description</td> </tr> </thead> <tbody> <tr> <td>value</td> <td> </td> <td> </td> <td><p>toolbar buttons</p> </td> </tr> </tbody> </table> </div> <div> </div> <div class="io-description"> <b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code> </div> <div class="io-description"> </div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="triggerCommand"></a> <span class="name"> <b> triggerCommand </b> <a href="#triggerCommand"><span class="fa fa-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <code>triggerCommand(command: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="33" class="link-to-prism">src/app/ngx-editor/ngx-editor-toolbar/ngx-editor-toolbar.component.ts:33</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"><p>triggers command from the toolbar to be executed</p> </div> <div class="io-description"> <b>Parameters :</b> <table class="params"> <thead> <tr> <td>Name</td> <td>Type</td> <td>Optional</td> <td>Description</td> </tr> </thead> <tbody> <tr> <td>command</td> <td> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> </td> <td> </td> <td><p>command to be executed</p> </td> </tr> </tbody> </table> </div> <div> </div> <div class="io-description"> <b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code> </div> <div class="io-description"> </div> </td> </tr> </tbody> </table> </section> </div> <div class="tab-pane fade tab-source-code" id="c-source"> <pre class="line-numbers"><code class="language-typescript">import { Component, Input, Output, EventEmitter } from &#x27;@angular/core&#x27;; import * as Utils from &#x27;../common/utils/ngx-editor.utils&#x27;; @Component({ selector: &#x27;app-ngx-editor-toolbar&#x27;, templateUrl: &#x27;./ngx-editor-toolbar.component.html&#x27;, styleUrls: [&#x27;./ngx-editor-toolbar.component.scss&#x27;] }) export class NgxEditorToolbarComponent { @Input() config: any; @Input() enableToolbar &#x3D; false; @Input() showToolbar &#x3D; true; @Output() execute: EventEmitter&lt;string&gt; &#x3D; new EventEmitter&lt;string&gt;(); constructor() { } /** * enable or diable toolbar based on configuration * * @param value toolbar buttons */ canEnableToolbarOptions(value): boolean { return Utils.canEnableToolbarOptions(value, this.config[&#x27;toolbar&#x27;]); } /** * triggers command from the toolbar to be executed * * @param command command to be executed */ triggerCommand(command: string): void { this.execute.emit(command); } } </code></pre> </div> <div class="tab-pane fade" id="c-templateData"> <pre class="line-numbers"><code class="language-html">&lt;div class&#x3D;&quot;ngx-toolbar&quot; *ngIf&#x3D;&quot;showToolbar&quot;&gt; &lt;div class&#x3D;&quot;ngx-toolbar-set&quot;&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;bold&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;bold&#x27;)&quot; title&#x3D;&quot;Bold&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-bold&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;italic&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;italic&#x27;)&quot; title&#x3D;&quot;Italic&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-italic&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;underline&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;underline&#x27;)&quot; title&#x3D;&quot;Underline&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-underline&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;strikeThrough&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;strikeThrough&#x27;)&quot; title&#x3D;&quot;Strikethrough&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-strikethrough&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;superscript&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;superscript&#x27;)&quot; title&#x3D;&quot;Superscript&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-superscript&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;subscript&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;subscript&#x27;)&quot; title&#x3D;&quot;Subscript&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-subscript&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;/div&gt; &lt;div class&#x3D;&quot;ngx-toolbar-set&quot;&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;justifyLeft&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;justifyLeft&#x27;)&quot; title&#x3D;&quot;Justify Left&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-align-left&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;justifyCenter&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;justifyCenter&#x27;)&quot; title&#x3D;&quot;Justify Center&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-align-center&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;justifyRight&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;justifyRight&#x27;)&quot; title&#x3D;&quot;Justify Right&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-align-right&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;justifyFull&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;justifyFull&#x27;)&quot; title&#x3D;&quot;Justify&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-align-justify&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;indent&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;indent&#x27;)&quot; title&#x3D;&quot;Indent&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-indent&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;outdent&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;outdent&#x27;)&quot; title&#x3D;&quot;Outdent&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-outdent&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;/div&gt; &lt;div class&#x3D;&quot;ngx-toolbar-set&quot;&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;cut&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;cut&#x27;)&quot; title&#x3D;&quot;Cut&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-scissors&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;copy&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;copy&#x27;)&quot; title&#x3D;&quot;Copy&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-files-o&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;delete&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;delete&#x27;)&quot; title&#x3D;&quot;Delete&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-trash&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;removeFormat&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;removeFormat&#x27;)&quot; title&#x3D;&quot;Clear Formatting&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-eraser&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;undo&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;undo&#x27;)&quot; title&#x3D;&quot;Undo&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-undo&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;redo&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;redo&#x27;)&quot; title&#x3D;&quot;Redo&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-repeat&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;/div&gt; &lt;div class&#x3D;&quot;ngx-toolbar-set&quot;&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;paragraph&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;insertParagraph&#x27;)&quot; title&#x3D;&quot;Paragraph&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-paragraph&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;blockquote&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;blockquote&#x27;)&quot; title&#x3D;&quot;Blockquote&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-quote-left&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;removeBlockquote&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;removeBlockquote&#x27;)&quot; title&#x3D;&quot;Remove Blockquote&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-quote-right&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;horizontalLine&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;insertHorizontalRule&#x27;)&quot; title&#x3D;&quot;Horizontal Line&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-minus&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;orderedList&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;insertUnorderedList&#x27;)&quot; title&#x3D;&quot;Unodered List&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-list-ul&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;unorderedList&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;insertOrderedList&#x27;)&quot; title&#x3D;&quot;Ordered List&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-list-ol&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;/div&gt; &lt;div class&#x3D;&quot;ngx-toolbar-set&quot;&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;link&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;link&#x27;)&quot; title&#x3D;&quot;Insert/Edit Link&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-link&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;unlink&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;unlink&#x27;)&quot; title&#x3D;&quot;Unlink&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-chain-broken&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;button type&#x3D;&quot;button&quot; class&#x3D;&quot;ngx-editor-button&quot; *ngIf&#x3D;&quot;canEnableToolbarOptions(&#x27;image&#x27;)&quot; (click)&#x3D;&quot;triggerCommand(&#x27;image&#x27;)&quot; title&#x3D;&quot;Insert Image&quot; [disabled]&#x3D;&quot;!enableToolbar&quot;&gt; &lt;i class&#x3D;&quot;fa fa-picture-o&quot; aria-hidden&#x3D;&quot;true&quot;&gt;&lt;/i&gt; &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> </div> <div class="tab-pane fade" id="c-tree"> <div id="tree-container"></div> <div class="tree-legend"> <div class="title"> <b>Legend</b> </div> <div> <div class="color htmlelement"></div><span>Html element</span> </div> <div> <div class="color component"></div><span>Component</span> </div> <div> <div class="color directive"></div><span>Html element with directive</span> </div> </div> </div> </div> <script src="../js/libs/vis.min.js"></script> <script src="../js/libs/htmlparser.js"></script> <script src="../js/libs/deep-iterator.js"></script> <script> var COMPONENT_TEMPLATE = '<div><div class="ngx-toolbar" *ngIf="showToolbar"> <div class="ngx-toolbar-set"> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'bold\')" (click)="triggerCommand(\'bold\')" title="Bold" [disabled]="!enableToolbar"> <i class="fa fa-bold" aria-hidden="true"></i> </button> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'italic\')" (click)="triggerCommand(\'italic\')" title="Italic" [disabled]="!enableToolbar"> <i class="fa fa-italic" aria-hidden="true"></i> </button> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'underline\')" (click)="triggerCommand(\'underline\')" title="Underline" [disabled]="!enableToolbar"> <i class="fa fa-underline" aria-hidden="true"></i> </button> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'strikeThrough\')" (click)="triggerCommand(\'strikeThrough\')" title="Strikethrough" [disabled]="!enableToolbar"> <i class="fa fa-strikethrough" aria-hidden="true"></i> </button> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'superscript\')" (click)="triggerCommand(\'superscript\')" title="Superscript" [disabled]="!enableToolbar"> <i class="fa fa-superscript" aria-hidden="true"></i> </button> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'subscript\')" (click)="triggerCommand(\'subscript\')" title="Subscript" [disabled]="!enableToolbar"> <i class="fa fa-subscript" aria-hidden="true"></i> </button> </div> <div class="ngx-toolbar-set"> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'justifyLeft\')" (click)="triggerCommand(\'justifyLeft\')" title="Justify Left" [disabled]="!enableToolbar"> <i class="fa fa-align-left" aria-hidden="true"></i> </button> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'justifyCenter\')" (click)="triggerCommand(\'justifyCenter\')" title="Justify Center" [disabled]="!enableToolbar"> <i class="fa fa-align-center" aria-hidden="true"></i> </button> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'justifyRight\')" (click)="triggerCommand(\'justifyRight\')" title="Justify Right" [disabled]="!enableToolbar"> <i class="fa fa-align-right" aria-hidden="true"></i> </button> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'justifyFull\')" (click)="triggerCommand(\'justifyFull\')" title="Justify" [disabled]="!enableToolbar"> <i class="fa fa-align-justify" aria-hidden="true"></i> </button> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'indent\')" (click)="triggerCommand(\'indent\')" title="Indent" [disabled]="!enableToolbar"> <i class="fa fa-indent" aria-hidden="true"></i> </button> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'outdent\')" (click)="triggerCommand(\'outdent\')" title="Outdent" [disabled]="!enableToolbar"> <i class="fa fa-outdent" aria-hidden="true"></i> </button> </div> <div class="ngx-toolbar-set"> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'cut\')" (click)="triggerCommand(\'cut\')" title="Cut" [disabled]="!enableToolbar"> <i class="fa fa-scissors" aria-hidden="true"></i> </button> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'copy\')" (click)="triggerCommand(\'copy\')" title="Copy" [disabled]="!enableToolbar"> <i class="fa fa-files-o" aria-hidden="true"></i> </button> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'delete\')" (click)="triggerCommand(\'delete\')" title="Delete" [disabled]="!enableToolbar"> <i class="fa fa-trash" aria-hidden="true"></i> </button> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'removeFormat\')" (click)="triggerCommand(\'removeFormat\')" title="Clear Formatting" [disabled]="!enableToolbar"> <i class="fa fa-eraser" aria-hidden="true"></i> </button> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'undo\')" (click)="triggerCommand(\'undo\')" title="Undo" [disabled]="!enableToolbar"> <i class="fa fa-undo" aria-hidden="true"></i> </button> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'redo\')" (click)="triggerCommand(\'redo\')" title="Redo" [disabled]="!enableToolbar"> <i class="fa fa-repeat" aria-hidden="true"></i> </button> </div> <div class="ngx-toolbar-set"> <button type="button" class="ngx-editor-button" *ngIf="canEnableToolbarOptions(\'paragraph\')" (click)="triggerCommand(\'insertParagraph\')" title="Paragraph" [disabled]="!enableToolbar"> <i class="fa fa-paragraph