Enabled --prod mode for GUI2 - refactored modules

Change-Id: I224fe9564cb225b9ebaed0a43281de54ec6eb274
diff --git a/web/gui2/src/main/webapp/app/fw/util/ee.service.ts b/web/gui2/src/main/webapp/app/fw/util/ee.service.ts
index c16e4d1..8e1d87c 100644
--- a/web/gui2/src/main/webapp/app/fw/util/ee.service.ts
+++ b/web/gui2/src/main/webapp/app/fw/util/ee.service.ts
@@ -19,7 +19,9 @@
 /**
  * ONOS GUI -- Util -- EE functions
  */
-@Injectable()
+@Injectable({
+  providedIn: 'root',
+})
 export class EeService {
 
   constructor(
diff --git a/web/gui2/src/main/webapp/app/fw/util/fn.service.ts b/web/gui2/src/main/webapp/app/fw/util/fn.service.ts
index 7b9ea24..d0307e3 100644
--- a/web/gui2/src/main/webapp/app/fw/util/fn.service.ts
+++ b/web/gui2/src/main/webapp/app/fw/util/fn.service.ts
@@ -149,7 +149,9 @@
 /**
  * ONOS GUI -- Util -- General Purpose Functions
  */
-@Injectable()
+@Injectable({
+  providedIn: 'root',
+})
 export class FnService {
     // internal state
     private debugFlags = new Map<string, boolean>([
@@ -159,14 +161,14 @@
     constructor(
         private route: ActivatedRoute,
         private log: LogService,
-        @Inject(Window) private w: Window
+        @Inject('Window') private w: Window
     ) {
         this.route.queryParams.subscribe(params => {
             const debugparam: string = params['debug'];
             log.debug('Param:', debugparam);
             this.parseDebugFlags(debugparam);
         });
-        log.debug('FnService constructed');
+        this.log.debug('FnService constructed');
     }
 
     /**
diff --git a/web/gui2/src/main/webapp/app/fw/util/key.service.ts b/web/gui2/src/main/webapp/app/fw/util/key.service.ts
index b10b643..1eaa895 100644
--- a/web/gui2/src/main/webapp/app/fw/util/key.service.ts
+++ b/web/gui2/src/main/webapp/app/fw/util/key.service.ts
@@ -20,7 +20,9 @@
 /**
  * ONOS GUI -- Util -- Key Handler Service
  */
-@Injectable()
+@Injectable({
+  providedIn: 'root',
+})
 export class KeyService {
 
     constructor(
diff --git a/web/gui2/src/main/webapp/app/fw/util/prefs.service.ts b/web/gui2/src/main/webapp/app/fw/util/prefs.service.ts
index 3cef9b6..f696125 100644
--- a/web/gui2/src/main/webapp/app/fw/util/prefs.service.ts
+++ b/web/gui2/src/main/webapp/app/fw/util/prefs.service.ts
@@ -21,7 +21,9 @@
 /**
  * ONOS GUI -- Util -- User Preference Service
  */
-@Injectable()
+@Injectable({
+  providedIn: 'root',
+})
 export class PrefsService {
 
     constructor(
diff --git a/web/gui2/src/main/webapp/app/fw/util/random.service.ts b/web/gui2/src/main/webapp/app/fw/util/random.service.ts
index 5ec71b5..d808e48 100644
--- a/web/gui2/src/main/webapp/app/fw/util/random.service.ts
+++ b/web/gui2/src/main/webapp/app/fw/util/random.service.ts
@@ -20,7 +20,9 @@
 /**
  * ONOS GUI -- Random -- Encapsulated randomness
  */
-@Injectable()
+@Injectable({
+  providedIn: 'root',
+})
 export class RandomService {
 
     constructor(
diff --git a/web/gui2/src/main/webapp/app/fw/util/theme.service.ts b/web/gui2/src/main/webapp/app/fw/util/theme.service.ts
index e5c9564..fe85766 100644
--- a/web/gui2/src/main/webapp/app/fw/util/theme.service.ts
+++ b/web/gui2/src/main/webapp/app/fw/util/theme.service.ts
@@ -20,7 +20,9 @@
 /**
  * ONOS GUI -- Util -- Theme Service
  */
-@Injectable()
+@Injectable({
+  providedIn: 'root',
+})
 export class ThemeService {
     themes: string[] = ['light', 'dark'];
     thidx = 0;
diff --git a/web/gui2/src/main/webapp/app/fw/util/util.module.ts b/web/gui2/src/main/webapp/app/fw/util/util.module.ts
deleted file mode 100644
index 293d8e9..0000000
--- a/web/gui2/src/main/webapp/app/fw/util/util.module.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2014-present Open Networking Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-
-import { EeService } from './ee.service';
-import { FnService } from './fn.service';
-import { KeyService } from './key.service';
-import { LionService } from './lion.service';
-import { PrefsService } from './prefs.service';
-import { RandomService } from './random.service';
-import { ThemeService } from './theme.service';
-
-/**
- * ONOS GUI -- Utilities Module
- */
-@NgModule({
-  imports: [
-    CommonModule
-  ],
-  declarations: [],
-  providers: [
-    EeService,
-    FnService,
-    KeyService,
-    LionService,
-    PrefsService,
-    RandomService,
-    ThemeService
-  ]
-})
-export class UtilModule { }