Advertisement
desdemona

a niech to dunsder...

Dec 18th, 2014
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function () {
  2.     var app = angular.module('taskManager', []);
  3.     app.controller('TaskManagerController', function () {
  4.         this.task = tasks;
  5.         this.newTask = {};
  6.  
  7.         this.addNewTask = function () {
  8.             tasks.push(this.newTask);
  9.             this.newTask = {};
  10.         };
  11.     });
  12.  
  13.     app.controller('PanelController', function () {
  14.         this.tab = 1;
  15.         this.selectTab = function (setTab) {
  16.             this.tab = setTab;
  17.         };
  18.         this.isSelected = function (checkTab) {
  19.             return this.tab === checkTab;
  20.         };
  21.     });
  22.  
  23.     app.directive('taskDescription', function () {
  24.         return {
  25.             restrict: 'E', //element czyli tag, dyrektywa
  26.             templateUrl: '~/Views/task-description.html'
  27.         };
  28.     });
  29.  
  30.  
  31.     var tasks = [
  32.         {
  33.             name: 'feed dog',
  34.             time: '1388123412323',
  35.             description: ' Fido is hungry',
  36.             done: false,
  37.             disabled: false
  38.         },
  39.  
  40.         {
  41.             name: 'do dishes',
  42.             time: '1389123412323',
  43.             description: '. . .',
  44.             done: false,
  45.             disabled: false
  46.         }
  47.     ];
  48.  
  49. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement