Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>
<script>
var app = angular.module("MyList", []);
app.controller("myCtrl", function($scope) {
$scope.products = ["javascript", "php", "angularjs"];
$scope.add_item = function () {
$scope.products.push($scope.add_list);
}
$scope.removeItem = function (x) {
$scope.products.splice(x, 1);
}
});
</script>
<div ng-app="MyList" ng-controller="myCtrl">
<ul>
<li ng-repeat="x in products">{{x}}<span ng-click="removeItem($index)" style="cursor:pointer"> x</span></li>
</ul>
<input ng-model="add_list">
<button ng-click="add_item()">Add</button>
</div>
</body>
</html>
The most helpful ANGULARJS solutions
How to get client ip address using angularjs ?ANGULARJS Click to see more ... 19.3K 2.8K