-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modifications for latest material design and rxjs #1
Comments
Further to the above, there is an issue regarding the final merge of the screenshotCanvas and the mergedCanvas. It might not be the prettiest solution, but I managed to get this to work using the following modification within feedback.dialog.component.ts: -
|
Hi gordonmckenzie |
@RickonChen did you manage to look into it? I'm planning to use this great module in my app using Angular 6.0. In case you didn't have the time yet and won't be able to integrate it in the latest version I'd try to implement @gordonmckenzie 's changes in a pull request. |
Hi @hakkurishian , the project is being upgraded with the newest version of angular, rxjs, etc. It should be completed before this sunday. Thanks. |
The project has been upgraded as advice of @gordonmckenzie . It could be running without issue. I will publish newest package to npm later. Thanks. |
The ng-feedback has been uploaded to npm and find no issue after testing. |
Absolutely fantastic effort RichonChen, really well done! I've been looking for something as true to Google's own version for some time and an Angular 4+ version with Angular Material is perfect!
I have made some modifications to get this working in Angular 6, rxjs version 6+ and the latest Angular Material. It seems to work really well now.
I'm new to GitHub, but these changes may be useful to others: -
import { MatDialogModule, MatButtonModule, MatIconModule, MatInputModule, MatTooltipModule, MatCheckboxModule, MatProgressSpinnerModule } from '@angular/material';
imports: [ MatDialogModule, MatButtonModule, MatIconModule, MatInputModule, MatTooltipModule, CommonModule, FormsModule, MatCheckboxModule, MatProgressSpinnerModule ]
For example in feedback.service.ts...
import { Subject } from 'rxjs';
In feedback-dialog.component.ts...
import { Observable, fromEvent, from } from 'rxjs'; import {mergeMap, map, finalize, takeUntil} from 'rxjs/operators';
and change the use of the operators to a pipe rather than chaining, as follows: -
return mouseMove.pipe( map((mouseMoveEvent: MouseEvent) => { newRectangle.width = mouseMoveEvent.clientX - mouseDownEvent.clientX; newRectangle.height = mouseMoveEvent.clientY - mouseDownEvent.clientY; return newRectangle; }), finalize(() => { this.rectangles.push(newRectangle); }), takeUntil(mouseUp));
similarly in feedback-toolbar.component.ts...
return mouseMove.pipe( map((mm: MouseEvent) => { mm.preventDefault(); return { left: mm.clientX - startX, top: mm.clientY - startY }; }), finalize(() => { this.disableToolbarTips = false; }), takeUntil(mouseUp)); }));
html2canvas(wholehtml).then(canvas => { this.screenshotCanvasSource.next(canvas); });
Once again, great effort, well done.
The text was updated successfully, but these errors were encountered: