diff options
author | 2018-08-07 10:54:17 +0300 | |
---|---|---|
committer | 2018-08-07 11:06:44 +0300 | |
commit | b2a3acea0d0f66028c9ce5fad02d4ecc64abf70c (patch) | |
tree | 8d70110f34cb845965c42a5915e950bca967d2c3 /src/angular/checklist | |
parent | 05b37297177e8a342668c15e5d6f738b51f7aedd (diff) |
Initial commit.
Adding files needed for Linux Foundation.
Change-Id: I9f2b4851a5ae01f83800c7f8bab8608a2221c730
Issue-ID: SDC-1608
Signed-off-by: Israel Lavi <il0695@att.com>
Diffstat (limited to 'src/angular/checklist')
-rw-r--r-- | src/angular/checklist/checklist.component.html.ts | 2 | ||||
-rw-r--r-- | src/angular/checklist/checklist.component.ts | 4 | ||||
-rw-r--r-- | src/angular/checklist/models/ChecklistItem.ts | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/angular/checklist/checklist.component.html.ts b/src/angular/checklist/checklist.component.html.ts index cb6f540..c48d8eb 100644 --- a/src/angular/checklist/checklist.component.html.ts +++ b/src/angular/checklist/checklist.component.html.ts @@ -1,4 +1,4 @@ -export default ` +export const template = ` <div *ngFor="let checkbox of checklistModel.checkboxes" #currentCheckbox> <div class="checkbox-item"> <sdc-checkbox [label]="checkbox.label" diff --git a/src/angular/checklist/checklist.component.ts b/src/angular/checklist/checklist.component.ts index 386cd3e..b512378 100644 --- a/src/angular/checklist/checklist.component.ts +++ b/src/angular/checklist/checklist.component.ts @@ -1,7 +1,7 @@ import { Component, EventEmitter, Input, Output } from "@angular/core"; import { ChecklistModel } from "./models/Checklist"; import { ChecklistItemModel } from "./models/ChecklistItem"; -import template from "./checklist.component.html"; +import { template } from "./checklist.component.html"; @Component({ selector: 'sdc-checklist', @@ -15,7 +15,7 @@ export class ChecklistComponent { // push/pop the checkbox value if (checkbox.isChecked) { currentChecklistModel.selectedValues.push(checkbox.value); - }else { + } else { const index: number = currentChecklistModel.selectedValues.indexOf(checkbox.value); currentChecklistModel.selectedValues.splice(index, 1); } diff --git a/src/angular/checklist/models/ChecklistItem.ts b/src/angular/checklist/models/ChecklistItem.ts index e2d812a..7b1b321 100644 --- a/src/angular/checklist/models/ChecklistItem.ts +++ b/src/angular/checklist/models/ChecklistItem.ts @@ -6,11 +6,13 @@ export class ChecklistItemModel { public value: any; public disabled: boolean; public isChecked: boolean; + public testId: string; public subLevelChecklist: ChecklistModel; - constructor(label: string, disabled?: boolean, isChecked?: boolean, subLevelChecklist?: ChecklistModel, value?: any) { + constructor(label: string, disabled?: boolean, isChecked?: boolean, subLevelChecklist?: ChecklistModel, testId?: string, value?: any) { this.label = label; this.disabled = disabled; this.isChecked = isChecked; + this.testId = testId; this.value = isUndefined(value) ? label : value; this.subLevelChecklist = subLevelChecklist; } |