Good day. I study angular 2. There is an array of characters. If the character is "," you need to wait for the entered value and by pressing the enter key continue execution. How to wait for the input and return to executing the code in the same place? thank

import { Component, EventEmitter, Input, Output } from '@angular/core'; @Component({ selector: 'code_input', template: `<div class="form-group"> <h4>Input</h4> <input type="text"> <textarea class="form-control" rows="10" id="comment" (keyup)="outcode(inputCode)" [(ngModel)]="inputCode"></textarea> <h4>Output</h4> <div>{{ outputCode }}</div> </div>`, styles: [` :host { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } `], styleUrls: ['bootstrap/css/bootstrap-theme.css', 'bootstrap/css/bootstrap.css'] }) export class CodeInput { @Input() inputCode: string; outputCode: string; outcode(inputCode: string) { var acc: string[]; acc = inputCode.split(''); var cpu = new Array(30000).fill(0); var brc: number = 0; var j: number = 0; this.outputCode = ""; for (let i = 0; i < acc.length; i++) { if(acc[i] === '>') { j++; } if(acc[i] === '<') { j--; } if(acc[i] === '+') {cpu[j]++;} if(acc[i] === '-') {cpu[j]--;} if(acc[i] === '.') {this.outputCode += String.fromCharCode(cpu[j]);} if(acc[i] === ',') { //дождаться ввода нужно здесь } if(acc[i] === '[') { if(!cpu[j]) { ++brc; while(brc) { ++i; if (acc[i] == '[') {++brc;} if (acc[i] == ']') {--brc;} } }else continue; } else if(acc[i] == ']') { if(!cpu[j]) { continue; } else { if(acc[i] == ']') { brc++; } while(brc) { --i; if(acc[i] == '[') {brc--;} if(acc[i] == ']') {brc++;} } --i; } } } } } 

    0