Skip to content

Instantly share code, notes, and snippets.

@SirajGadhia
Created January 30, 2016 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SirajGadhia/0064b2e94d9e0cd9aeb6 to your computer and use it in GitHub Desktop.
Save SirajGadhia/0064b2e94d9e0cd9aeb6 to your computer and use it in GitHub Desktop.
//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