{"size": 1091, "ext": "js", "max_stars_repo_path": "client/name/name.component.js", "max_stars_repo_name": "micahp0506/fantasy_assistant", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "client/name/name.component.js", "max_issues_repo_name": "micahp0506/fantasy_assistant", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "client/name/name.component.js", "max_forks_repo_name": "micahp0506/fantasy_assistant", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.6097560976, "max_line_length": 63, "alphanum_fraction": 0.48395967}
'use strict';


angular.
  module('name').
  component('name', {
    templateUrl: 'name/name.html',
    bindings: {
      user: '<'
    },
    controller:
      function NameController(draftService, authService) {
        console.log("this", this);
        console.log("authService", authService);
        let user = authService.getUser();
        console.log("user", user);
        this.showDraft = false;
        this.showName = true;

        this.setName = function () {
          console.log("this", this.teamName);

          let name = {teamName: this.teamName};
          draftService.database().ref(user.uid + '/name').set({
            teamName: this.teamName
          });
          // if (this.team.length === 0) {
          //   this.team.push({teamName: this.teamName});
          // } else {
          //   this.team.map((t) => {
          //     if (t.teamName !== this.teamName) {
          //       t.teamName === this.teamName;
          //     }
          //   });
          // };
          this.showDraft = true;
          this.showName = false;
        }
      }
  });
