diff --git a/MongoDBCommands b/MongoDBCommands new file mode 100644 index 000000000..1688ff14f --- /dev/null +++ b/MongoDBCommands @@ -0,0 +1,2 @@ +To List all data bases: show dbs +to select a data base: use 'dbnme' \ No newline at end of file diff --git a/README.md b/README.md index 5a83fc441..39a893d84 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,17 @@ Node provides the RESTful API. Angular provides the frontend and accesses the AP - [Node and npm](http://nodejs.org) - MongoDB: Make sure you have your own local or remote MongoDB database URI configured in `config/database.js` +- MongoDB folder if installed with Hebrew : Mongodb path : /usr/local/Cellar/mongodb/3.2.10/bin +- to Start MongoDB: mongod +- to stop MongoDB: +- to get mongo terminal : Go to MongoDB Path and enter cmd 'Mongo' ## Installation +step1: install git +step2: install npm +step3: npm install -g nodemon + 1. Clone the repository: `git clone git@github.com:scotch-io/node-todo` 2. Install the application: `npm install` 3. Place your own MongoDB URI in `config/database.js` diff --git a/Tasks_Format b/Tasks_Format new file mode 100644 index 000000000..eaf88018b --- /dev/null +++ b/Tasks_Format @@ -0,0 +1,4 @@ +A task is a unit of work. +Task can have several characterisitcs. +Task can be of several types. Task can be dependent on another task. A task can have sub tasks. +1) Defect Task: { defect id, ETA, isFrontend, iserrorinlogs, replicable, subtask: {update QC, commited code, }} \ No newline at end of file diff --git a/app/models/todo.js b/app/models/todo.js index 770f42a6f..68a6610fc 100644 --- a/app/models/todo.js +++ b/app/models/todo.js @@ -4,5 +4,9 @@ module.exports = mongoose.model('Todo', { text: { type: String, default: '' + }, + quad: { + type: String, + default: 'imp-urg' } }); \ No newline at end of file diff --git a/app/routes.js b/app/routes.js index b78dbe4fa..0c28b1b8e 100644 --- a/app/routes.js +++ b/app/routes.js @@ -26,8 +26,7 @@ module.exports = function (app) { // create a todo, information comes from AJAX request from Angular Todo.create({ - text: req.body.text, - done: false + text: req.body.text }, function (err, todo) { if (err) res.send(err); diff --git a/mongodb_tut b/mongodb_tut new file mode 100644 index 000000000..2a9ea5aa6 --- /dev/null +++ b/mongodb_tut @@ -0,0 +1,4 @@ +To get mongo terminal +go to installation folder. +if you installed with hebrew go to /usr/local/Cellar/mongodb/3.2.10/bin and type mongo +test diff --git a/package.json b/package.json index b4584b750..a1fe87eee 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "author": "Scotch", "dependencies": { "body-parser": "^1.4.3", - "express": "^4.13.4", + "express": "^4.14.0", "method-override": "^2.1.3", "mongoose": "^4.4.12", "morgan": "^1.1.1" diff --git a/public/index.html b/public/index.html index 3bb866403..545225f63 100644 --- a/public/index.html +++ b/public/index.html @@ -35,49 +35,96 @@

I'm a Todo-aholic {{ todos.length }}

- - -
-
+
+
- -
- + + +
+
+ + + + +
+ +
+ +

+ +

+ +
+
+ +
+
+
+
+ + + +
+ + + +
+
+
+ +
+ +
-

- -

+ -
-
+ +
+
+ + - -
-
-
-
+ +
+ +
- - +

+ +

+ +
+
+ +
+
+ +
+ + + +
+ + + + +
- - - +
- -
-

A demo by Scotch.

-

Read the tutorial.

-
+
+ diff --git a/public/js/controllers/main.js b/public/js/controllers/main.js index 7cb2ce277..9ace343f0 100644 --- a/public/js/controllers/main.js +++ b/public/js/controllers/main.js @@ -16,8 +16,9 @@ angular.module('todoController', []) // CREATE ================================================================== // when submitting the add form, send the text to the node API - $scope.createTodo = function() { - + $scope.createTodo = function(event) { + $scope.button=event.target.id; + console.log($scope.button); // validate the formData to make sure that something is there // if form is empty, nothing will happen if ($scope.formData.text != undefined) { diff --git a/public/js/services/todos.js b/public/js/services/todos.js index 49761e727..76a2f5f48 100644 --- a/public/js/services/todos.js +++ b/public/js/services/todos.js @@ -5,6 +5,7 @@ angular.module('todoService', []) .factory('Todos', ['$http',function($http) { return { get : function() { + console.log("in get function"); return $http.get('/api/todos'); }, create : function(todoData) {