I have a typescript file
a.component.ts
import { Injectable } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { HttpClient } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class DataService {
constructor(private httpCLient: HttpClient) { }
currentCode;
setCurrentCode(code){
this.currentCode = code;
}
getCurrentCode(){
return this.currentCode;
}
}
And I have a JavaScript file.
where I need to get value from the above typescript file.
Actually I need to get value from the getCurrentCode() function of above typescript and print it inside a JavaScript file.
So what I need to write inside my b.js file? how can I import the above file? Also I need to get value from the above function and write it inside my JavaScript file?