I have been tasked with converting a Typescript class into an Angular 6 service:
export class TestClass {
customParam1;
customParam2;
constructor(customParam1, custom1Param2) {
this.customParam1 = customParam1;
this.customParam2 = customParam2;
}
}
This is the new service:
@Injectable({
providedIn: 'root'
})
export class TestClassService {
customParam1;
customParam2;
constructor(customParam1, custom1Param2) {
this.customParam1 = customParam1;
this.customParam2 = customParam2;
}
}
When creating the initial code block in Angular, you would use new TestClass("one", "two").
How can I set customParam1 and customParam2 when creating an instance of the TestClassService in a component?