Commit b31ede29 authored by Evren Kutar's avatar Evren Kutar

get model form submit right way

parent f81f7692
app.config(['$routeProvider', function ($routeProvider) {
$routeProvider
.when('/login', {
templateUrl: 'components/login/login.html',
templateUrl: 'components/auth/login.html',
controller: 'LoginCtrl',
resolve: {
loadMyCtrl: ['$ocLazyLoad', function ($ocLazyLoad) {
......
......@@ -78,8 +78,7 @@ auth.controller('LoginCtrl', function ($scope, $q, $timeout, LoginService) {
$scope.onSubmit = function (form) {
$scope.$broadcast('schemaFormValidate');
if (form.$valid) {
var credentials = {email: form.email.$modelValue, password: form.password.$modelValue};
LoginService.login(credentials);
LoginService.login($scope.model);
}
else {
console.log("not valid");
......
......@@ -9,7 +9,7 @@
// TODO: login url change with correct one
login.factory('LoginService', function ($http, $rootScope, $location, $log, $cookies, Session, RESTURL) {
auth.factory('LoginService', function ($http, $rootScope, $location, $log, $cookies, Session, RESTURL) {
var loginService = {};
loginService.login = function (credentials) {
......@@ -58,7 +58,7 @@ login.factory('LoginService', function ($http, $rootScope, $location, $log, $coo
// TODO: initial service not working!!
login.service('Session', function () {
auth.service('Session', function () {
this.create = function (sessionId, userId, userRole) {
this.id = sessionId;
this.userId = userId;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment