I need to encrypt data sent from angular-5 to php script and decrypt it in php then process it. I am new to these stuff.
Firstly, I installed the crypto-js lib:
npm install --save crypto-js
Then I imported it into app.module.ts:
import * as crypto from 'crypto-js';
And added it to imports:
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
crypto
Inside my app.component.ts file I am trying to encrypt a variable and test the result:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app';
this.crypto...
}
I've got an error on the this.:
Unexpected token. A constructor, method, accessor, or property was expected.