The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Build a select dropdown with *ngFor in Angular 2

Build a select dropdown with *ngFor in Angular 2

4:21
This lesson walks you through building a component using ngFor on a select dropdown with options to pass in a param into the Pipe.
Watch this lesson now
Avatar
egghead.io

This lesson walks you through building a component using ngFor on a select dropdown with options to pass in a param into the Pipe.

Avatar
Sebastien Arbogast

With the latest version of everything, if I console.log() the value of status inside the Pipe at the beginning of the transport method, I get just "s" instead of "started". Was there a recent change in the way the list on inputs is passed to a pipe? Or did I do something wrong?

In reply to egghead.io
Avatar
Sebastien Arbogast

FYI, I just tested removing the destructuring and it works:

@Pipe({
    name: "started"
})  
export class StartedPipe {
    transform(value, status:string) {
        console.log(status);
        return value.filter((item)=>item.status === status);
    }
}

So it seems Angular has changed the way it sends pipe parameters.

In reply to Sebastien Arbogast
Avatar
John

Correct, custom Pipe arguments changed for the Release Candidate. I'll be updating these soon.

In reply to Sebastien Arbogast
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?