<commit_before>(function() {
  'use strict';
  angular.module('civic.events.genes')
    .config(geneTalkConfig)
    .controller('GeneTalkController', GeneTalkController);

  // @ngInject
  function geneTalkConfig($stateProvider) {
    $stateProvider
      .state('events.genes.talk', {
        abstract: true,
        url: '/talk',
        templateUrl: 'app/views/events/genes/talk/GeneTalkView.tpl.html',
        controller: 'GeneTalkController',
        resolve: {
          comments: function(Genes, gene) {
            return Genes.getComments(gene.id);
          },
          changes: function(Genes, gene) {
            return Genes.getChanges(gene.id);
          },
          revisions: function(Genes, gene) {
            return Genes.getRevisions(gene.id);
          },
          lastRevision: function(Genes, gene) {
            return Genes.getLastRevision(gene.id);
          }
        },
        deepStateRedirect: [ 'geneId' ],
        data: {
          titleExp: '"Gene " + gene.name + " Talk"',
          navMode: 'sub'
        }
      })
      .state('events.genes.talk.log', {
        url: '/log',
        template: '<gene-talk-log></gene-talk-log>',
        data: {
          titleExp: '"Gene " + gene.name + " Log"',
          navMode: 'sub'
        }
      })
      .state('events.genes.talk.comments', {
        url: '/comments',
        template: '<gene-talk-comments></gene-talk-comments>',
        data: {
          titleExp: '"Gene " + gene.name + " Comments"',
          navMode: 'sub'
        }
      })
      .state('events.genes.talk.revisions', {
        url: '/revisions/:changeId',
        template: '<gene-talk-revisions></gene-talk-revisions>',
        data: {
          titleExp: '"Gene " + gene.name + " Revisions"',
          navMode: 'sub'
        }
      })
      .state('events.genes.talk.revisions.summary', {
        url: '/summary',
        template: '<gene-talk-revision-summary></gene-talk-revision-summary>',
        data: {
          titleExp: '"Gene " + gene.name + " Revision Summary"',
          navMode: 'sub'
        }
      });
  }

  // @ngInject
  function GeneTalkController($scope,
                                  $state,
                                  // resolved resources
                                  comments,
                                  changes,
                                  revisions,
                                  lastRevision,
                                  // inherited resolved resources
                                  Genes,
                                  gene,
                                  variants,
                                  variantGroups,
                                  myGeneInfo) {
    console.log('GenesTalkController called.');
    var ctrl = $scope.ctrl = {};

    // gene-description and my-gene-info directives expect these on scope
    ctrl.gene = gene;
    ctrl.myGeneInfo = myGeneInfo;

    var geneTalkModel = ctrl.geneTalkModel = {};

    geneTalkModel.config = {
      type: 'gene',
      name: gene.name,
      service: Genes,
      state: {
        baseState: 'events.genes.talk',
        baseUrl: $state.href('events.genes.talk', { geneId: gene.id })<commit_msg>switched to controllerAs syntax for genetalkcontroller<commit_after>(function() {
  'use strict';
  angular.module('civic.events.genes')
    .config(geneTalkConfig)
    .controller('GeneTalkController', GeneTalkController);

  // @ngInject
  function geneTalkConfig($stateProvider) {
    $stateProvider
      .state('events.genes.talk', {
        abstract: true,
        url: '/talk',
        templateUrl: 'app/views/events/genes/talk/GeneTalkView.tpl.html',
        controller: 'GeneTalkController',
        controllerAs: 'ctrl',
        resolve: {
          comments: function(Genes, gene) {
            return Genes.getComments(gene.id);
          },
          changes: function(Genes, gene) {
            return Genes.getChanges(gene.id);
          },
          revisions: function(Genes, gene) {
            return Genes.getRevisions(gene.id);
          },
          lastRevision: function(Genes, gene) {
            return Genes.getLastRevision(gene.id);
          }
        },
        deepStateRedirect: [ 'geneId' ],
        data: {
          titleExp: '"Gene " + gene.name + " Talk"',
          navMode: 'sub'
        }
      })
      .state('events.genes.talk.log', {
        url: '/log',
        template: '<gene-talk-log></gene-talk-log>',
        data: {
          titleExp: '"Gene " + gene.name + " Log"',
          navMode: 'sub'
        }
      })
      .state('events.genes.talk.comments', {
        url: '/comments',
        template: '<gene-talk-comments></gene-talk-comments>',
        data: {
          titleExp: '"Gene " + gene.name + " Comments"',
          navMode: 'sub'
        }
      })
      .state('events.genes.talk.revisions', {
        url: '/revisions/:changeId',
        template: '<gene-talk-revisions></gene-talk-revisions>',
        data: {
          titleExp: '"Gene " + gene.name + " Revisions"',
          navMode: 'sub'
        }
      })
      .state('events.genes.talk.revisions.summary', {
        url: '/summary',
        template: '<gene-talk-revision-summary></gene-talk-revision-summary>',
        data: {
          titleExp: '"Gene " + gene.name + " Revision Summary"',
          navMode: 'sub'
        }
      });
  }

  // @ngInject
  function GeneTalkController($scope,
                                  $state,
                                  // resolved resources
                                  comments,
                                  changes,
                                  revisions,
                                  lastRevision,
                                  // inherited resolved resources
                                  Genes,
                                  gene,
                                  variants,
                                  variantGroups,
                                  myGeneInfo) {
    console.log('GenesTalkController called.');

    // gene-description and my-gene-info directives expect these on scope
    this.gene = gene;
    this.myGeneInfo = myGeneInfo;

    var geneTalkModel = this.geneTalkModel = {};

    geneTalkModel.config = {
      type: 'gene',
      name: gene.name,
      service: Genes,
      state: {
        baseState: 'events.genes.talk',
        baseUrl: $state.href('events.genes.talk', { geneId: gene.id })
{'fraction_non_alphanumeric': 0.1296986641814228, 'fraction_numerical': 0.0, 'mean_word_length': 1.4362466893681423, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3431189', 'n_tokens_mistral': 1876, 'n_tokens_neox': 1727, 'n_words': 306}