penambahan edit routing monitoring building
This commit is contained in:
		
							parent
							
								
									3cd43f3cc5
								
							
						
					
					
						commit
						5fa8e2314d
					
				| @ -112,6 +112,7 @@ | |||||||
|                     class="btn btn-float btn-square btn-outline-secondary" |                     class="btn btn-float btn-square btn-outline-secondary" | ||||||
|                     triggers="hover:click:hover" |                     triggers="hover:click:hover" | ||||||
|                     ngbTooltip="Edit" |                     ngbTooltip="Edit" | ||||||
|  |                     (click)="editRow(data)" | ||||||
|                   > |                   > | ||||||
|                     <i class="feather ft-edit"></i> |                     <i class="feather ft-edit"></i> | ||||||
|                   </button> |                   </button> | ||||||
| @ -120,6 +121,7 @@ | |||||||
|                     class="gap_fl_btn btn btn-float btn-square btn-float-lg btn-outline-primary" |                     class="gap_fl_btn btn btn-float btn-square btn-float-lg btn-outline-primary" | ||||||
|                     triggers="hover:click:hover" |                     triggers="hover:click:hover" | ||||||
|                     ngbTooltip="Detail" |                     ngbTooltip="Detail" | ||||||
|  |                     (click)="viewRow(data)" | ||||||
|                   > |                   > | ||||||
|                     <i class="la la-building"></i> |                     <i class="la la-building"></i> | ||||||
|                   </button> |                   </button> | ||||||
|  | |||||||
| @ -1,5 +1,6 @@ | |||||||
| import { Component } from "@angular/core"; | import { Component } from "@angular/core"; | ||||||
| import { TableMonitoringService } from "../monitoring.service"; | import { TableMonitoringService } from "../monitoring.service"; | ||||||
|  | import { Router } from "@angular/router"; | ||||||
| 
 | 
 | ||||||
| @Component({ | @Component({ | ||||||
|   selector: "app-building", |   selector: "app-building", | ||||||
| @ -16,7 +17,10 @@ export class BuildingComponent { | |||||||
|   searchTerm: string = ""; |   searchTerm: string = ""; | ||||||
|   colorChart: string = ""; |   colorChart: string = ""; | ||||||
| 
 | 
 | ||||||
|   constructor(private monitoringService: TableMonitoringService) {} |   constructor( | ||||||
|  |     private monitoringService: TableMonitoringService, | ||||||
|  |     private router: Router | ||||||
|  |   ) {} | ||||||
| 
 | 
 | ||||||
|   ngOnInit() { |   ngOnInit() { | ||||||
|     this.breadcrumb = { |     this.breadcrumb = { | ||||||
| @ -78,4 +82,12 @@ export class BuildingComponent { | |||||||
|         value !== null && value.toString().toLowerCase().includes(searchTermLC) |         value !== null && value.toString().toLowerCase().includes(searchTermLC) | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|  |   viewRow(row) { | ||||||
|  |     this.router.navigate(["/monitoring/view-new-building", row.build_name]); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   editRow(row) { | ||||||
|  |     this.router.navigate(["/monitoring/edit-new-building", row.build_name]); | ||||||
|  |   } | ||||||
| } | } | ||||||
|  | |||||||
| @ -62,6 +62,16 @@ import { DetailComponent } from './detail/detail.component'; | |||||||
|         component: AddNewBuildingRoomComponent, |         component: AddNewBuildingRoomComponent, | ||||||
|         data: { mode: 'build' } |         data: { mode: 'build' } | ||||||
|       }, |       }, | ||||||
|  |       { | ||||||
|  |         path: 'edit-new-building/:id', | ||||||
|  |         component: AddNewBuildingRoomComponent, | ||||||
|  |         data: { mode: 'build' } | ||||||
|  |       }, | ||||||
|  |       { | ||||||
|  |         path: 'view-new-building/:id', | ||||||
|  |         component: DetailComponent, | ||||||
|  |         data: { mode: 'build' } | ||||||
|  |       }, | ||||||
|     ]) |     ]) | ||||||
|   ] |   ] | ||||||
| }) | }) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user