Bri Prebilic Cole | e031189 | 2015-05-15 11:27:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | (function () { |
| 18 | 'use strict'; |
Bri Prebilic Cole | 0e371dc | 2015-06-05 16:47:21 -0700 | [diff] [blame^] | 19 | var urlSuffix = '/rs/login'; |
Bri Prebilic Cole | e031189 | 2015-05-15 11:27:15 -0700 | [diff] [blame] | 20 | |
| 21 | angular.module('cordLogin', []) |
Bri Prebilic Cole | 0e371dc | 2015-06-05 16:47:21 -0700 | [diff] [blame^] | 22 | .controller('CordLoginCtrl', ['$log', '$scope', '$resource', |
| 23 | function ($log, $scope, $resource) { |
| 24 | var LoginData, resource; |
| 25 | $scope.page.curr = 'login'; |
| 26 | |
| 27 | $scope.login = function () { |
| 28 | var email; |
| 29 | if (!$scope.email) { |
| 30 | email = 'mom@user.org'; |
| 31 | } else { |
| 32 | email = $scope.email |
| 33 | } |
| 34 | LoginData = $resource($scope.shared.url + urlSuffix + '/' + email); |
| 35 | resource = LoginData.get(); |
| 36 | }; |
| 37 | |
| 38 | $log.debug('Cord Login Ctrl has been created.'); |
Bri Prebilic Cole | e031189 | 2015-05-15 11:27:15 -0700 | [diff] [blame] | 39 | }]); |
| 40 | }()); |