Through the use of Nx, I have created multiple apps that each have their own environment with different API URLs. The Nx Workspace library includes shared services that are utilized among all apps, however, it is necessary to pass the environment-api-url when injecting the service into a component.
@Component({
standalone: true,
imports: [
ReactiveFormsModule,
FormsModule,
HttpClientModule
],
providers: [AuthenticationService],
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.css'],
})
export class LoginComponent implements OnInit {
ngOnInit() {}
}
Is it possible to pass parameters like this?
providers: [AuthenticationService<environment>]
Or is there another method to achieve this?
Any advanced suggestions are highly appreciated!