Getting started:
Related tutorials:
- MySQL-CLI: https://www.youtube.com/playlist?list=PLfdtiltiRHWEw4-kRrh1ZZy_3OcQxTn7P
- Analyzing Business Metrics: https://www.codecademy.com/learn/sql-analyzing-business-metrics
parse_str(file_get_contents("php://input"),$post_vars); //why this ?... the post could have gotten the values without it... | |
$getProject->project_name = filter_var($post_vars['newProjectname'], FILTER_SANITIZE_STRING); | |
$getProject->due_date = trim($post_vars['newDate']); | |
$getProject->status = filter_var($post_vars['newTeam']); | |
$getProject->dept_id = filter_var($post_vars['newDeptId']); |
<!doctype html> | |
<html lang="en" ng-app="TodoMVC"> | |
<head> | |
<title>Todo</title> | |
<!--All the cool css links, wait its just bootstrap--> | |
<link rel="stylesheet" href="styles/bootstrap.min.css"> | |
<link rel="stylesheet" href="styles/styles.css"> | |
<link rel="stylesheet" href="styles/base.css"> |
//the server components. | |
require('dotenv').load(); | |
var express=require("express"); | |
var mongoose=require("mongoose"); | |
var path = require('path'); | |
var config= require('./server/config/createdb') | |
var routes=require('./server/routes'); | |
var app=express(); | |
var port=process.env.PORT||3000; |
//the route would use the express api to perform operations | |
//using the Todo.Controllers.js | |
var Todo = require('./controller/Todo.Controllers'); | |
//create,retrieve,update, delete | |
module.exports=function(app){ | |
app.post('/api/todo',Todo.Create);//create | |
app.delete('/api/todo/:id',Todo.Delete);//delete | |
app.get('/api/todo',Todo.RetrieveAll);//retrieve |
//controller to perform several operations on Todo model... | |
//getting all tasks | |
//saving tasks | |
//getting completed tasks | |
//getting incompleted tasks | |
//deleting tasks | |
//editing tasks | |
var Todo=require('../models/Todo'); |
angular.module('TodoMVC',['ngRoute','ngResource']); | |
var app=angular.module('TodoMVC'); |
app.config(['$routeProvider',function($routeProvider){ | |
'use strict'; | |
var routeConfig={ | |
controller:'TodoController', | |
templateUrl:'angular-stuff/html/todo.html', | |
resolve: { | |
store: function (TodoStore) {. | |
return TodoStore | |
} |
app.controller('TodoController',function TodoController ($scope,$routeParams,$filter,store){ | |
//the todo controller would be handling new additions to the | |
//todo list and applying these to the DB via node and $resource | |
'use strict'; | |
var self=this; | |
store.get(); | |
var todos = $scope.todos = store.todos; |
app.factory('TodoStore',function($http,$injector){ | |
return $http.get('/api').then( | |
function () { | |
return $injector.get('api'); | |
}, | |
function () { | |
return $injector.get('localStorage'); | |
} | |
); |
Getting started:
Related tutorials: