Giter Site home page Giter Site logo

Comments (17)

DynamoEffects avatar DynamoEffects commented on July 29, 2024 1

If it helps anyone, I created a quick fork of both projects so that you can use signature_pad 2.1.1:

npm uninstall --save angular2-signaturepad
npm install --save https://github.com/DynamoEffects/angular2-signaturepad

The fork of this project is basically untouched, it just points to the new signature_pad fork. The signature_pad fork on the other hand includes a bug fix to export SVGs using the correct pen colors.

These forks won't be maintained, they're just a kludge to move forward while the maintainers find an official solution. Thanks for your work on this @lathonez!

from angular2-signaturepad.

lathonez avatar lathonez commented on July 29, 2024 1

@jos1337 - please don't spam this thread. If you are trying to use @DynamoEffects repo and are having issues with it, raise issues over there.

from angular2-signaturepad.

lathonez avatar lathonez commented on July 29, 2024

I tried to do this today, as per dde7b7f and 1140138.

The breaking change (as per 2.0.0) is the removing require and adding in the import. My understanding is that if we still need to use require we should be on 1.5.3.

Unfortunately angular AOT does not seem to support compiling classes which export default. I get the following when trying to compile (as per the second diff above):

> [email protected] prepublish C:\Users\lathonez\code\angular2-signaturepad
> node ./node_modules/@angular/compiler-cli/src/main.js

Error: Error at C:/Users/lathonez/code/angular2-signaturepad/signature-pad.ts:4:37: Cannot find module 'signature_pad'.
    at check (C:\Users\lathonez\code\angular2-signaturepad\node_modules\@angular\tsc-wrapped\src\tsc.js:31:15)
    at Tsc.typeCheck (C:\Users\lathonez\code\angular2-signaturepad\node_modules\@angular\tsc-wrapped\src\tsc.js:86:9)
    at C:\Users\lathonez\code\angular2-signaturepad\node_modules\@angular\tsc-wrapped\src\main.js:33:23
    at process._tickCallback (internal/process/next_tick.js:103:7)
    at Module.runMain (module.js:607:11)
    at run (bootstrap_node.js:422:7)
    at startup (bootstrap_node.js:143:9)
    at bootstrap_node.js:537:3
Compilation failed

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "prepublish"npm ERR! node v7.6.0
npm ERR! npm  v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] prepublish: `node ./node_modules/@angular/compiler-cli/src/main.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepublish script 'node ./node_modules/@angular/compiler-cli/src/main.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular2-signaturepad package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./node_modules/@angular/compiler-cli/src/main.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular2-signaturepad
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls angular2-signaturepad
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\lathonez\code\angular2-signaturepad\npm-debug.log

See - angular/angular#11402

So, in order to be able to compile our ng2 componet, we need szimek/signature_pad to not do a default export.

For now I've reverted to 1.5.3 and raised an issue upstream: szimek/signature_pad#240

from angular2-signaturepad.

 avatar commented on July 29, 2024

@lathonez @wulfsolter Any chance this can get updated to the latest version of signature_pad? I believe they are on 2.1.1.
I would really like to use this component but I 100% need to be able to get the signature as SVG. I tried to adapt their changes that allow SVG to your project but was not successful..

So, in order to be able to compile our ng2 componet, we need szimek/signature_pad to not do a default export.

Is this still a problem?

from angular2-signaturepad.

wulfsolter avatar wulfsolter commented on July 29, 2024

There are many ways this could get updated to the latest version of signature_pad. I understand you tagged me @getusroidoug - surely that is because you wish to hire my services to do the update. Please let me know an email or phone contact and we will get in touch to discuss rate.

from angular2-signaturepad.

 avatar commented on July 29, 2024

Thanks for the offer @wulfsolter , it turns out I will be implementing my own custom component based off of the signature_pad current version.

My query was primarily to gauge if the active developers on this project have the intention of updating this repo any time soon. Thanks again.

from angular2-signaturepad.

lathonez avatar lathonez commented on July 29, 2024

@getusroidoug - this is blocked on szimek/signature_pad#240

from angular2-signaturepad.

lathonez avatar lathonez commented on July 29, 2024

@DynamoEffects this is great, thank you.

Is this (removing the default export) all that was necessary in the end to get the two to play together?

from angular2-signaturepad.

DynamoEffects avatar DynamoEffects commented on July 29, 2024

No, that wasn't enough but I didn't take the time to investigate why not. I took what worked, which is 1.5.3, and integrated the additional functions from 2.1.1 to get the SVG magic and bug fixes all wrapped in the original anonymous function. It is, by every definition, a kludge.

Have you considered integrating signature_pad into this project? It's a pretty simple, stable module.

from angular2-signaturepad.

lathonez avatar lathonez commented on July 29, 2024

Have you considered integrating signature_pad into this project? It's a pretty simple, stable module.

Using the code directly, instead of via npm? I hadn't - would rather not for obvious reasons. But if it's the only solution to move forward I would.

When I find some time I will try to figure out what's missing and PR for szimek/signature_pad#240. I guess if that PR were rejected we'd be out of options ^

from angular2-signaturepad.

jos1337 avatar jos1337 commented on July 29, 2024

@DynamoEffects this ist nice, thank you! Is your fork working with AOT?
edit:
I have been asking cause everything is working fine with ur git repo, but i get an Error building. It seems its even failing without aot.
I get:
ERROR in 1.6196aa3e0aba2b2f4b70.chunk.js from UglifyJs
Unexpected token: name (length) [1.6196aa3e0aba2b2f4b70.chunk.js:119364,7]
It seems to be an error related to babel.
edit2: switched back to this repo and my project is building again.

Any idea how to fix this?

from angular2-signaturepad.

wulfsolter avatar wulfsolter commented on July 29, 2024

Closing due to off-topic spam. Upgrade blocked upstream, will do once that is resolved.

from angular2-signaturepad.

lathonez avatar lathonez commented on July 29, 2024

Going to try to move this along this week.

POA:

If it all works I'll try to move szimek/signature_pad#240 in that direction.

from angular2-signaturepad.

lathonez avatar lathonez commented on July 29, 2024

Been on this for a while, lost count of the various ways I've tried to export it, all fail to compile with cannot find module: #30 (comment)

from angular2-signaturepad.

lathonez avatar lathonez commented on July 29, 2024

#36 (comment)

Trying this method of import (via require still)

from angular2-signaturepad.

lathonez avatar lathonez commented on July 29, 2024

Looks good, released 2.5.0, will update the demo accordingly

from angular2-signaturepad.

lathonez avatar lathonez commented on July 29, 2024

Done, all seems fine.

All the credit for the solution to @DynamoEffects - thanks a bunch,

from angular2-signaturepad.

Related Issues (20)

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.