Blame view
app/partials/ContactView/ContactView.controller.js
1.82 KB
4bb02bb84
|
1 2 3 4 |
'use strict'; //Load controller angular.module('acufuel') |
7e481a068
|
5 |
.controller('ContactViewController', ['$scope', '$uibModal', 'ContactViewService', 'ViewCompanyService', 'ViewcontactService', function($scope, $uibModal, ContactViewService, ViewCompanyService, ViewcontactService) { |
2c476c756
|
6 7 8 9 10 11 |
$(document).ready(function() { $('#contacts').DataTable(); }); ContactViewService.getContacts().then(function(result) { |
2c476c756
|
12 |
$scope.contactList = result; |
2c476c756
|
13 |
}) |
7e481a068
|
14 |
|
7152ff131
|
15 16 17 |
$scope.reset = function(){ $("input").val(""); } |
7e481a068
|
18 |
$scope.changePriceEmail = function(id, index){ |
d24318592
|
19 |
event.stopPropagation(); |
67044e31e
![]() |
20 21 22 23 24 25 26 27 28 |
// var contactId = id; // var statusData = "status=" + $scope.contactList[index].priceEmail; // ViewcontactService.changePriceEmail(contactId, statusData).then(function(result) { // if(result.success){ // toastr.success(''+result.success+'', { // closeButton: true // }) // } // }) |
7e481a068
|
29 |
} |
2c476c756
|
30 31 |
ContactViewService.getCompanies().then(function(result) { |
2c476c756
|
32 33 34 35 36 37 38 |
$scope.companies = result; }) $scope.contactData = {}; $scope.contactData.contactList = []; $scope.addContact = function(){ |
2c476c756
|
39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
$scope.contactData.contactList.push($scope.data); ViewCompanyService.addContact($scope.contactData).then(function(result) { if(result.success){ toastr.success(''+result.success+'', { closeButton: true }) $('#contact-modal-3').modal('hide'); }else{ toastr.error(''+result.statusText+'', { closeButton: true }) } }) } |
4bb02bb84
|
53 54 |
}]); |