Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <tr *ngFor="let project of projects">
- <td>{{ project.name }}</td>
- <td>{{ project.description }}</td>
- <td>
- <button type="button" class="btn btn-sm btn-primary bigger" (click)="onEditProject(project.id)"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Edit</button>
- </td>
- <td>
- <ng-container *ngIf="getProjectType(project.id)">
- <ng-template *ngIf="getProjectType(project.id) === 'new'">
- <button type="button" class="btn btn-sm btn-primary" (click)="onCreateBOM(project.id)"><i class="fa fa-plus-circle" aria-hidden="true"></i> Create Bill of Material</button>
- </ng-template>
- <ng-template *ngIf="getProjectType(project.id) === 'exist'">
- <button type="button" class="btn btn-sm btn-success" (click)="onEditBOM(project.id)"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Edit Bill of Material</button>
- </ng-template>
- </ng-container>
- </td>
- </tr>
- public getProjectType(project_id): 'new' | 'exist' | null {
- return project_id.material_projects.id === project_id ? 'new'
- : project_id.material_projects.id === project_id ? 'exist'
- : null;
- }
Add Comment
Please, Sign In to add comment