В настоящее время я работаю над проектом Angular 19, и мы создали библиотеку с некоторыми компонентами.
Компоненты были впервые реализованы в основном проекте, и все работало отлично, когда мы перенесли компоненты в библиотеку, мы начали получать следующую проблему: < /p>
ng203 с RuninincectionContext. Найдите больше по адресу https://angular.dev/errors/ng0203> Я попробовал несколько разных подходов, но ничего не работает. который также не сработал.
Добавлено отображение пути в TSConfig для библиотеки, которая ничего не сделала.@Component({
selector: 'arc-grid',
standalone: true,
imports: [CommonModule, AgGridAngular],
templateUrl: './arc-grid.component.html',
styleUrls: ['./arc-grid.component.css'],
})
export class ArcGridComponent implements OnChanges, OnDestroy {
//@inputs and @outputs to handle data and events
}
* Public API Surface of arc
*/
export * from './lib/grid/arc-grid.component';
export * from './lib/grid/arc-grid.types';
export * from './lib/grid/arc-grid-setup';
export * from './lib/grid/arc-grid.service';
export * from './lib/services/arc-grid-data.interface';
export * from './lib/services/arc-grid-data-service-base';
< /code>
Как я использую его в компоненте в моем основном проекте < /p>
< /code>
@Component({
imports: [CommonModule, ArcGridComponent],
selector: 'app-psgrid',
standalone: true,
templateUrl: './psgrid.component.html',
styleUrl: './psgrid.component.scss',
})
export class PSGridComponent {
// lots of code
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... wn-library