Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
  <meta charset="utf-8">
  <title>Controllers for AngularJS CH/open workshop</title>
</head>
<body ng-app="tasksApp" ng-controller="TaskController">
<div>
  <input type="text" ng-model="todo"/>
</div>
<p>Hafta {{todo}}</p>
<button ng-click="addTask()">Add to tasklist</button>
<p>Till now I have to:</p>
<ul>
  <li ng-repeat="task in tasks">{{task}}</li>
</ul>
<button ng-click="clearAll()">Clear all</button>
</body>
</html>
 
angular.module('tasksApp', [])
  .controller('TaskController', function ($scope) {
    $scope.tasks = [];
    $scope.addTask = function() {
      $scope.tasks.push($scope.todo);
    };
  });
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
valotaspro
0viewers