We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Example pipe:
import { DatePipe } from '@angular/common'; import { Inject, Injectable, LOCALE_ID, Pipe, PipeTransform } from '@angular/core'; @Injectable() @Pipe({ name: 'tijdstip' }) export class TijdstipPipe extends DatePipe implements PipeTransform { constructor(@Inject(LOCALE_ID) locale: string) { super(locale); } transform(value: null | undefined): null; transform(value: null | undefined, inclusiefSeconden: boolean): null; transform(value: Date | string | number | undefined): string | null; transform(value: Date | string | number | undefined, inclusiefSeconden: boolean): string | null; transform(value: Date | string | number | null | undefined): string | null transform(value: Date | string | number | null | undefined, inclusiefSeconden?: boolean): string | null { return super.transform( value, inclusiefSeconden ? 'dd/MM/yyyy HH:mm:ss' :'dd/MM/yyyy HH:mm', undefined, 'nl-BE' ); } }
Example module:
import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { TijdstipPipe } from './tijdstip.pipe'; import { TimeagoCustomFormatter, TimeagoFormatter, TimeagoIntl, TimeagoModule } from 'ngx-timeago'; @NgModule({ declarations: [ TijdstipPipe, .... ], imports: [ CommonModule, TimeagoModule.forChild({ intl: {provide: TimeagoIntl, useClass: TimeAgoTranslation}, formatter: { provide: TimeagoFormatter, useClass: TimeagoCustomFormatter } })], exports: [ TijdstipPipe, ...., TimeagoModule ] }) export class CorePipesModule {}
Testcase:
Fails with
Error: NG0302: The pipe 'tijdstip' could not be found in the 'AuditInfoComponent' component!. Find more at https://angular.io/errors/NG0302
when running a part in the test where it should trigger the Pipe.
The html for the component contains this: <span>{{info.date | tijdstip:true}}</span>
<span>{{info.date | tijdstip:true}}</span>
import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; import { CorePipesModule } from '@nx-workspace/pipes'; import 'html-validate/jest'; ... import { MockComponent, MockModule } from 'ng-mocks'; describe('AuditInfoComponent', () => { let component: AuditInfoComponent; let spectator: Spectator<AuditInfoComponent> const createComponent = createComponentFactory({ component: AuditInfoComponent, imports: [ MockModule(CorePipesModule) ] }); beforeEach(() => { spectator = createComponent(); component = spectator.component; }); it('should create', () => { expect(component).toBeTruthy(); }); it('should contain valid html without user', () => { expect(spectator.element).toHTMLValidate(); }); ....
Originally posted by @SnakeSVx in #1427 (comment)
The text was updated successfully, but these errors were encountered:
fix(core): parsing only own declarations help-me-mom#1587
978bdbc
Merge pull request #1617 from satanTime/issues/1587
284319d
fix(core): parsing only own declarations #1587
v13.0.0-alpha.5 has been released and contains a fix for the issue. Feel free to reopen the issue or to submit a new one if you meet any problems.
Sorry, something went wrong.
v13.0.0 has been released and contains a fix for the issue. Feel free to reopen the issue or to submit a new one if you meet any problems.
satanTime
Successfully merging a pull request may close this issue.
Example pipe:
Example module:
Testcase:
Fails with
Error: NG0302: The pipe 'tijdstip' could not be found in the 'AuditInfoComponent' component!. Find more at https://angular.io/errors/NG0302
when running a part in the test where it should trigger the Pipe.
The html for the component contains this:
<span>{{info.date | tijdstip:true}}</span>
Originally posted by @SnakeSVx in #1427 (comment)
The text was updated successfully, but these errors were encountered: