Facebook
From Idiotic Marmoset, 5 Years ago, written in JavaScript.
Embed
Download Paste or View Raw
Hits: 193
  1. (function () {
  2.     'use strict';
  3.     angular.module('scrumboard.demo', [])
  4.         .controller("ScrumboardController",
  5.             ['$scope', '$http', ScrumboardController]);
  6.  
  7.     function ScrumboardController($scope, $http) {
  8.         $scope.add = function (list, title) {
  9.             var card = {
  10.                 list: list.id,
  11.                 title: title
  12.             };
  13.             $http.post('/scrumboard/cards/', card)
  14.                 .then(function (response) {
  15.                     list.cards.push(response.data);
  16.                 },
  17.                 function () {
  18.                     alert('Could not create card');
  19.                 });
  20.         };
  21.  
  22.         $scope.data = [];
  23.         $http.get('/scrumboard/lists/').then(function (response) {
  24.             $scope.data = response.data;
  25.         });
  26.  
  27.     }
  28. }());