How can I concatenate the commonUrl from CommonClass in Angular 6 for category.service.ts?
common-class.ts
export class CommonClass {
constructor(public commonUrl : string = 'http://localhost:3000'){};
}
category.service.ts
import { CommonClass } from '../classes/common-class';
commonUrlObj : CommonClass = new CommonClass();
saveNewCategory(formData){
return this.http.post('this.commonUrlObj.commonUrl'+''+'/saveNewCategory',formData).map((res: any) => res.json());
}
getCategoryDetails(param){
return this.http.post('this.commonUrlObj.commonUrl'+''+'getCategoryDetails',param).map((res: any) => res.json());
}