blob: 717893ed5a293d1f6346bdf4dcfa4577c4599a51 [file] [log] [blame]
Sean Condon83fc39f2018-04-19 18:56:13 +01001/*
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 */
16import { BrowserModule } from '@angular/platform-browser';
17import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
18import { NgModule } from '@angular/core';
19import { RouterModule, Routes } from '@angular/router';
20
21import { AppsModule } from './view/apps/apps.module';
22import { DeviceModule } from './view/device/device.module';
23
24import { LayerModule } from './fw/layer/layer.module';
25import { MastModule } from './fw/mast/mast.module';
26import { NavModule } from './fw/nav/nav.module';
27import { SvgModule } from './fw/svg/svg.module';
28import { RemoteModule } from './fw/remote/remote.module';
29import { UtilModule } from './fw/util/util.module';
30import { WidgetModule } from './fw/widget/widget.module';
31
32import { AppsComponent } from './view/apps/apps.component';
33import { DeviceComponent } from './view/device/device.component';
34import { OnosComponent } from './onos.component';
35import { DetectBrowserDirective } from './detectbrowser.directive';
36
37import { ConsoleLoggerService } from './consolelogger.service';
38import { LogService } from './log.service';
39import { OnosService } from './onos.service';
40
41const 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})
78export class OnosModule { }