<commit_before><div class="container">
  <h1>Hero Form</h1>
  <form (ngSubmit)="onSubmit()" #heroForm="ngForm"><!--引用NgForm指令-->
    {{ diagnostic }}
    <div class="form-group">
      <label for="name">Name</label>
      <input type="text" class="form-control" id="name" required
             [(ngModel)]="model.name" name="name" #name="ngModel"><!--指令的 exportAs 属性告诉 Angular 如何链接模板引用变量到指令。-->
             <!--#spy>&lt;!&ndash;用name注册到表单中&ndash;&gt;-->
      <!--<br>TODO: remmove this: {{spy.className}}-->
      <!--TODO: remove this: {{model.name}}-->
      <div [hidden]="name.valid || name.pristine"
           class="alert alert-danger">
        Name is required
      </div>
    </div>

    <div class="form-group">
      <label for="alterEgo">Alter Ego</label>
      <input type="text" class="form-control" id="alterEgo"
             [(ngModel)]="model.alterEgo" name="alterEgo">
    </div>

    <div class="form-group">
      <label for="power">Hero Power</label>
      <select class="form-control" id="power" required
              [(ngModel)]="model.power" name="power">
        <option *ngFor="let pow of powers" [value]="pow">{{ pow }}</option>
      </select>
    </div>

    <button type="submit" class="btn btn-success" [disabled]="!heroForm.form.valid">Submit</button>
    <button type="button" class="btn btn-default" (click)="newHero();heroForm.reset()">New Hero</button><!--清除所有标记-->
  </form>
</div><commit_msg>表单——切换两个表单区域<commit_after><div class="container">
  <div [hidden]="submitted">
    <h1>Hero Form</h1>
    <form (ngSubmit)="onSubmit()" #heroForm="ngForm"><!--引用NgForm指令-->
      {{ diagnostic }}
      <div class="form-group">
        <label for="name">Name</label>
        <input type="text" class="form-control" id="name" required
               [(ngModel)]="model.name" name="name" #name="ngModel"><!--指令的 exportAs 属性告诉 Angular 如何链接模板引用变量到指令。-->
               <!--#spy>&lt;!&ndash;用name注册到表单中&ndash;&gt;-->
        <!--<br>TODO: remmove this: {{spy.className}}-->
        <!--TODO: remove this: {{model.name}}-->
        <div [hidden]="name.valid || name.pristine"
             class="alert alert-danger">
          Name is required
        </div>
      </div>

      <div class="form-group">
        <label for="alterEgo">Alter Ego</label>
        <input type="text" class="form-control" id="alterEgo"
               [(ngModel)]="model.alterEgo" name="alterEgo">
      </div>

      <div class="form-group">
        <label for="power">Hero Power</label>
        <select class="form-control" id="power" required
                [(ngModel)]="model.power" name="power">
          <option *ngFor="let pow of powers" [value]="pow">{{ pow }}</option>
        </select>
      </div>

      <button type="submit" class="btn btn-success" [disabled]="!heroForm.form.valid">Submit</button>
      <button type="button" class="btn btn-default" (click)="newHero();heroForm.reset()">New Hero</button><!--清除所有标记-->
    </form>
  </div>
  <div [hidden]="!submitted">
    <h2>You submitted the following:</h2>
    <div class="row">
      <div class="col-xs-3">Name</div>
      <div class="col-xs-9  pull-left">{{ model.name }}</div>
    </div>
    <div class="row">
      <div class="col-xs-3">Alter Ego</div>
      <div class="col-xs-9 pull-left">{{ model.alterEgo }}</div>
    </div>
    <div class="row">
      <div class="col-xs-3">Power</div>
      <div class="col-xs-9 pull-left">{{ model.power }}</div>
    </div>
    <br>
    <button class="btn btn-primary" (click)="submitted=false">Edit</button><!--清除submitted标志-->
  </div>
</div>
{'fraction_non_alphanumeric': 0.21701291409320606, 'fraction_numerical': 0.003368893879842785, 'mean_word_length': 2.950110864745011, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 107, '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': '6938202', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1276, 'n_words': 223}