Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//http://www.siraj360.com/ng2/ :: A single page application developed with Angular 2 (beta) and Bootstrap 4 (alpha).
import { Component, Input } from 'angular2/core';
import { CORE_DIRECTIVES } from 'angular2/common';
import { RouterLink } from 'angular2/router';
@Component({
selector: 'employee',
templateUrl: 'app/components/employee/employee.component.html',
directives: [CORE_DIRECTIVES, RouterLink]
})
export class EmployeeComponent {
@Input() employee: any;
@Input('sr-no') srNo: number;
changeComplete(Course: any) {
//debugger;
Course.isComplete = !Course.isComplete;
this.employee.isAllPending = true;
this.employee.isAllCompleted = true;
for (var i = 0; i < this.employee.EmployeeCourses.length; i++) {
if (this.employee.EmployeeCourses[i].isComplete) {
this.employee.isAllPending = false;
} else {
this.employee.isAllCompleted = false;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment