I am trying to do use the angular push function but it is not working.
I want to add strings (or objects) into an array.
I searched for basic examples here
Push only work for array .
Make your arrayText object to Array Object.
arrayText
Try Like this
JS
this.arrayText = [{ text1: 'Hello', text2: 'world', }]; this.addText = function(text) { this.arrayText.push(text); } this.form = { text1: '', text2: '' };
HTML