Skip to content
New issue

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

Expression to negate has()? #62

Open
Madd0g opened this issue Sep 18, 2014 · 2 comments
Open

Expression to negate has()? #62

Madd0g opened this issue Sep 18, 2014 · 2 comments

Comments

@Madd0g
Copy link

Madd0g commented Sep 18, 2014

Hey, I'm trying to filter objects that have one property, but don't have another. Is there a way to do that? Given this structure:

{
    people: [
        {
            name: "Betty",
            friend: { name: "Robert" }
        },
        {
            name: "Victoria",
            friend: { 
                name: "Chris", id: 1,
                people: [
                    {
                        friend: {
                            name: "Jon"     
                        }
                    }
                ]
            }
        },
    ]
}

I use this selector: object:has(.friend > .name) but I also want to include a condition - to get those friends that don't have an id, something like: object:has(.friend > .name):hasnot(.friend > .id) (to get objects that contain Robert and Jon, but not Chris)

Is this possible?

@AndrewIsh
Copy link

The CSS 3 :not selector has widespread support, it would be good to see support for it here.

@AndrewIsh
Copy link

Just noticed this original issue is nearly two years old, hmmm....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants