Skip to content

Commit

Permalink
Developer (#90)
Browse files Browse the repository at this point in the history
* added my meals to nav bar (#60)

* Mealsviews (#61)

* made card image dynamic on resize

* added btn to save meal plan

* updated slick btn icon

* changed title and card btn alignment

* added material icons hosted new btn icons and link to recipe

* Meal plan model (#62)

* created meal plan model with associations to user and recipes

* created route to add a new meal plan

* Created put route to mark current meal plan as complete and get brand new meal suggestions

* Groceryviews (#63)

* made card image dynamic on resize

* added btn to save meal plan

* updated slick btn icon

* changed title and card btn alignment

* added material icons hosted new btn icons and link to recipe

* trying to get a recipe pop up window working

* dialog box opens no interpolation

* grocery view skeleton done

* Mainpage (#65)

* made card image dynamic on resize

* added btn to save meal plan

* updated slick btn icon

* changed title and card btn alignment

* added material icons hosted new btn icons and link to recipe

* trying to get a recipe pop up window working

* dialog box opens no interpolation

* grocery view skeleton done

* background img settings completed

* added free shutterstock vid to home page

* angular video background directive works

* background vid for home page complete

* home page bg image re-sized to zoom out

* Mealsviewv2 (#66)

* added col for chosen meals

* user can add and delete groceries to my meals

* user can add meals to grocery list and they are sent to the database

* spending chart is a go

* spending chart is a go (#69)

* Navbarchange (#70)

* made card image dynamic on resize

* added btn to save meal plan

* updated slick btn icon

* changed title and card btn alignment

* added material icons hosted new btn icons and link to recipe

* trying to get a recipe pop up window working

* dialog box opens no interpolation

* changed vh for meals page

* made nav transparent on all pages

* Grocery list (#71)

* Created method on meal plan model to getGroceryList()

* Added column to mealPlanModel that contains groceryList

* Created route /users/:userid/meals/grocerylist to get a grocerylist

* Created a ListFactory with method to getGroceryList

* Hooked up back grocery list with front end

* Grocery list is now divided by sections and is alphabetical

* Savemeals (#72)

* user can press a button to see a new set of meals

* commit

* updated refresh functionality

* meals page doesn't bug out on refresh

* fixed other pages with refresh problem

* Sunburst foods (#73)

* spending chart is a go

* sunburst setup

* sunburst and spending graphs are running

* sunburst chart complete for one meal

* reworking my account page layout

* currency layout

* Popuprecipe (#74)

* made card image dynamic on resize

* added btn to save meal plan

* updated slick btn icon

* changed title and card btn alignment

* added material icons hosted new btn icons and link to recipe

* trying to get a recipe pop up window working

* dialog box opens no interpolation

* changed vh for meals page

* recipe popup working, organizing layout

* popup card layout for web done

* updated color theme

* updated background color

* popupcard properly working and displaying correct info for chosen meal

* Better meal ui (#75)

* Developer (#47)

* first 100 recipes seeded; recipe and ingredient routes defined

* first ingredients seeded (#5)

* Layoutandnav (#9)

* deleted rando greeting from home page and renamed logo

* logoupdated along with file names

* working on nav items

* navbar looks good working well

* removed navbar scss not needed

* fixed layout view added favicon

* Origin/loginview (#10)

* loginpage prettified

* in progress

* added oauth buttons to login page

* removed seed file

* added original seed

* fixed login view height

* expanded user db

* wrote test for signup route

* added link to signup state

* signup state, template, controller, and method in authservice

* added styling to signup view

* added mixin to SCSS to make it dry

* Db ingredients (#14)

* first ingredients seeded

* fixed db errors for ingredients and recipes

* fixed linter error

* Oauth (#16)

* google oauth set

* facebook oauth set

* updated gitignore

* Delete development.js

* updated oauth keys

* readding developmentjs file

* Made chancges suggested by glebec (#17)

* made changes suggested by glebec

* Fixed async

* Footer (#18)

* deleted rando greeting from home page and renamed logo

* logoupdated along with file names

* working on nav items

* navbar looks good working well

* removed navbar scss not needed

* fixed home layout dimensions and added favicon

* updated package.json details

* updated logo size

* set fixed main page vh

* updated favicon

* navbar view complete

* prev commit footer view complete and navbar view now

* fixed signup view form

* signup login and oauth button views done

* about page view set

* developmentjs file keys

* changed verbiage for signup on login page

* updated logo size

* corrected user model to allow oauth (#19)

* extracted food aisles (#22)

* Clean db (#23)

* added allownull falses to recipe database and changed seed file to allow these errors

* working on seed file

* worked on the seed file without improving it

* resolved unique validation errors

* Deleted useless file

* Food categories (#26)

* extracted food aisles

* user prefs model complete

* user prefs model updated

* filter recipes by user prefs

* associations added for user prefs

* Meal planning1 (#27)

* added allownull falses to recipe database and changed seed file to allow these errors

* working on seed file

* worked on the seed file without improving it

* started im

* Started...

* Minor changes... nbd

* added preliminary tests for recipe model

* working on tests

* added tests for getRelatedMeals

* Fixed some error handling (#28)

* Food prefs (#29)

* revert favicon

* updated favicon for heroku

* submit button on sign up takes you to prefs page

* user prefs test running no tests passing

* user prefs tests debugging

* user prefs tests passing

* Food categories (#32)

* extracted food aisles

* user prefs model complete

* user prefs model updated

* filter recipes by user prefs

* associations added for user prefs

* writing tests for user prefs

* user prefs routes

* working on user pref routes

* third time is the charm?

* updated package json dependency for linting as per glebecs sugg

* Userprefmodel (#33)

* updated nav bar to be hamburger menu for small device view

* cleaned up tests and instance method

* user prefs routes: create new, get one, update one (#36)

* Prefs (#37)

* user prefs routes: create new, get one, update one

* added general user routes

* skeleton user pref view (#38)

* Mealplanning2 (#34)

* getMealsWithSimilarIngredients first version

* Created tests for getMealsWithSimilarIngredients

* Added some comments for geatMealsWithSmiliarIngredients

* fixed signup route by changing state go (#39)

* removed console log

* prefs controller added

* Ingredient routes (#41)

* get ALL the ingredients (route)

* removed extraneous code

* getting all ingredients need to work on autocomplete

* added skeleton view for meals page dates

* renamed app to Dishd

* Dislikes bar (#43)

* removed console log

* prefs controller added

* getting all ingredients need to work on autocomplete

* dislikes bar filters! :D

* selected dislikes get added to preference object

* dislike buttons added and deleted with user input

* new user creates default userPref; user dislikes remembered on refresh; null dislike taken care of

* numPeople and availableTime added to userPref model and hooked up to frontend

* skeleton meals view

* adding that x

* removing pre tag

* adapted meal view so user can only choose 5 meals

* fixed some linter errors

* alternate view if user has already selected a set of meals

* increased height of meals section and moved title to the top

* added md-list styling to selected meals list

* fixed refresh bug on accounts page

* Palette (#76)

* made card image dynamic on resize

* added btn to save meal plan

* updated slick btn icon

* changed title and card btn alignment

* added material icons hosted new btn icons and link to recipe

* trying to get a recipe pop up window working

* dialog box opens no interpolation

* changed vh for meals page

* recipe popup working, organizing layout

* popup card layout for web done

* updated color theme

* updated background color

* updated recipe card banner color

* prefs page btns updated

* updated prefs page btn icons

* Not sure. (#78)

* Headers (#81)

* Developer (#47)

* first 100 recipes seeded; recipe and ingredient routes defined

* first ingredients seeded (#5)

* Layoutandnav (#9)

* deleted rando greeting from home page and renamed logo

* logoupdated along with file names

* working on nav items

* navbar looks good working well

* removed navbar scss not needed

* fixed layout view added favicon

* Origin/loginview (#10)

* loginpage prettified

* in progress

* added oauth buttons to login page

* removed seed file

* added original seed

* fixed login view height

* expanded user db

* wrote test for signup route

* added link to signup state

* signup state, template, controller, and method in authservice

* added styling to signup view

* added mixin to SCSS to make it dry

* Db ingredients (#14)

* first ingredients seeded

* fixed db errors for ingredients and recipes

* fixed linter error

* Oauth (#16)

* google oauth set

* facebook oauth set

* updated gitignore

* Delete development.js

* updated oauth keys

* readding developmentjs file

* Made chancges suggested by glebec (#17)

* made changes suggested by glebec

* Fixed async

* Footer (#18)

* deleted rando greeting from home page and renamed logo

* logoupdated along with file names

* working on nav items

* navbar looks good working well

* removed navbar scss not needed

* fixed home layout dimensions and added favicon

* updated package.json details

* updated logo size

* set fixed main page vh

* updated favicon

* navbar view complete

* prev commit footer view complete and navbar view now

* fixed signup view form

* signup login and oauth button views done

* about page view set

* developmentjs file keys

* changed verbiage for signup on login page

* updated logo size

* corrected user model to allow oauth (#19)

* extracted food aisles (#22)

* Clean db (#23)

* added allownull falses to recipe database and changed seed file to allow these errors

* working on seed file

* worked on the seed file without improving it

* resolved unique validation errors

* Deleted useless file

* Food categories (#26)

* extracted food aisles

* user prefs model complete

* user prefs model updated

* filter recipes by user prefs

* associations added for user prefs

* Meal planning1 (#27)

* added allownull falses to recipe database and changed seed file to allow these errors

* working on seed file

* worked on the seed file without improving it

* started im

* Started...

* Minor changes... nbd

* added preliminary tests for recipe model

* working on tests

* added tests for getRelatedMeals

* Fixed some error handling (#28)

* Food prefs (#29)

* revert favicon

* updated favicon for heroku

* submit button on sign up takes you to prefs page

* user prefs test running no tests passing

* user prefs tests debugging

* user prefs tests passing

* Food categories (#32)

* extracted food aisles

* user prefs model complete

* user prefs model updated

* filter recipes by user prefs

* associations added for user prefs

* writing tests for user prefs

* user prefs routes

* working on user pref routes

* third time is the charm?

* updated package json dependency for linting as per glebecs sugg

* Userprefmodel (#33)

* updated nav bar to be hamburger menu for small device view

* cleaned up tests and instance method

* user prefs routes: create new, get one, update one (#36)

* Prefs (#37)

* user prefs routes: create new, get one, update one

* added general user routes

* skeleton user pref view (#38)

* Mealplanning2 (#34)

* getMealsWithSimilarIngredients first version

* Created tests for getMealsWithSimilarIngredients

* Added some comments for geatMealsWithSmiliarIngredients

* fixed signup route by changing state go (#39)

* removed console log

* prefs controller added

* Ingredient routes (#41)

* get ALL the ingredients (route)

* removed extraneous code

* getting all ingredients need to work on autocomplete

* added skeleton view for meals page dates

* renamed app to Dishd

* Dislikes bar (#43)

* removed console log

* prefs controller added

* getting all ingredients need to work on autocomplete

* dislikes bar filters! :D

* selected dislikes get added to preference object

* dislike buttons added and deleted with user input

* new user creates default userPref; user dislikes remembered on refresh; null dislike taken care of

* numPeople and availableTime added to userPref model and hooked up to frontend

* skeleton meals view

* adding that x

* removing pre tag

* added page headings to nav bar

* re-centered login form

* moved dowlaod button on grocery list

* added more styling to shopping list

* refresh button styling

* Logov2 (#82)

* changed logo to white on home page

* home page login and signup btns added

* adjusted prefs page height size

* updated meals page and prefs page

* Overlap vis (#83)

* Developer (#47)

* first 100 recipes seeded; recipe and ingredient routes defined

* first ingredients seeded (#5)

* Layoutandnav (#9)

* deleted rando greeting from home page and renamed logo

* logoupdated along with file names

* working on nav items

* navbar looks good working well

* removed navbar scss not needed

* fixed layout view added favicon

* Origin/loginview (#10)

* loginpage prettified

* in progress

* added oauth buttons to login page

* removed seed file

* added original seed

* fixed login view height

* expanded user db

* wrote test for signup route

* added link to signup state

* signup state, template, controller, and method in authservice

* added styling to signup view

* added mixin to SCSS to make it dry

* Db ingredients (#14)

* first ingredients seeded

* fixed db errors for ingredients and recipes

* fixed linter error

* Oauth (#16)

* google oauth set

* facebook oauth set

* updated gitignore

* Delete development.js

* updated oauth keys

* readding developmentjs file

* Made chancges suggested by glebec (#17)

* made changes suggested by glebec

* Fixed async

* Footer (#18)

* deleted rando greeting from home page and renamed logo

* logoupdated along with file names

* working on nav items

* navbar looks good working well

* removed navbar scss not needed

* fixed home layout dimensions and added favicon

* updated package.json details

* updated logo size

* set fixed main page vh

* updated favicon

* navbar view complete

* prev commit footer view complete and navbar view now

* fixed signup view form

* signup login and oauth button views done

* about page view set

* developmentjs file keys

* changed verbiage for signup on login page

* updated logo size

* corrected user model to allow oauth (#19)

* extracted food aisles (#22)

* Clean db (#23)

* added allownull falses to recipe database and changed seed file to allow these errors

* working on seed file

* worked on the seed file without improving it

* resolved unique validation errors

* Deleted useless file

* Food categories (#26)

* extracted food aisles

* user prefs model complete

* user prefs model updated

* filter recipes by user prefs

* associations added for user prefs

* Meal planning1 (#27)

* added allownull falses to recipe database and changed seed file to allow these errors

* working on seed file

* worked on the seed file without improving it

* started im

* Started...

* Minor changes... nbd

* added preliminary tests for recipe model

* working on tests

* added tests for getRelatedMeals

* Fixed some error handling (#28)

* Food prefs (#29)

* revert favicon

* updated favicon for heroku

* submit button on sign up takes you to prefs page

* user prefs test running no tests passing

* user prefs tests debugging

* user prefs tests passing

* Food categories (#32)

* extracted food aisles

* user prefs model complete

* user prefs model updated

* filter recipes by user prefs

* associations added for user prefs

* writing tests for user prefs

* user prefs routes

* working on user pref routes

* third time is the charm?

* updated package json dependency for linting as per glebecs sugg

* Userprefmodel (#33)

* updated nav bar to be hamburger menu for small device view

* cleaned up tests and instance method

* user prefs routes: create new, get one, update one (#36)

* Prefs (#37)

* user prefs routes: create new, get one, update one

* added general user routes

* skeleton user pref view (#38)

* Mealplanning2 (#34)

* getMealsWithSimilarIngredients first version

* Created tests for getMealsWithSimilarIngredients

* Added some comments for geatMealsWithSmiliarIngredients

* fixed signup route by changing state go (#39)

* removed console log

* prefs controller added

* Ingredient routes (#41)

* get ALL the ingredients (route)

* removed extraneous code

* getting all ingredients need to work on autocomplete

* added skeleton view for meals page dates

* renamed app to Dishd

* Dislikes bar (#43)

* removed console log

* prefs controller added

* getting all ingredients need to work on autocomplete

* dislikes bar filters! :D

* selected dislikes get added to preference object

* dislike buttons added and deleted with user input

* new user creates default userPref; user dislikes remembered on refresh; null dislike taken care of

* numPeople and availableTime added to userPref model and hooked up to frontend

* skeleton meals view

* adding that x

* removing pre tag

* spending chart is a go

* moving bundle chart over

* fixing eslint warnings and bundle diagram

* updating karma file

* re-styling my acct page

* interpolate numPeople/availableTime preferences to live upload

* changed my account layout

* fixed the footer links -- DAMN YOU GLOBAL CSS! (#84)

* changed pdfmake source to outside host (#85)

* Myacctstyles (#87)

* banner buttons aligned

* charts resized for demo

* my acct page layout done

* prefs and login page re-route to meals (#88)

* Clean db (#89)

* New files for seeding

* Almost ready to delete..

* Able to filter through the json

* Final json for db
  • Loading branch information
verasveras authored and galencorey committed Oct 12, 2016
1 parent cfad3a5 commit d0162ca
Show file tree
Hide file tree
Showing 77 changed files with 5,313 additions and 13,912 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Expand Up @@ -13,7 +13,8 @@
"rules": {
"global-require": 0, // 0 = off, 1 = warn (yellow), 2 = error (red)
"camelcase": 0,
"no-debugger": 1
"no-debugger": 1,
"quotes": [0, "single", { "avoidEscape": true }]
// add more rules here to override the fullstack config
}
}
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,3 +5,4 @@ public
.DS_Store
coverage
server/db-setup/api-key.js
browser/js/allrecipes
1 change: 1 addition & 0 deletions browser/js/about/about.html
@@ -1,4 +1,5 @@
<md-content flex>
<navbar header="About Dish'd"></navbar>
<div layout="row">
<div flex>
<section id="about">
Expand Down
10 changes: 8 additions & 2 deletions browser/js/app.js
@@ -1,7 +1,8 @@
'use strict';
window.app = angular.module('Dishd', ['fsaPreBuilt', 'ui.router', 'ngAnimate', 'ngMaterial', 'ngMdIcons', 'ngAria', 'slickCarousel']);

app.config(function ($urlRouterProvider, $locationProvider) {
window.app = angular.module('Dishd', ['fsaPreBuilt', 'ui.router', 'ngAnimate', 'ngMaterial', 'ngMdIcons', 'ngAria', 'slickCarousel', 'ngVidBg', 'nvd3']);

app.config(function ($urlRouterProvider, $locationProvider, $mdThemingProvider) {
// This turns off hashbang urls (/#about) and changes it to something normal (/about)
$locationProvider.html5Mode(true);
// If we go to a URL that ui-router doesn't have registered, go to the "/" url.
Expand All @@ -10,6 +11,11 @@ app.config(function ($urlRouterProvider, $locationProvider) {
$urlRouterProvider.when('/auth/:provider', function () {
window.location.reload();
});
//Angular Material Custom Color Theme
$mdThemingProvider.theme('default')
.primaryPalette('grey')
.accentPalette('grey')
.backgroundPalette('grey');
});

// This app.run is for listening to errors broadcasted by ui-router, usually originating from resolves
Expand Down
6 changes: 4 additions & 2 deletions browser/js/common/directives/dishd-logo/dishd-logo.html
@@ -1,2 +1,4 @@
<ng-md-icon icon="restaurant_menu" size="40px"></ng-md-icon>

<div id="logo_nav">
<ng-md-icon icon="restaurant_menu" size="40px"></ng-md-icon>
<h1>dish'd</h1>
</div>
4 changes: 2 additions & 2 deletions browser/js/common/directives/navbar/navbar.html
Expand Up @@ -3,8 +3,8 @@
<a ui-sref="home">
<dishd-logo></dishd-logo>
</a>
<div ng-show="user" class="welcome">
<span>Welcome, {{ user.email }}!</span>
<div ng-if="header">
<h3>{{ header }}</h3>
</div>
<md-menu>
<md-button ng-click="$mdOpenMenu($event)" class="md-icon-button" aria-label="Open sample menu">
Expand Down
7 changes: 5 additions & 2 deletions browser/js/common/directives/navbar/navbar.js
Expand Up @@ -2,13 +2,16 @@ app.directive('navbar', function ($rootScope, AuthService, AUTH_EVENTS, $state)

return {
restrict: 'E',
scope: {},
scope: {
header: '@'
},
templateUrl: 'js/common/directives/navbar/navbar.html',
link: function (scope) {

scope.items = [
{ label: 'My Account', state: 'myAccount', auth: true },
{ label: 'Grocery List', auth: true }
{ label: 'My Meals', state: 'meals', auth: true },
{ label: 'Grocery List', state: 'groceries', auth: true }
];

scope.user = null;
Expand Down
4 changes: 0 additions & 4 deletions browser/js/docs/docs.html

This file was deleted.

6 changes: 0 additions & 6 deletions browser/js/docs/docs.js

This file was deleted.

19 changes: 19 additions & 0 deletions browser/js/groceries/groceries.html
@@ -0,0 +1,19 @@
<md-content flex>
<navbar header="Grocery List"></navbar>
<div id="groceries">
<div class="groceries">
<h4>Download List
<md-button class="md-icon-button" ng-click="makePDF(sections)">
<ng-md-icon icon="file_download"></ng-md-icon>
</md-button>
</h4>
<div ng-repeat="section in headers | orderBy : section">
<h3> {{ section }} </h3> <br />
<md-list-item ng-repeat="item in sections[section] | orderBy: 'name'">
<p> {{item.name}} || {{round(item.amount)}} {{item.unitLong}} </p>
<md-checkbox class="md-secondary" ng-model="item.wanted"></md-checkbox>
</md-list-item>
</div>
</div>
</div>
</md-content>
95 changes: 95 additions & 0 deletions browser/js/groceries/groceries.js
@@ -0,0 +1,95 @@
app.config(function ($stateProvider) {
$stateProvider.state('groceries', {
url: '/groceries',
templateUrl: 'js/groceries/groceries.html',
controller: 'ListCtrl',
resolve: {
currentUser: function(AuthService){
return AuthService.getLoggedInUser();
}
},
data: {
authenticate: true
}
});
});

app.controller('ListCtrl', function($scope, ListFactory, currentUser) {

$scope.sections = {};


ListFactory.getGroceryList(currentUser.id)
.then(function(groceryList){
$scope.sections = groceryList;
$scope.headers = Object.keys(groceryList);
})

$scope.round = ListFactory.round;

$scope.makePDF = ListFactory.makePDF;

});

app.factory('ListFactory', function($http) {

let ListFactory = {};

ListFactory.round = function(number){
if (isNaN(number)){
return parseInt(number, 10);
}
return Math.round(number * 100) / 100;
}

ListFactory.getGroceryList = function(userId){
return $http.get(`api/users/${userId}/meals/grocerylist`)
.then(function(response){
return response.data;
// {amount, unit, unitLong, Section}
})
.then(function(groceryList){
let formatedList = {};

for (var key in groceryList){
if (!formatedList[groceryList[key].section]){
formatedList[groceryList[key].section] = [];
}
let newItem = {
name: key,
amount: groceryList[key].amount,
unit: groceryList[key].unitShort,
unitLong: groceryList[key].unitLong,
section: groceryList[key].aisle
}
formatedList[groceryList[key].section].push(newItem)
}

return formatedList;
});


}

ListFactory.makePDF = function(groceryList){


let listToExport = [];
for (let aisle in groceryList){
listToExport.push({text: aisle, fontSize: 16, bold: true});
listToExport.push({
ul: groceryList[aisle].map(item => `${item.name}: ${ListFactory.round(item.amount)} ${item.unitLong}`)
})
}

let docDefinition = {
content: listToExport
}
console.log(docDefinition);

pdfMake.createPdf(docDefinition).download('grocerylist.pdf');

}

return ListFactory;
});
26 changes: 17 additions & 9 deletions browser/js/home/home.html
@@ -1,11 +1,19 @@
<md-content flex>
<div layout="row">
<div flex>
<section id="home">
<dishd-logo></dishd-logo>
<div>Dish'd! Get your dish on.</div>
</section>
<md-content>
<div layout="row" flex layout-align="end center">
<md-content>
<vid-bg resources="resources" poster="poster" full-screen="fullScreen" muted="muted" z-index="zIndex" play-info="playInfo" pause-play="pausePlay"></vid-bg>
</md-content>
<div id="logo" flex>
<navbar></navbar>
<section class="mainpage" flex style="
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;">
<h1>get your dish'd on</h1>
<md-button ui-sref="signup">start here</md-button>
<div class="link" ui-sref="login">already a member? login</div>
</section>
</div>
</div>
</div>
</md-content>

18 changes: 17 additions & 1 deletion browser/js/home/home.js
@@ -1,6 +1,22 @@
app.config(function ($stateProvider) {
$stateProvider.state('home', {
url: '/',
templateUrl: 'js/home/home.html'
templateUrl: 'js/home/home.html',
controller: 'homeCtrl'
});
});

app.controller('homeCtrl', ['$scope', function ($scope) {
$scope.resources = [
// '*.webm',
'*.ogv',
'js/home/media/girls_cooking.mp4',
'*.swf'
];
// $scope.poster = 'http://placehold.it/2000&text=you%20may%20want%20to%20have%20a%20poster';
$scope.fullScreen = true;
$scope.muted = true;
$scope.zIndex = '10';
$scope.playInfo = {};
$scope.pausePlay = true;
}]);
Binary file added browser/js/home/media/girls_cooking.mp4
Binary file not shown.
2 changes: 1 addition & 1 deletion browser/js/login/login.html
@@ -1,6 +1,6 @@
<md-content flex>
<navbar header="Login to Dish'd!"></navbar>
<div id="login-page" layout="column" ng-cloak>
<h1>Login to Dish'd!</h1>
<form id="login-form" name="loginForm" ng-submit="loginForm.$valid && sendLogin(login)">
<md-input-container class="md-block">
<input ng-model="login.email" type="email" placeholder="Email (required)" ng-required="true">
Expand Down
4 changes: 2 additions & 2 deletions browser/js/login/login.js
Expand Up @@ -6,15 +6,15 @@ app.config(function ($stateProvider) {
});
});

app.controller('LoginCtrl', function ($scope, AuthService, $state, Session) {
app.controller('LoginCtrl', function ($scope, AuthService, $state) {
$scope.login = {};
$scope.error = null;

$scope.sendLogin = function (loginInfo) {
$scope.error = null;
AuthService.login(loginInfo)
.then(function () {
$state.go('home');
$state.go('meals');
}).catch(function () {
$scope.error = 'Invalid login credentials.';
});
Expand Down

0 comments on commit d0162ca

Please sign in to comment.