Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function () {
- var app = angular.module('taskManager', []);
- //var store = this;
- //store.products = [];
- //$http.get('/products.json').success(function (data) {
- // store.products = data;
- //});
- app.controller('TaskManagerController', ['$http',function($http) {
- //this.task = tasks;
- this.newTask = {};
- var manager = this;
- manager.task = [];
- $http.get('http://127.0.0.1:8081/tasks.json').success(function (data) {
- manager.task = data;
- });
- this.addNewTask = function ()
- {
- tasks.push(this.newTask);
- this.newTask = {};
- };
- }]);
- app.controller('PanelController', function () {
- this.tab = 1;
- this.selectTab = function (setTab) {
- this.tab = setTab;
- };
- this.isSelected = function (checkTab) {
- return this.tab === checkTab;
- };
- });
- app.directive('taskDescription', function () {
- return {
- restrict: 'E', //element czyli tag, dyrektywa
- templateUrl: 'task-description.html'
- };
- });
- var tasks = [
- {
- name: 'feed dog',
- time: '1388123412323',
- description: ' Fido is hungry',
- done: false,
- disabled: false
- },
- {
- name: 'do dishes',
- time: '1389123412323',
- description: '. . .',
- done: false,
- disabled: false
- }
- ];
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement