×Welcome aboard! We are happy you are here and wish you good net-raft!



Together We Can Simplify The World

the current number of solutions:  2304
 (1x)    .htaccess (1x)    AJAX (13x)    ANGULARJS (157x)    ASP (1x)    ASP.NET (4x)    BACKBONE.JS (47x)    BOOTSTRAP (12x)    C# (216x)    COFFEESCRIPT (28x)    CSS (71x)    HTML (47x)    JADE (32x)    JAVA (51x)    JAVASCRIPT (426x)    JQUERY (377x)    JQUERY MOBILE (5x)    JSON (5x)    LARAVEL (23x)    MYSQL (9x)    NODEJS (155x)    ORACLE SQL (19x)    PERL (1x)    PHP (293x)    PYTHON (9x)    REACT (61x)    RUBY (23x)    RUBY ON RAILS (1x)    SHELL (1x)    SQL (90x)    SQL SERVER (3x)    TYPESCRIPT (50x)    VB.NET (26x)    W3.CSS (6x)    W3.JS (40x)    
join us

click to create your account

listitem with remove button angularjs

(angularjs listitem remove button )

- ANGULARJS

 viewed 22

Comment:
ANGULARJS

2

<!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>

     

created: 24 days ago

The power of the user (%)

7%

Do you know a little more effective code ? Feel free to optimize ...


haven't you found what you're looking for ?
Write us your question ...
Login is not needed.


The most helpful ANGULARJS solutions
Likes Solution Technology
889 How to get client ip address using angularjs ?ANGULARJS
665 How to get city from ip address with angularjs ?ANGULARJS
354 get client country using angularjs ?ANGULARJS
306 how to fill a list from an another file in json format using angularjs ?ANGULARJS
291 get region angularjsANGULARJS
Check out all of ANGULARJS ...
The most viewed ANGULARJS solutions by country
Solution Country
How to get client ip address using angularjs ?Cinque Terre
How to get client ip address using angularjs ?Cinque Terre
How to get client ip address using angularjs ?Cinque Terre
How to get client ip address using angularjs ?Cinque Terre
How to get client ip address using angularjs ?Cinque Terre