From 182152a7b4ab9b156f42bc1a8210859a5a45e885 Mon Sep 17 00:00:00 2001 From: Sibiraj Date: Fri, 9 Mar 2018 21:32:52 +0530 Subject: [PATCH] perf: remove unused imports/variables --- .../ngx-editor/common/services/command-executor.service.ts | 5 +---- .../ngx-editor-toolbar/ngx-editor-toolbar.component.ts | 2 +- src/app/ngx-editor/ngx-editor.component.html | 2 +- src/app/ngx-editor/ngx-editor.component.ts | 4 ---- src/app/ngx-editor/ngx-grippie/ngx-grippie.component.ts | 2 +- tslint.json | 1 + 6 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/app/ngx-editor/common/services/command-executor.service.ts b/src/app/ngx-editor/common/services/command-executor.service.ts index ac9bbb41..b737d982 100644 --- a/src/app/ngx-editor/common/services/command-executor.service.ts +++ b/src/app/ngx-editor/common/services/command-executor.service.ts @@ -1,8 +1,6 @@ import { Injectable } from '@angular/core'; import { HttpClient, HttpRequest } from '@angular/common/http'; -import { MessageService } from './message.service'; import * as Utils from '../utils/ngx-editor.utils'; -import { map, tap, last, catchError } from 'rxjs/operators'; @Injectable() export class CommandExecutorService { @@ -13,9 +11,8 @@ export class CommandExecutorService { /** * * @param _http HTTP Client for making http requests - * @param _messageService Message service sends message to the editor */ - constructor(private _http: HttpClient, private _messageService: MessageService) { } + constructor(private _http: HttpClient) { } /** * executes command from the toolbar diff --git a/src/app/ngx-editor/ngx-editor-toolbar/ngx-editor-toolbar.component.ts b/src/app/ngx-editor/ngx-editor-toolbar/ngx-editor-toolbar.component.ts index 817df5d5..aadc3be1 100644 --- a/src/app/ngx-editor/ngx-editor-toolbar/ngx-editor-toolbar.component.ts +++ b/src/app/ngx-editor/ngx-editor-toolbar/ngx-editor-toolbar.component.ts @@ -1,6 +1,6 @@ import { Component, Input, Output, EventEmitter, OnInit, ViewChild } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { HttpEvent, HttpEventType, HttpResponse } from '@angular/common/http'; +import { HttpResponse } from '@angular/common/http'; import { PopoverConfig } from 'ngx-bootstrap'; import { CommandExecutorService } from '../common/services/command-executor.service'; import { MessageService } from '../common/services/message.service'; diff --git a/src/app/ngx-editor/ngx-editor.component.html b/src/app/ngx-editor/ngx-editor.component.html index 0b711424..d94efd9c 100644 --- a/src/app/ngx-editor/ngx-editor.component.html +++ b/src/app/ngx-editor/ngx-editor.component.html @@ -4,7 +4,7 @@ -
+
diff --git a/src/app/ngx-editor/ngx-editor.component.ts b/src/app/ngx-editor/ngx-editor.component.ts index f18d31c2..4dffcd6d 100644 --- a/src/app/ngx-editor/ngx-editor.component.ts +++ b/src/app/ngx-editor/ngx-editor.component.ts @@ -90,7 +90,6 @@ export class NgxEditorComponent implements OnInit, ControlValueAccessor { Utils: any = Utils; codeEditorMode = false; - private lastViewModel: any = ''; private ngxCodeMirror: any = undefined; private onChange: (value: string) => void; private onTouched: () => void; @@ -239,7 +238,6 @@ export class NgxEditorComponent implements OnInit, ControlValueAccessor { return; } - /** * toggle between codeview and editor */ @@ -249,7 +247,6 @@ export class NgxEditorComponent implements OnInit, ControlValueAccessor { if (this.codeEditorMode) { this.ngxCodeMirror = CodeMirror.fromTextArea(this.codeEditor.nativeElement, codeMirrorConfig); - this._renderer.setStyle(this.textArea.nativeElement, 'display', 'none'); /** set value of the code editor */ this.ngxCodeMirror.setValue(this.textArea.nativeElement.innerHTML); @@ -261,7 +258,6 @@ export class NgxEditorComponent implements OnInit, ControlValueAccessor { /** remove/ destroy code editor */ this.ngxCodeMirror.toTextArea(); - this._renderer.setStyle(this.textArea.nativeElement, 'display', 'block'); /** update the model value and html content on the contenteditable */ this.refreshView(this.ngxCodeMirror.getValue()); diff --git a/src/app/ngx-editor/ngx-grippie/ngx-grippie.component.ts b/src/app/ngx-editor/ngx-grippie/ngx-grippie.component.ts index 84449050..104d870f 100644 --- a/src/app/ngx-editor/ngx-grippie/ngx-grippie.component.ts +++ b/src/app/ngx-editor/ngx-grippie/ngx-grippie.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, HostListener } from '@angular/core'; +import { Component, HostListener } from '@angular/core'; import { NgxEditorComponent } from '../ngx-editor.component'; @Component({ diff --git a/tslint.json b/tslint.json index 4eb1ef19..44e9e090 100644 --- a/tslint.json +++ b/tslint.json @@ -139,6 +139,7 @@ "use-host-property-decorator": true, "no-input-rename": true, "no-output-rename": true, + "no-unused-variable": true, "use-life-cycle-interface": true, "use-pipe-transform-interface": true, "component-class-suffix": true,