Pipe argument not working
See original GitHub issueHi, I have created custom pipes for filtering data. Normal pipe and custom pipe working fine. But the issue is pipe argument not working.
My custom pipe code is:
import {Pipe} from 'angular2/core';
@Pipe({
name: 'toggl'
})
export class ToggleArgs {
transform(value,[status]) {
return value.filter((item)=>item.status === status);
}
}
My component code is
import {Component} from 'angular2/core';
import {ToggleArgs} from '../../pipes/toggle-args/toggle-args';
@Component({
selector: 'test-component',
templateUrl: 'app/components/test-component/test-component.html',
styleUrls: ['app/components/test-component/test-component.css'],
providers: [],
directives: [],
pipes: [ToggleArgs]
})
export class TestComponent {
list;
constructor() {
this.list = [{"title": "eat", "status": "WIP"},{"title": "code", "status": "WIP"},{"title": "sleep", "status": "WIP"}]
}
}
html code:
<li *ngFor="#item of list | toggl:'completed'">{{item.title}} and {{item.status}}</li>
Output:
Build error
[DiffingTSCompiler]: Typescript found the following errors: app/pipes/toggle-args/toggle-args.spec.ts (22, 14): Supplied parameters do not match any signature of call target.
Same code I have tried as per the quickstart guide (https://angular.io/docs/ts/latest/quickstart.html) it was working fine. Please solve this issue.
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
The @component in pipes not working angular2
Argument of type '{ selector: string; templateUrl: string; pipes: typeof MattDamon[]; }' is not assignable to parameter of type 'Component'.
Read more >Pipes and command line arguments not wor - C++ Forum
HI guys. Wrote an extremely simple program that displays the command line arguments a user types. It works all well and good when...
Read more >Why Command Substitiution Works And Pipeline Not [duplicate]
It is clearly specified that basename takes command line arguments for it's input. Hence pipe will not work.
Read more >Piping into results of another pipe not working as expected
I am a newbie in bash programming and was playing around with some commands trying to learn how passing multiple arguments using ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The error you’re getting is in the unit test for your pipe (
toggle-args.spec.ts
). You probably changed the pipe but not the test, thus breaking the test.You can either update the test, or remove it. In both scenarios your issue will be fixed.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.