﻿'use strict';

angular.module('app.services',[]).factory('AccountServices', ['$http', function ($http) {

    var account = {};

    var baseRemoteUrl = "http://minitrelloapi.apphb.com";
    var baseLocalUrl = "http://localhost:1416";
    var baseUrl = baseRemoteUrl;

    account.login = function (data) {
        console.log(baseUrl);
        return $http.post(baseUrl + '/login', data);
    };

    account.register = function (model) {
        
        //return $http({
        //    url: baseUrl + '/register',
        //    method: 'POST',
        //    data: model,
        //    headers: { 'Content-Type': 'application/json' }
        //});
        //    .success(function (data, status, headers, config) {
        //    $scope.persons = data; // assign  $scope.persons here as promise is resolved here 
        //}).error(function (data, status, headers, config) {
        //    $scope.status = status;
        //});
        return $http.post(baseUrl + '/register', model);
    };


    return account;

}]);
@@ -251,22 +251,21 @@
 l = base
-Remote
+Local
 Url;%0A%0A  
@@ -450,18 +450,16 @@
         
-//
 return $
@@ -469,26 +469,24 @@
 p(%7B%0A        
-//
     url: bas
@@ -509,26 +509,24 @@
 r',%0A        
-//
     method: 
@@ -537,26 +537,24 @@
 T',%0A        
-//
     data: mo
@@ -562,26 +562,24 @@
 el,%0A        
-//
     headers:
@@ -618,34 +618,32 @@
 json' %7D%0A        
-//
 %7D);%0A        //  
@@ -907,24 +907,24 @@
   //%7D);%0A
-
         
 return $
@@ -907,32 +907,34 @@
   //%7D);%0A        
+//
 return $http.pos

change method in services