Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <body  ng-app="toDoApp" class="container">
  <h1 class="text-center">To Do List</h1>
  <form action="" ng-controller="MainCtrl"  name="toDoForm" novalidate>
    <div class="form-group">
      <input type="text" placeholder="Enter Task" id="add-to-list" ng-model="task" class="form-control" required>
      <button class="btn add-btn" ng-click="add()" ng-disabled="toDoForm.$invalid">Add To list</button>
    </div>
    <div class="search-wrapper">
      <input type="text" ng-model="search" class="form-control search-input" placeholder="Search your list...">
    </div>
    <ul>
      <li ng-repeat="tasks in tasksList | filter:search" class="task-list" ng-class="{'checked': tasks.checked}">

        <div class="checkbox-wrapper">
          <input type="checkbox" ng-click="check($index)" class="checkbox">
          <label></label>
        </div>
        <span class="task-title">{{tasks.task}}</span>
        <button class="btn pull-right remove-btn" ng-click="remove($index)">Remove</button>
      </li>
    </ul>
  </form>
</body>
              
            
!

CSS

              
                /******** Font ********/

@import url('https://fonts.googleapis.com/css?family=Raleway');
/******** General Styles ********/
.container {
  margin-top: 40px;
  font-family: 'Raleway', sans-serif;
}
form {
  max-width: 700px;
  margin: auto;
}
h1 {
  color: #22313F;
}
ul {
  margin-top: 30px;
  padding-left: 0;
  li {
    list-style: none;
    margin-bottom: 15px;
    &:after {
      content: "";
      display: table;
      clear: both;
    }
    &.checked .task-title{
      text-decoration: line-through;
    }
    &.not-checked .task-title{
      text-decoration: none;
    }
  }
}
.form-group {
  position: relative;
}
.task-title {
  display: inline-block;
  vertical-align: middle;
}
/**** Checkbox Style ****/
.checkbox-wrapper {
  position: relative;
  display: inline-block;
}
.checkbox {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  opacity: 0;
}

label:after {
  content: "";
  width: 20px;
  height: 20px;
  position: absolute;
  top: 3px;
  left: 0;
  border: 2px solid #22313F;
  display: inline-block;
  vertical-align: middle;
  z-index: -1;
}

.checkbox:checked ~ label:before{
  content: "";
  width: 15px;
  height: 7px;
  position: absolute;
  top: 7px;
  left: 2px;
  border-bottom: 2px solid #22313F;
  border-left: 2px solid #22313F;
  -ms-transform: rotate(-45deg); /* IE 9 */
  -webkit-transform: rotate(-45deg); /* Chrome, Safari, Opera */
  transform: rotate(-45deg);
}

/**** Search input style ****/
.search-wrapper {
  position: relative;
  max-width: 300px;
}

/********* Buttons Style *********/
.btn {
  transition: 0.3s;
}
/**** Remove button ****/
.remove-btn {
  background: #E74C3C;
  border: 1px solid darken(#E74C3C, 10%);
  color: #fff;
  &:hover, &:focus {
    background: darken(#E74C3C, 10%);
    color: #fff;
  }
}

/**** Add to List Button ****/
.add-btn {
  position: absolute;
  top: 0;
  right: 0;
  background: #22313F;
  border: 1px solid darken(#22313F, 10%);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  color: #fff;
  &:hover, &:focus {
    background: darken(#22313F, 10%);
    color: #fff;
  }
}

              
            
!

JS

              
                angular.module('toDoApp', [])
  .controller('MainCtrl', ['$scope', function($scope) {
    $scope.tasksList = [{
      task: 'Read',
      checked: false
    }, {
      task: 'Listen',
      checked: false
    }];
    localStorage.setItem('tasks', $scope.tasksList.task)

    // Add Task
    $scope.add = function() {
      $scope.tasksList.push({
        task: $scope.task,
        checked: false
      });
      $scope.task = '';
    };

    // Remove Task

    $scope.remove = function(taskIndex) {
      $scope.tasksList.splice(taskIndex, 1);
    };

    // When task is done $scope.tasksList.checked is true
    // When task is not done yet $scope.tasksList.checked is false

    $scope.check = function(checkedIndex) {
            $scope.tasksList[checkedIndex].checked = !$scope.tasksList[checkedIndex].checked;

    };
    
   
   }]);
              
            
!
999px

Console