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

can't used in service(angular5) #432

Open
niuwenbo opened this issue May 2, 2018 · 0 comments
Open

can't used in service(angular5) #432

niuwenbo opened this issue May 2, 2018 · 0 comments

Comments

@niuwenbo
Copy link

niuwenbo commented May 2, 2018

IMPORTANT: Please provide a sample using: http://plnkr.co/edit/lV7zsw7Yqossgs9JOfQU?p=preview

  • I'm submitting a ...
    [ ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository

  • Do you want to request a feature or report a bug?

  • What is the current behavior?

i just injuect a modal into a service refresh page throw this error..can any one has same question?

import { Injectable } from '@angular/core';
import { HttpErrorResponse } from '@angular/common/http';

import { Overlay } from 'ngx-modialog';
import { Modal } from 'ngx-modialog/plugins/bootstrap';

@Injectable()
export class ErrorLogService {
private name: String = 'ErrorLogService';

constructor(private modal: Modal) {}

}

compiler.js:19550 Uncaught Error: Provider parse errors:
Cannot instantiate cyclic dependency! ApplicationRef ("[ERROR ->]"): in NgModule AppModule in ./AppModule@-1:-1
at NgModuleProviderAnalyzer.parse (compiler.js:19550)
at NgModuleCompiler.compile (compiler.js:20139)
at JitCompiler._compileModule (compiler.js:34437)
at eval (compiler.js:34368)
at Object.then (compiler.js:474)
at JitCompiler._compileModuleAndComponents (compiler.js:34366)
at JitCompiler.compileModuleAsync (compiler.js:34260)
at CompilerImpl.compileModuleAsync (platform-browser-dynamic.js:239)
at PlatformRef.bootstrapModule (core.js:5567)
at eval (main.ts:11)

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
    https://plnkr.co or similar (you can use one of the templates above as a starting point).

  • What is the expected behavior?

  • What is the motivation / use case for changing the behavior?

  • Please tell us about your environment:

  • Angular version: ?
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
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

1 participant