angular 2
HTML
<div ng-app="App" ng-controller="testCntrl">
<ul>
<li ng-repeat="name in names">{{name}} </li>
</ul>
<form ng-submit="addName()">
<input type="text" ng-model="enteredName" />
<input type = "submit" value = " ADD" />
</div>
JavaScript
var appmodule = angular.module('App', []);
appmodule.controller("testCntrl", function ($scope) {
$scope.names = ["Ram", "shyam", "mohan"];
$scope.addName = function() { $scope.names.push($scope.enteredName);}
});