Error: Cannot read property \'push\' of undefined in [null].
class A implements OnInit { stringArr: string[];
The array needs to be initialized:
stringArr = [];