From 42df97216b4c7e23bafe29fbd9a2782fdeb3b314 Mon Sep 17 00:00:00 2001 From: Matt Lewis Date: Mon, 30 Aug 2021 17:04:08 +0100 Subject: [PATCH] docs(demo): remove canvas from demo --- projects/demo/app/demo.component.ts | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/projects/demo/app/demo.component.ts b/projects/demo/app/demo.component.ts index 5be6921..2dcbc8f 100644 --- a/projects/demo/app/demo.component.ts +++ b/projects/demo/app/demo.component.ts @@ -1,4 +1,4 @@ -import { AfterViewInit, Component, ElementRef, ViewChild } from '@angular/core'; +import { Component } from '@angular/core'; import { ResizeEvent } from 'angular-resizable-element'; @Component({ @@ -20,11 +20,6 @@ import { ResizeEvent } from 'angular-resizable-element'; box-sizing: border-box; // required for the enableGhostResize option to work } - canvas { - width: 150px; - height: 100px; - } - .resize-handle-top, .resize-handle-bottom { position: absolute; @@ -70,8 +65,6 @@ import { ResizeEvent } from 'angular-resizable-element'; [resizeSnapGrid]="{ left: 50, right: 50 }" (resizeEnd)="onResizeEnd($event)" > -
HTML text example
-
`, }) -export class DemoComponent implements AfterViewInit { - @ViewChild('canvas') - public canvas: ElementRef; - +export class DemoComponent { public style: object = {}; validate(event: ResizeEvent): boolean { @@ -124,19 +114,4 @@ export class DemoComponent implements AfterViewInit { height: `${event.rectangle.height}px`, }; } - - drawCanvas(): void { - const ctx = this.canvas.nativeElement.getContext('2d'); - if (ctx) { - ctx.font = '28px serif'; - ctx.fillText('Canvas text example', 50, 50); - ctx.strokeStyle = 'green'; - ctx.lineWidth = 5; - ctx.strokeRect(30, 10, 260, 60); - } - } - - ngAfterViewInit(): void { - this.drawCanvas(); - } }