{"size": 1360, "ext": "js", "max_stars_repo_path": "app/javascript/app/components/departments/detail/teams/detail/positions/positions.component.js", "max_stars_repo_name": "tntsoftware/my-team-church", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/javascript/app/components/departments/detail/teams/detail/positions/positions.component.js", "max_issues_repo_name": "tntsoftware/my-team-church", "max_issues_repo_issues_event_min_datetime": "2019-01-09T00:37:05.000Z", "max_issues_repo_issues_event_max_datetime": "2021-10-06T17:48:54.000Z", "max_forks_repo_path": "app/javascript/app/components/departments/detail/teams/detail/positions/positions.component.js", "max_forks_repo_name": "tntsoftware/my-team-church", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 134, "max_forks_count": null, "avg_line_length": 30.9090909091, "max_line_length": 101, "alphanum_fraction": 0.6691176471}
class PositionsController {
  constructor(
    $rootScope, $stateParams,
    departmentsDetailTeamsDetailPositions
  ) {
    this.$rootScope = $rootScope;
    this.$stateParams = $stateParams;
    this.departmentsDetailTeamsDetailPositions = departmentsDetailTeamsDetailPositions;
    this.list = [];
  }
  $onInit() {
    this.load();
    this.watcher0 = this.$rootScope.$on('positionCreate', (_event, teamId) => {
      if (teamId === this.$stateParams.teamId) this.load();
    });
    this.watcher1 = this.$rootScope.$on('positionUpdate', (_event, teamId) => {
      if (teamId === this.$stateParams.teamId) this.load();
    });
    this.watcher2 = this.$rootScope.$on('positionDelete', (_event, teamId) => {
      if (teamId === this.$stateParams.teamId) this.load();
    });
  }
  $onDestroy() {
    this.watcher0();
    this.watcher1();
    this.watcher2();
  }
  load() {
    this.loading = true;
    this.departmentsDetailTeamsDetailPositions.load(this.$stateParams.teamId).then((positions) => {
      this.loading = false;
      this.list = angular.copy(positions);
    });
  }
}

let Positions = {
  template: require('./positions.html'),
  controller: PositionsController
};

export default angular.module('app.components.departments.detail.teams.detail.positions.component', [
]).component('departmentsDetailTeamsDetailPositions', Positions).name;
