Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Imports broken or not working #236

Open
@tmccurdy

Description

@tmccurdy

I used to be able to write the imports like this:

imports: [
	CommonModule,
	HttpClientModule,
	HttpClientInMemoryWebApiModule.forRoot(MockDataApi, { dataEncapsulation: false })
],

Now, since version "0.7.0", it has to be written like this, which when done, you can no longer use the "passThru" option because now the standard WebApi won't exist while "mocking=true":

imports: [
		CommonModule,
		env.useMockData ? HttpClientInMemoryWebApiModule.forRoot(MockDataApi, { dataEncapsulation: false }) : HttpClientModule,
],

If I try to do the first way above, I get this error every time:

Cannot instantiate cyclic dependency! HttpClient ("[ERROR ->]"): in NgModule AppModule in ./AppModule@-1:-1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions