My Name Is Salman Masood , I am Computer Science &Amp; Maths Graduate from University of Karachi, Pakistan , Teaching Is My Passion and My Aim Is to Deliver All My Knowledge among Those Students Who Can'T Afford Tutors or Expensive Institute Fees. I Will Be Keep Sharing My All Knowledge and Information with You .... Remember Me in Your Prayers !
Wednesday, 5 December 2018
How to store input values in an array in Angular|| Basics of Angular JS ...
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link href="Content/bootstrap.css" rel="stylesheet" />
<link href="Content/bootstrap.min.css" rel="stylesheet" />
<script src="Scripts/angular.js"></script>
<script src="Scripts/angular.min.js"></script>
<style>
ul li{
list-style-type:none;
}
</style>
</head>
<body ng-app="myapp" ng-controller="myctrl">
<h1>To do List</h1>
<form ng-submit="todoAdd()">
<input type="text" class="form-control" placeholder="Enter name here...." ng-model="todoInput" />
<input type="submit" value="Add" class="btn btn-success" />
</form>
<input type="button" value="Delete" class="btn btn-danger" ng-click="remove()" />
<div class="form-control">
<ul ng-repeat="x in todoList">
<li>
<input type="checkbox" ng-model="x.done" /> <span>{{x.todoText}}</span>
</li>
</ul>
</div>
</body>
</html>
<script>
var app = angular.module("myapp", []);
app.controller("myctrl", function ($scope)
{
$scope.todoList = [{ todoText: 'salman masood', done: false }];
$scope.todoAdd = function ()
{
$scope.todoList.push({ todoText: $scope.todoInput, done: false });
$scope.todoInput = "";
};
$scope.remove = function ()
{
var oldList = $scope.todoList;
$scope.todoList = [];
angular.forEach(oldList, function (x)
{
if (!x.done) $scope.todoList.push(x);
});
};
});
</script>
Subscribe to:
Post Comments (Atom)
Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC
Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...
-
Load event: pictureBox3.Image = Image .FromFile( @"C:\Users\salman\Documents\Visual Studio 2013\Projects\WindowsFormsApplication3\W...
No comments:
Post a Comment