| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 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 SDN Controller module. |
| 20 | */ |
| 21 | import { CommonModule } from '@angular/common'; |
| 22 | import { HttpClientModule } from '@angular/common/http'; |
| 23 | import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; |
| 24 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; |
| 25 | import { RouterModule, Routes } from '@angular/router'; |
| 26 | import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; |
| 27 | import { NgSelectModule } from '@ng-select/ng-select'; |
| 28 | import { TranslateModule } from '@ngx-translate/core'; |
| 29 | import { DataService } from 'DataService'; |
| 30 | import { LoaderModule } from 'LoaderModule'; |
| 31 | import { NewSDNControllerComponent } from 'NewSDNControllerComponent'; |
| 32 | import { Ng2SmartTableModule } from 'ng2-smart-table'; |
| 33 | import { PagePerRowModule } from 'PagePerRowModule'; |
| 34 | import { PageReloadModule } from 'PageReloadModule'; |
| 35 | import { SDNControllerComponent } from 'SDNControllerComponent'; |
| 36 | import { SDNControllerDetailsComponent } from 'SDNControllerDetailsComponent'; |
| 37 | import { SDNControllerInfoComponent } from 'SDNControllerInfoComponent'; |
| 38 | |
| 39 | /** To halndle project information */ |
| SANDHYA.JS | a055cd9 | 2023-05-10 18:23:06 +0530 | [diff] [blame] | 40 | const projectInfo: {} = sessionStorage.getItem('project') !== null ? { title: sessionStorage.getItem('project'), url: '/' } : {}; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 41 | |
| 42 | /** |
| 43 | * configures routers |
| 44 | */ |
| 45 | const routes: Routes = [ |
| 46 | { |
| 47 | path: '', |
| 48 | component: SDNControllerComponent, |
| 49 | children: [ |
| 50 | { |
| 51 | path: 'details', |
| 52 | data: { |
| 53 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 54 | projectInfo, { title: 'SDNCONTROLLER', url: null }] |
| 55 | }, |
| 56 | component: SDNControllerDetailsComponent |
| 57 | } |
| 58 | ] |
| 59 | } |
| 60 | ]; |
| 61 | |
| 62 | /** |
| 63 | * Creating @NgModule component for Modules |
| 64 | */ |
| 65 | @NgModule({ |
| 66 | imports: [ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: 'never' }), FormsModule, CommonModule, |
| 67 | HttpClientModule, NgSelectModule, Ng2SmartTableModule, TranslateModule, RouterModule.forChild(routes), NgbModule, |
| 68 | PagePerRowModule, LoaderModule, PageReloadModule], |
| 69 | declarations: [SDNControllerComponent, SDNControllerDetailsComponent, SDNControllerInfoComponent, NewSDNControllerComponent], |
| 70 | providers: [DataService], |
| 71 | entryComponents: [SDNControllerInfoComponent, NewSDNControllerComponent], |
| 72 | schemas: [CUSTOM_ELEMENTS_SCHEMA] |
| 73 | }) |
| 74 | /** Exporting a class @exports SDNControllerModule */ |
| 75 | export class SDNControllerModule { |
| 76 | /** |
| 77 | * Lifecyle Hooks the trigger before component is instantiate |
| 78 | */ |
| 79 | public ngOnInit(): void { |
| 80 | //Empty Class |
| 81 | } |
| 82 | } |