Initial Commit - NG UI
[osm/NG-UI.git] / src / app / utilities / page-reload / PageReload.ts
1 /*
2  Copyright 2020 TATA ELXSI
3
4  Licensed under the Apache License, Version 2.0 (the 'License');
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7
8   http://www.apache.org/licenses/LICENSE-2.0
9
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15
16  Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
17 */
18 /**
19  * @file Page Reload Component
20  */
21 import { Component, Injector } from '@angular/core';
22 import { TranslateService } from '@ngx-translate/core';
23 import { SharedService } from 'SharedService';
24 /**
25  * Creating component
26  * @Component takes PageReload.html as template url
27  */
28 @Component({
29   selector: 'page-reload',
30   templateUrl: './PageReload.html',
31   styleUrls: ['./PageReload.scss']
32 })
33 /** Exporting a class @exports PageReload */
34 export class PageReload {
35   /** To inject services @public */
36   public injector: Injector;
37
38   /** handle translate @public */
39   public translateService: TranslateService;
40
41   /** Contains all methods related to shared @private */
42   private sharedService: SharedService;
43
44   constructor(injector: Injector) {
45     this.injector = injector;
46     this.translateService = this.injector.get(TranslateService);
47     this.sharedService = this.injector.get(SharedService);
48   }
49
50   /**
51    * Lifecyle Hooks the trigger before component is instantiate
52    */
53   public ngOnInit(): void {
54     // Empty Block
55   }
56
57   /** Handles select event @public */
58   public reloadPage(): void {
59     this.sharedService.dataEvent.emit();
60   }
61 }