How can I accept multiple keywords from a text box and append them in a .js?

I want to accept multiple keywords from the user in a text box, each accepted with an enter key and each of these words have to be appended in the Angularjs ng-app. The purpose of this is to bind all the keywords into one single JSON string. I am able to do this for 1 keyword but am not able to expand the same logic for multiple keywords.
Please note: I don’t want to append the keywords using a button, I want this to happen when the user hits the enter key. When he hits the backspace button, it should remove the keyword from the array/list/datastructure.

I have gone through almost every, EVERY single question around this on stackoverflow and every other possible website and have tried so many options of .push(), “+”, .concat() [which of course didn’t work]. Nothing is working. I realized I want the appending to happen on enter key and not on clicking the submit button as I have 3 more such fields that will be following the same process.


<body ng-app="mainApp">
<form class="search_form">
<div ng-controller="searchController">
<div id="tags">
<input type="text" required placeholder="Hashtags go here.." onfocus="this.placeholder = ''" onblur="this.placeholder = 'Hashtags go here..'"  style="text-align: left; border-bottom: 1px solid #757575;" name="input_field" id="input_field" ng-model="input_field" class="keywordTag"/>
<div class="bar"></div>
<script src=""></script>
var mainApp = angular.module("mainApp", []);
mainApp.controller('searchController', function($scope, $http) {
$ = function(){
if($scope.input_field == null){
alert("Cannot be empty!");
else {
var scopeItem = $scope.input_field;
scopeItem = JSON.stringify({"keyword" : $scope.input_field});
var res = $'https:/something', scopeItem, {headers: {'Content-Type':'text/plain'}}).then(function success(data, status, headers, config){
$scope.message = data;
alert("Please wait while we process your hashtag!");
$scope.input_field = '';

Expected output: [“keyword” : “abc”, “def”, “ghi”]
Current output: Doesn’t accept more than 1 word
[“keyword” : “abc”]

Source: AngularJS