Sean Condon | 83fc39f | 2018-04-19 18:56:13 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014-present Open Networking Foundation |
| 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 | import { BrowserModule } from '@angular/platform-browser'; |
| 17 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; |
| 18 | import { NgModule } from '@angular/core'; |
| 19 | import { RouterModule, Routes } from '@angular/router'; |
| 20 | |
| 21 | import { AppsModule } from './view/apps/apps.module'; |
| 22 | import { DeviceModule } from './view/device/device.module'; |
| 23 | |
| 24 | import { LayerModule } from './fw/layer/layer.module'; |
| 25 | import { MastModule } from './fw/mast/mast.module'; |
| 26 | import { NavModule } from './fw/nav/nav.module'; |
| 27 | import { SvgModule } from './fw/svg/svg.module'; |
| 28 | import { RemoteModule } from './fw/remote/remote.module'; |
| 29 | import { UtilModule } from './fw/util/util.module'; |
| 30 | import { WidgetModule } from './fw/widget/widget.module'; |
| 31 | |
| 32 | import { AppsComponent } from './view/apps/apps.component'; |
| 33 | import { DeviceComponent } from './view/device/device.component'; |
| 34 | import { OnosComponent } from './onos.component'; |
| 35 | import { DetectBrowserDirective } from './detectbrowser.directive'; |
| 36 | |
| 37 | import { ConsoleLoggerService } from './consolelogger.service'; |
| 38 | import { LogService } from './log.service'; |
| 39 | import { OnosService } from './onos.service'; |
| 40 | |
| 41 | const onosRoutes: Routes = [ |
| 42 | { path: 'apps', component: AppsComponent }, // All except default should be driven by |
| 43 | { path: 'device', component: DeviceComponent }, // servlet like {INJECTED-VIEW-DATA-START} |
| 44 | { path: '**', component: DeviceComponent } //Change to Topo(2) when it's ready for normal behaviour |
| 45 | ] |
| 46 | |
| 47 | /** |
| 48 | * ONOS GUI -- Main Application Module |
| 49 | */ |
| 50 | @NgModule({ |
| 51 | declarations: [ |
| 52 | OnosComponent, |
| 53 | DetectBrowserDirective |
| 54 | ], |
| 55 | imports: [ |
| 56 | AppsModule, |
| 57 | DeviceModule, |
| 58 | BrowserModule, |
| 59 | BrowserAnimationsModule, |
| 60 | LayerModule, |
| 61 | MastModule, |
| 62 | NavModule, |
| 63 | RouterModule.forRoot(onosRoutes, { enableTracing: false }), |
| 64 | SvgModule, |
| 65 | RemoteModule, |
| 66 | UtilModule, // For OnosComponent |
| 67 | WidgetModule |
| 68 | ], |
| 69 | providers: [ |
| 70 | OnosService, |
| 71 | { provide: LogService, useClass: ConsoleLoggerService }, |
| 72 | { provide: Window, useValue: window } |
| 73 | ], |
| 74 | bootstrap: [ |
| 75 | OnosComponent, |
| 76 | ] |
| 77 | }) |
| 78 | export class OnosModule { } |