NullInjectorError: No provider for InjectionToken IgxDropDownBaseToken!
New DiscussionHere’s what I’m trying to do:
I’m using Angular 12.
I’m wrapping all of the ignite components in my custom wrappers with custom @Input() and @Output().
I reached the part where I want to wrap IgxDropDownComponent and IgxDropDownItemComponent into my own wrappers, respectively called <supy-dropdown> and <supy-dropdown-item>.
I am then exporting those 2 components in `DropdownModule` then reuse it in my other components.
dropdown.component.ts:
import { IgxDropDownComponent } from 'igniteui-angular';
import { Component, ViewChild } from '@angular/core';
@Component({
selector: 'supy-dropdown',
templateUrl: './dropdown.component.html',
styleUrls: ['./dropdown.component.scss'],
})
export class DropdownComponent {
@ViewChild('dropdown') dropdown: IgxDropDownComponent;
}
dropdown.component.html:
dropdown-item.component.ts:
import { ChangeDetectionStrategy, Component } from '@angular/core';
@Component({
selector: 'supy-dropdown-item',
templateUrl: './dropdown-item.component.html',
styleUrls: ['./dropdown-item.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DropdownItemComponent {}
dropdown-item.component.html:
dropdown.module.ts:
import { IgxDropDownModule, IgxToggleModule } from 'igniteui-angular';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { DropdownComponent } from './dropdown.component';
import { DropdownItemComponent } from './dropdown-item';
@NgModule({
declarations: [DropdownComponent, DropdownItemComponent],
imports: [CommonModule, IgxDropDownModule, IgxToggleModule],
exports: [DropdownComponent, DropdownItemComponent, IgxDropDownModule, IgxToggleModule],
})
export class DropdownModule {}
and finally header.component.html:
…
test
This is the error that I am receiving:

Any help would be appreciated!
Sign In
to post a reply
Replies
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Favorites
0 Replies
6 Created On
Sep 22, 2021 Last Post
5 years ago 