Skip to content
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

How to use it in angular? #9

Open
cristianrc opened this issue Nov 8, 2019 · 2 comments
Open

How to use it in angular? #9

cristianrc opened this issue Nov 8, 2019 · 2 comments
Labels
question Further information is requested

Comments

@cristianrc
Copy link

I installed it with NPM

after in my component:
import Enigma from '@cubbit/enigma';

but what is next?

@marmos91 marmos91 added the question Further information is requested label Nov 8, 2019
@marmos91
Copy link
Member

marmos91 commented Nov 8, 2019

Hi @cristianrc, could you please share more details about the nature of your issue? If you are searching for documentation, you can find a doc reference for Enigma on the README file :)
Anyway, since Enigma is written in javascript you can use it as any JS library in your code, with any kind of framework (Angular, React, Vue, etc...)

@cristianrc
Copy link
Author

cristianrc commented Nov 10, 2019

the documentation does not show how to use it in angular.

Import Enigma in my Angular Typescript file as follows:

import { Injectable } from "@angular/core";
import { HttpInterceptor, HttpEvent, HttpRequest, HttpHandler, HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import Enigma from '@cubbit/enigma';

@Injectable()
export class EncryptInterceptor implements HttpInterceptor {

    constructor()
    {
        console.log(Enigma);
    }
}

I have the next error:

ERROR in node_modules/@cubbit/enigma/index.d.ts(1,33): error TS2307: Cannot find module 'stream'.
node_modules/@cubbit/enigma/index.d.ts(10,41): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(31,43): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(31,99): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(32,50): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(32,70): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(57,41): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(66,25): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(67,26): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(73,20): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(80,31): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(81,38): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(82,41): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(82,61): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(82,80): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(83,32): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(83,41): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(91,25): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(92,26): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(111,42): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(111,62): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(111,79): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(112,36): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(112,53): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(120,19): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(135,43): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(136,35): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(136,48): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(137,22): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(138,17): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(139,19): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(142,22): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(143,17): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(144,19): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(145,21): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(146,28): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(146,68): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(147,28): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(147,42): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(147,82): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(148,23): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
node_modules/@cubbit/enigma/index.d.ts(175,64): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.

i 「wdm」: Failed to compile.

I want a guide on how to use it in Angular

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

2 participants