Enabled --prod mode for GUI2 - refactored modules

Change-Id: I224fe9564cb225b9ebaed0a43281de54ec6eb274
diff --git a/web/gui2/src/main/webapp/app/fw/remote/remote.module.ts b/web/gui2/src/main/webapp/app/fw/remote/remote.module.ts
deleted file mode 100644
index 179988d..0000000
--- a/web/gui2/src/main/webapp/app/fw/remote/remote.module.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2015-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 { SvgModule } from '../svg/svg.module';
-import { UtilModule } from '../util/util.module';
-
-import { UrlFnService } from './urlfn.service';
-import { WebSocketService } from './websocket.service';
-import { WSock } from './wsock.service';
-import { RestService } from './rest.service';
-
-/**
- * ONOS GUI -- Remote Communications Module
- */
-@NgModule({
-  imports: [
-    CommonModule,
-    SvgModule,
-    UtilModule
-  ],
-  providers: [
-    RestService,
-    UrlFnService,
-    WebSocketService,
-    WSock
-  ]
-})
-export class RemoteModule { }
diff --git a/web/gui2/src/main/webapp/app/fw/remote/rest.service.ts b/web/gui2/src/main/webapp/app/fw/remote/rest.service.ts
index 2d6bfa2..6fec638 100644
--- a/web/gui2/src/main/webapp/app/fw/remote/rest.service.ts
+++ b/web/gui2/src/main/webapp/app/fw/remote/rest.service.ts
@@ -21,7 +21,9 @@
 /**
  * ONOS GUI -- Remote Communications Module -- REST Service
  */
-@Injectable()
+@Injectable({
+  providedIn: 'root',
+})
 export class RestService {
 
   constructor(
diff --git a/web/gui2/src/main/webapp/app/fw/remote/urlfn.service.ts b/web/gui2/src/main/webapp/app/fw/remote/urlfn.service.ts
index 381a0c9..363663a 100644
--- a/web/gui2/src/main/webapp/app/fw/remote/urlfn.service.ts
+++ b/web/gui2/src/main/webapp/app/fw/remote/urlfn.service.ts
@@ -29,7 +29,7 @@
 export class UrlFnService {
     constructor(
         private log: LogService,
-        @Inject(Window) private w: Window
+        @Inject('Window') private w: Window
     ) {
         this.log.debug('UrlFnService constructed');
     }
diff --git a/web/gui2/src/main/webapp/app/fw/remote/websocket.service.ts b/web/gui2/src/main/webapp/app/fw/remote/websocket.service.ts
index 34a8ea9..18dd734 100644
--- a/web/gui2/src/main/webapp/app/fw/remote/websocket.service.ts
+++ b/web/gui2/src/main/webapp/app/fw/remote/websocket.service.ts
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import { Injectable } from '@angular/core';
+import { Injectable, Inject } from '@angular/core';
 import { FnService } from '../util/fn.service';
 import { GlyphService } from '../svg/glyph.service';
 import { LogService } from '../../log.service';
@@ -129,7 +129,7 @@
         private log: LogService,
         private ufs: UrlFnService,
         private wsock: WSock,
-        private window: Window
+        @Inject('Window') private window: Window
     ) {
         this.log.debug(window.location.hostname);