Passing Array of numbers via @Input

#1

Hello,
I want pass from html an array of numbers via @Input something like that

<mycomp myarray='[0, 1, 2, 3]'></mycomp>

How to do that, that I get in .ts file an array of numbers?

Thanks in advance and best regards anna-liebt.

By the way is there a doc where all things around @Input() is descriped.

#2

in your component add this

@Input() myarray:Array<number>;

don’t forget to import

import { Input } from '@angular/core';

check these links

https://angular.io/guide/component-interaction

https://angular.io/api/core/Input