Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picker used from within Angular Material dialog causes Injector error #123

Open
michael-lang opened this issue Jan 30, 2019 · 2 comments
Open

Comments

@michael-lang
Copy link

Using the time picker from a form inside of a dialog results in the dialog not opening properly (appearing empty to the side, as if it wasn't an entry component), and with the following console error.

I've tried two variations. One it using the atp-time-picker directive on the input control. The other is no directive on the control and just injecting the AmazingTimePickerService in the components constructor. Not even using the injected service still causes the exception below.

some possible related console warnings...

client:148 [WDS] Warnings while compiling.
warnings @ client:148
client:154 ./node_modules/amazing-time-picker/node_modules/@angular/core/fesm5/core.js 18261:15-36
Critical dependency: the request of a dependency is an expression
warnings @ client:154
client:154 ./node_modules/amazing-time-picker/node_modules/@angular/core/fesm5/core.js 18273:15-102
Critical dependency: the request of a dependency is an expression
warnings @ client:154

the console error

ng:///AdminModule/AdvisoryFormComponent_Host.ngfactory.js:5 
ERROR Error: StaticInjectorError(AppModule)[AmazingTimePickerService -> ComponentFactoryResolver]: 
  StaticInjectorError(Platform: core)[AmazingTimePickerService -> ComponentFactoryResolver]: 
    NullInjectorError: No provider for ComponentFactoryResolver!
    at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (core.js:3228)
    at resolveToken (core.js:3473)
    at tryResolveToken (core.js:3417)
    at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:3314)
    at resolveToken (core.js:3473)
    at tryResolveToken (core.js:3417)
    at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:3314)
    at resolveNgModuleDep (core.js:19784)
    at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (core.js:20473)
    at resolveNgModuleDep (core.js:19784)
@michael-lang
Copy link
Author

I tried to create a stackblitz to reproduce, but it works. There must be something else I am doing that complicates the solution.

Here is a simple stackblitz that works
https://stackblitz.com/edit/angular-hq4dxn

@valecj
Copy link

valecj commented Jul 12, 2019

x2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants