<commit_before>angular.module('inviteCtrl', ['firebase'])

  .controller('InviteController', function ($state, $firebaseAuth, Auth, Users, $rootScope, $stateParams) {

    var vm = this;

    // when the state changes, set the org property to the current location for routing purpose
    $rootScope.$on('$stateChangeSuccess', function() {
      vm.org = $stateParams.org;
    });

    vm.emailInvite = function () {

    };

  });<commit_msg>(feat) email invite controller<commit_after>angular.module('inviteCtrl', ['firebase'])

  .controller('InviteController', function ($state, $firebaseAuth, Auth, Users, $rootScope, $stateParams, invite) {

    var vm = this;
    // get the org name to pass to emailInvite function
    vm.org = $stateParams.org;
    vm.thisUser = $rootScope.logInfo.username;
    vm.emailInvite = function () {
      // call the factory function to make ajax call to Mandrill API
      invite.sendEmailInvitation(vm.thisUser, vm.org, vm.inviteeName, vm.inviteeEmail);
      // empty the input fields
      vm.inviteeEmail = '';
      vm.inviteeName = '';
    };

  });
{'fraction_non_alphanumeric': 0.1346153846153846, 'fraction_numerical': 0.0, 'mean_word_length': 3.4979423868312756, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '646190', 'n_tokens_mistral': 335, 'n_tokens_neox': 323, 'n_words': 87}