ngOnInit() {
this.encrypted = this.enCryption(Token, data); // here this.encrypted getting null
}
public enCryption(token, data){
return this.encryptionService.set(key, data).subscribe(data=>{});
}
i want to reuse this enCryption() function and i dont want no function executed this (bottom) way
this.encryptionService.set(key, data).subscribe(data=>{
this.anotherfunction(data);
Or
this.encrypted = data
})