Skip to content
Permalink
Browse files

added angular aspects and logic

  • Loading branch information...
=
= committed Feb 18, 2018
1 parent 328b625 commit 0d717acd2e619e19b1cf63e61fb1f7312950163a
Showing with 37 additions and 3 deletions.
  1. +33 −3 ToDo.html
  2. +4 −0 todo.css
@@ -1,11 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" ng-app="Todo">
<head>
<title>To Do</title>
<script src="angular.js"></script>
<link rel="stylesheet" type="text/css" href="todo.css">

<script>
// Todo module
var Todo = angular.module("Todo", []);
// Create and register controller to module
Todo.controller("ToDoCtrl", function($scope){
// Creating an array holder for items
$scope.items = [
{ name: 'Sample Item'}
];
// Function to add items to array... fingers crossed X=
$scope.add = function (item){
$scope.items.push(item);
};
});
</script>
</head>
<body>

<body ng-controller="ToDoCtrl">
<h1>To Do</h1>
<ul ng-repeat="item in items">
<li>{{ item.name }}</li>
</ul>
<input type="text" ng-model="new.name"/>
<button type="button" ng-click="add(new)">Add</button>



</body>
<script src="angular.js"></script>

</html>
@@ -0,0 +1,4 @@
ul {
list-style-type: none;
padding: 0;
}

0 comments on commit 0d717ac

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.