I have this array called myArray in my Angular 2 component class:
@Component({
templateUrl: 'my.component.html'
})
export class MyComponent {
private myArray: Array<string>;
...
}
In my.component.html I have a single input element:
<input placeholder='write some tags' value=''>
What I want is to have the string elements of myArray inserted into the value attribute of the input element. The strings should be comma separated. Something like:
<input placeholder='write some tags' value='apple, orange, banana'>
I tried:
<input name='user-tag' placeholder='write some tags' value='*ngFor="let e of myArray"{{e}}'>
But that produced an error.
How can I do this?