Hello, I have a problem.
It is necessary to realize that in the same input field both the tag and the message are entered, and then entered into the array as two different objects.
Here is an example where this is implemented in two fields.
var app = angular.module('testApp', []); app.controller('mainCtrl', function($scope){ $scope.todoList = [{ todoText: " " , hashtag: " " }]; $scope.todoAdd = function() { $scope.todoList.push({ hashtag: "#" + $scope.todoHashTag , todoText: $scope.todoMessage }); $scope.todoMessage = ""; $scope.todoHashTag = ""; }; }); <body ng-app="testApp" ng-controller="mainCtrl"> <h2>Test App</h2> <form ng-submit="todoAdd()"> <input id="hashTag" type="text" ng-model="todoHashTag" size="50" placeholder="Tag"> <input id="message" type="text" ng-model="todoMessage" size="50" placeholder="Message"> <input id="butGetNew" type="submit" value="Add New"> <!--add new--> </form> <br> <div ng-repeat="x in todoList"> <span ng-bind="x.hashtag"></span> <span ng-bind="x.todoText"></span> </div> </body>