0

I'm trying to pass a simple array through an input to a component : [1,2,3,4,5]

For some reason it is not staying as an array but as a string when it passes through.

My type is @Input() data: any

1
  • 2
    It would be quite helpful if you would post the code that demonstrates how you pass the array ;-) Commented Aug 18, 2016 at 17:42

1 Answer 1

4

If you use prop="{{myArray}}" bindings the value is stringified.

Use instead

[prop]="myArray"
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you sir, I will try that when I get back

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.