This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var router = express.Router(); | |
var isAuthenticated = function (req, res, next) { | |
// if user is authenticated in the session, call the next() to call the next request handler | |
// Passport adds this method to request object. A middleware is allowed to add properties to | |
// request and response objects | |
if (req.isAuthenticated()) | |
return next(); | |
// if the user is not authenticated then redirect him to the login page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = angular.module('warehouseApp', ['ngResource']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.controller('listController', ['$scope', '$resource', | |
function ($scope, $resource){ | |
$scope.prof={}; | |
$scope.prof.check=false; | |
//$scope.prof.newName = {}; | |
//Rest API Route on server | |
var Listing = $resource('/api/listing/:id', {}, { update : {method : 'PUT'}}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.controller('animalsController', ['$scope', | |
function ($scope){ | |
$scope.test = "This is a test"; | |
$scope.animals = [ | |
{ category : "Cats" }, | |
{ category : "Dogs" }, | |
{ cateogry : "Fish" }, | |
{ category : "Reptiles" }, | |
{ category : "Small Animals" } |