GithubHelp home page GithubHelp logo

Use in Angular? about zpl-image HOT 7 CLOSED

patrickchoi avatar patrickchoi commented on May 30, 2024
Use in Angular?

from zpl-image.

Comments (7)

metafloor avatar metafloor commented on May 30, 2024

Have you installed the package via npm install zpl-image --save so that your project dependencies are updated? I do not use angular but my understanding is that browserify or webpack will then use those dependencies to build a deployment bundle for angular.

from zpl-image.

patrickchoi avatar patrickchoi commented on May 30, 2024

I installed with npm install zpl-image --save

Used this at the top of the .ts file import * as zpl from 'zpl-image';

Getting a new error:

ERROR ReferenceError: pako is not defined
    at rgbaToZ64 (vendor.js:341223)
    at Object.imageToZ64 (vendor.js:341178)

from zpl-image.

metafloor avatar metafloor commented on May 30, 2024

I would try npm install pako --save as well.

from zpl-image.

patrickchoi avatar patrickchoi commented on May 30, 2024

No change, still pako is not defined

from zpl-image.

patrickchoi avatar patrickchoi commented on May 30, 2024

As a workaround I copied all the functions in zpl-image.js and pasted them in the .ts file. Removed function and prefixed all the function calls with this..

Not sure why zpl-image couldn't find pako but I found that import * as pako from 'pako'; works fine, and could access pako functions inside .ts.

Working perfectly, got the ZPL output.

from zpl-image.

msirghi avatar msirghi commented on May 30, 2024

@patrickchoi, do you still have an example of this?

from zpl-image.

metafloor avatar metafloor commented on May 30, 2024

If someone is willing to provide a typescript definition file for project, I will be happy to include it.

from zpl-image.

Related Issues (9)

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.