Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html Angular-ng模型无法获取对象数组值_Html_Angular_Typescript - Fatal编程技术网

Html Angular-ng模型无法获取对象数组值

Html Angular-ng模型无法获取对象数组值,html,angular,typescript,Html,Angular,Typescript,有两个签入和签出动态输入字段。选择日期时,签入和签出时间范围中的“允许用户”字段。问题是无法获取值和数据格式。ng模型无法获取签入和签出值。我想将这样的数据格式保存到数据库中 { "days": { "Monday": { "checkin": "09:00", "checkout": "18:00" }, "Tue

有两个签入和签出动态输入字段。选择日期时,签入和签出时间范围中的“允许用户”字段。问题是无法获取值和数据格式。ng模型无法获取签入和签出值。我想将这样的数据格式保存到数据库中

{
  "days": {
    "Monday": {
      "checkin": "09:00",
      "checkout": "18:00"
    },
    "Tuesday": {
      "checkin": "07:00",
      "checkout": "19:00"
    }
  }
}
这是我的html文件

<div class="row">
        <div class="col-lg-12">
          <div class="form-group">
            <label>Active Days</label>
            <ng-select [items]="days" name="days"
             bindLabel="id" autofocus loadingText="Loading ..." [multiple]=true
              bindValue="id"  placeholder="Select Active Days" 
              [(ngModel)]="attendanceProfile.daysprofile.dayy" >
            </ng-select>
          </div>
        </div>
      </div>
     
      <div *ngFor="let days of attendanceProfile.daysprofile.dayy; let i =index ">
        <div class="row">

          <div class="col-md-4">
            <div class="form-group">
              <label>Day</label>
              <input autocomplete="off" atp-time-picker type="text" 
                class="form-control" name="days" id="days"
                [value]="days"
                placeholder="days"  disabled />
            </div>
          </div>

          <div class="col-md-4">
            <div class="form-group">
              <label>Check In Time</label>
              <input autocomplete="off" atp-time-picker type="text" 
              class="form-control" name="checkin" id="checkin"
                [(ngModel)]="attendanceProfile.daysprofile.dayy[i].checkin" placeholder="chcekin" />
            </div>
          </div>

          <div class="col-md-4">
            <div class="form-group">
              <label>Check Out Time</label>
              <input autocomplete="off" type="text" 
               class="form-control" name="checkout" id="checkout"
                [(ngModel)]="attendanceProfile.daysprofile.dayy[i].checkout" placeholder="checkout" />
            </div>
          </div>

        </div>
      </div>

[i]。签入
无法获取该值。尝试使用
签入[i]
获取值

getNewObject(updateDefault: boolean = false): AttendanceProfile {
    let attendanceProfile = new AttendanceProfile();
    attendanceProfile.updatedAt = new Date();
    attendanceProfile.updatedBy = this.configService.currentUser.fullname;
    attendanceProfile.status = 0;
    attendanceProfile.daysprofile= {
        dayy:{['']:{checkin:{},checkout:{}}}
    }