ionic2-autocomplete icon indicating copy to clipboard operation
ionic2-autocomplete copied to clipboard

No provider for CompleteTestService!

Open AhmadKassem89 opened this issue 7 years ago • 7 comments

Hello,

I've followed your instruction but i've faced some issues. I'm working on a lazy loading page, so i've imported AutoCompleteModule on my lazypage.module.ts file. Then i imported CompleteTestService on my lazypage.ts file.

I'm getting the following error:

Uncaught (in promise): Error: StaticInjectorError(AppModule)[LazyPage -> CompleteTestService]: StaticInjectorError(Platform: core)[LazyPage -> CompleteTestService]: NullInjectorError: No provider for CompleteTestService! Error: StaticInjectorError(AppModule)[LazyPage -> CompleteTestService]: StaticInjectorError(Platform: core)[LazyPage -> CompleteTestService]: NullInjectorError: No provider for CompleteTestService!

My CompleteTestService file looks like the one you provided in the instruction page.

Any help will be appreciated!

AhmadKassem89 avatar Nov 13 '18 14:11 AhmadKassem89

I've tried this on a new empty project. I got this error TypeError: Cannot read property 'getResults' of undefined

I'm working on ionic 3 btw

AhmadKassem89 avatar Nov 13 '18 14:11 AhmadKassem89

I've used another component (ng2-completer) to finish up with my application, but this need to be fixed !

AhmadKassem89 avatar Nov 14 '18 12:11 AhmadKassem89

It seems like I am having the same issue. I am getting this error:

ERROR Error: Uncaught (in promise): Error: StaticInjectorError[CompleteTestService]: StaticInjectorError[CompleteTestService]: NullInjectorError: No provider for CompleteTestService! Error: StaticInjectorError[CompleteTestService]: StaticInjectorError[CompleteTestService]: NullInjectorError: No provider for CompleteTestService!

fareshan avatar Nov 16 '18 13:11 fareshan

I'm getting this error too when ionic is ran in development mode, haven't tried production though. What seems to temporarily fix the issue is when you modify/save the provider class and ionic rebuilds the components.

karlerikounapuu avatar Nov 16 '18 15:11 karlerikounapuu

@karlerikounapuu if you mean that you found a workaround, can you explain what is it ? what do you mean by modify / save the provider ?

fareshan avatar Nov 16 '18 16:11 fareshan

I ran into the same issue. Here is how I solved it: import { CompleteTestService } from '../providers/CompleteTestService'; into your app.module.ts file. Add CompleteTestService to the providers in app.module.ts

mor-david avatar Nov 23 '18 17:11 mor-david

Since this project is not actively maintained I have fixed this issue and others in a forked repository.

Ionic4-auto-complete

jrquick17 avatar Sep 11 '19 13:09 jrquick17