0

I'm trying to create an array in AngularJS and filter it by object name but use a function to filter the array but wanted to use multiple values in one object name. This is what i currently have which I'm going for which isn't currently working.

IDEAL solution:

{
    name: 'company',
    date: 201202,
    medium: 'digital','web'
    }

Thanks for any help.

2
  • The only way to add more values is to create another object to hold the values. medium : {name:value, name:value} Commented Mar 22, 2016 at 14:34
  • Thats what i thought but thanks. Commented Mar 22, 2016 at 14:48

1 Answer 1

1

you can do this,

{
    name: 'company',
    date: 201202,
    medium: ['digital','web']
    }

use medium as an array. it's impossible to have two values for a property unless it's an array.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.