2016-06-09 13:00:26 -05:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// #docregion
							 | 
						
					
						
							
								
									
										
										
										
											2016-07-16 17:34:26 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								import { Injectable }    from '@angular/core';
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-09 13:00:26 -05:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								import { CanDeactivate } from '@angular/router';
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								import { Observable }    from 'rxjs/Observable';
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								export interface CanComponentDeactivate {
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-26 23:19:27 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 canDeactivate: () => Observable<boolean> | Promise<boolean> | boolean;
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-09 13:00:26 -05:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-07-16 17:34:26 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								@Injectable()
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-09 13:00:26 -05:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								export class CanDeactivateGuard implements CanDeactivate<CanComponentDeactivate> {
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-26 23:19:27 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  canDeactivate(component: CanComponentDeactivate) {
							 | 
						
					
						
							
								
									
										
										
										
											2016-06-09 13:00:26 -05:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    return component.canDeactivate ? component.canDeactivate() : true;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 |