-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
See if we can automatically inject IONIC_DIRECTIVES #6092
Comments
I don't think we should. This kind of goes against the whole import/explicit idea. |
It was something @adamdbradley mentioned adding the other day. I think it's confusing that we do it for them in |
As a beginner to Ionic 2 and Angular 2, I spent a fair amount of time wondering why my Angular component wasn't playing nice with Ionic. At first I thought it was about wrapping the whole component in an |
You could also add the directives to the PLATFORM_DIRECTIVES DI token during bootstrap. This way they would be available in all components. |
Thanks @frederikschubert, we did exactly that |
@adamdbradley I would have liked to have the auto provide sooner, i had to use something like this for // Components
import {BusyComponent, BusyCtrl, NotificatorComponent} from './components/components'
@App({
templateUrl: 'build/app.html',
providers: [
BusyCtrl,
provide(PLATFORM_DIRECTIVES, {useValue: [NotificatorComponent], multi: true})
],
directives: [BusyComponent]
}) I guess now i can just stick it inside the directives array and it will be global now, right? |
We should be able to add
IONIC_DIRECTIVES
so that users can create custom components without having to import them.The text was updated successfully, but these errors were encountered: