Giter Club home page Giter Club logo

feedback's Introduction

ngx-md-feedback

An angular directive for sending feedback featuring Angular 6, Html2canvas, Angular Material, Rxjs, inspired by Google send feedback, based on angular-cli.

FORKED FORM https://github.com/RickonChen/feedback because the owner don't maintain this repo.

Demo

Alt text

Prerequisites

make sure your project:

For angular >= 13 see branch stable/1.0

How to use it in your project

download it from npm

npm install @digikare/ngx-md-feedback --save

use the feedback module in your project, at any module, you just need to imports into your module:

import { FeedbackModule } from '@digikare/ngx-md-feedback'

easy to use the directive, just add it in a html tag, such as:

<button feedback>feedback</button>

Properties

Name Default Value Description
title Send feedback
placeholder Describe your issue or share your ideas
editTip Click to highlight or hide info
checkboxLabel Include screenshot
cancelLabel CANCEL
sendLabel SEND
moveToolbarTip move toolbar
drawRectTip Draw using yellow to highlight issues or black to hide sensitive info
highlightTip highlight issues
hideTip hide sensitive info
editDoneLabel DONE
allowTaint FALSE Whether to allow cross-origin images to taint the canvas
descriptionRequired FALSE Field description is required for enabling 'send' button

method

send(feedback)

it is an output of the directive, the usage is:

<button
  feedback
  (send)="onSend($event)">feedback
</button>

Then you can custom the onSend method in your component. The param feedback is an object contains two properties: description and screenshot.

  • description is string to describe issues or ideas
  • screenshot comes from HTMLCanvasElement.toDataURL('image/png'), can be used as src of an img tag.

Responses

Send feedback

{
 "description" : "your content described",
 "screenshot" : "data:image/png;base64,theBase64Content",
}

Cancel feedback

{
 "error" : "dialog_canceled"
}

Getting started with this repo

Make sure you have Node version >= 12.0 and NPM >= 6

Clone/Download the repo then edit feedback library inside /src/app/feedback

# clone repo
git clone https://github.com/RickonChen/feedback.git

# change directory to our repo
cd feedback

# install the repo with npm
npm install

# start the server
npm start

# if you're in China use cnpm
# https://github.com/cnpm/cnpm

go to http://127.0.0.1:4200 or http://localhost:4200 in your browser

feedback's People

Contributors

rickonchen avatar spike008t avatar workfel avatar dgk-zartha avatar

Stargazers

Carlos Gomes Martinho avatar

Watchers

James Cloos avatar Carlos Gomes Martinho avatar

Forkers

spike008t mjtrjk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.