Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- var userModule = angular.module('userModule', ['userServices']);
- userModule.controller('LoginController', ['$scope', '$location', 'userAuth', function($scope, $location, userAuth) {
- $scope.login = function() {
- console.log("username: " + $scope.email + ", password: " + $scope.password);
- // userAuth.login($scope.username, $scope.password);
- // initial values
- $scope.error = false;
- $scope.disabled = true;
- // call login from service
- userAuth.login($scope.email, $scope.password)
- // handle success
- .then(function () {
- console.log('I am in then function');
- })
- .catch(function () {
- })
- };
- }]);
- TypeError: userAuth.login(...).then(...).catch is not a function
- at Object.$scope.login (http://localhost:5000/static/js/controllers/user.js:28:13)
- at http://localhost:5000/static/lib/angular/angular.js:6365:19
- at Object.Scope.$eval (http://localhost:5000/static/lib/angular/angular.js:8057:28)
- at Object.Scope.$apply (http://localhost:5000/static/lib/angular/angular.js:8137:23)
- at HTMLFormElement.<anonymous> (http://localhost:5000/static/lib/angular/angular.js:13159:11)
- at http://localhost:5000/static/lib/angular/angular.js:1992:10
- at Array.forEach (native)
- at forEach (http://localhost:5000/static/lib/angular/angular.js:130:11)
- at HTMLFormElement.eventHandler (http://localhost:5000/static/lib/angular/angular.js:1991:5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement