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

Modal exception in rc5 - No provider for AppComponent #910

Closed
Gillardo opened this issue Sep 1, 2016 · 3 comments
Closed

Modal exception in rc5 - No provider for AppComponent #910

Gillardo opened this issue Sep 1, 2016 · 3 comments

Comments

@Gillardo
Copy link
Contributor

Gillardo commented Sep 1, 2016

I have just updated to the latest version, which includes all the rc5 NgModule changes (thanks for this).

My code loads fine, so i believe i am including the ModalModule in the correct places, but when i try to open one, i get this exception

EXCEPTION: No provider for AppComponent!

I have included the following code in my AppComponent.ts file as stated by the docs

import {Component, ViewContainerRef} from '@angular/core';

@component({selector:'app-root'})
class AppRoot {
public constructor(viewContainerRef:ViewContainerRef) {
// You need this small hack in order to catch application root view container ref
this.viewContainerRef = viewContainerRef;
}
}

Am i missing something?

@Gillardo Gillardo changed the title Modal returning error in rc5.... Modal exception in rc5 - No provider for AppComponent Sep 1, 2016
@Martin-Luft
Copy link
Contributor

duplicate of #854 ?

@valorkin
Copy link
Member

valorkin commented Sep 2, 2016

it looks like you copied this line import { AppComponent } from './app.component'; from readme
remove it if you don't need it

@valorkin valorkin closed this as completed Sep 2, 2016
@Gillardo
Copy link
Contributor Author

Gillardo commented Sep 2, 2016

@valorkin where do you see that? Which file should i remove it in?

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

3 participants