LP#1775466 Dynamic module as angular element experiment cleanup collab/berick/lp1775466-ang6-base-app-plus-dynamic-mod
authorBill Erickson <berickxx@gmail.com>
Thu, 14 Jun 2018 19:18:42 +0000 (15:18 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 14 Jun 2018 19:18:44 +0000 (15:18 -0400)
Note the zone.js error when loading is under repair:

https://github.com/angular/angular/issues/24466

Signed-off-by: Bill Erickson <berickxx@gmail.com>
.gitignore
Open-ILS/src/eg2/angular.json
Open-ILS/src/eg2/package.json
Open-ILS/src/eg2/src/index.html
Open-ILS/src/eg2/src/polyfills.ts

index bfcf501..8c16da5 100644 (file)
@@ -361,3 +361,4 @@ Open-ILS/web/js/ui/default/staff/node_modules/
 Open-ILS/web/js/ui/default/staff/bower_components/
 Open-ILS/web/js/ui/default/common/build/
 Open-ILS/web/eg2/
+Open-ILS/web/eg2-dynamic/
index 3218f85..c8779b9 100644 (file)
         "build": {
           "builder": "@angular-devkit/build-angular:browser",
           "options": {
-            "outputPath": "../../web/eg2/dynamic",
+            "outputPath": "../../web/eg2-dynamic",
             "index": "src/dynamic.html",
             "main": "src/dynamic.ts",
             "tsConfig": "src/tsconfig.app.json",
index 703ed6e..82024bb 100644 (file)
@@ -24,6 +24,7 @@
     "@angular/platform-browser-dynamic": "6.0.1",
     "@angular/router": "6.0.1",
     "@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.5",
+    "@webcomponents/webcomponentsjs": "^2.0.1",
     "core-js": "^2.4.1",
     "ngx-cookie": "^2.0.1",
     "rxjs": "^6.1.0",
index eb5a20d..402c8ef 100644 (file)
   <script src="/js/dojo/opensrf/opensrf.js"></script>
   <script src="/js/dojo/opensrf/opensrf_ws.js"></script>
   <!-- import the dynamic Angular Element component -->
-  <script type="text/javascript" src="/eg2/dynamic/runtime.js"></script>
-
   <!-- probably don't need styles ... -->
-
-<script>
-  // https://github.com/stackblitz/core/issues/475
-       (function () {
-       'use strict';
-
-       (()=>{if(!window.customElements)return;const a=window.HTMLElement,b=window.customElements.define,c=window.customElements.get,d=new Map,e=new Map;let f=!1,g=!1;window.HTMLElement=function(){if(!f){const a=d.get(this.constructor),b=c.call(window.customElements,a);g=!0;const e=new b;return e}f=!1;}, window.HTMLElement.prototype=a.prototype;Object.defineProperty(window,'customElements',{value:window.customElements,configurable:!0,writable:!0}), Object.defineProperty(window.customElements,'define',{value:(c,h)=>{const i=h.prototype,j=class extends a{constructor(){super(), Object.setPrototypeOf(this,i), g||(f=!0, h.call(this)), g=!1;}},k=j.prototype;j.observedAttributes=h.observedAttributes, k.connectedCallback=i.connectedCallback, k.disconnectedCallback=i.disconnectedCallback, k.attributeChangedCallback=i.attributeChangedCallback, k.adoptedCallback=i.adoptedCallback, d.set(h,c), e.set(c,h), b.call(window.customElements,c,j);},configurable:!0,writable:!0}), Object.defineProperty(window.customElements,'get',{value:a=>e.get(a),configurable:!0,writable:!0});})();
-       /**
-       @license
-       Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
-       This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
-       The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
-       The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
-       Code distributed by Google as part of the polymer project is also
-       subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-       */
-       }());
-</script>
-
-  <script type="text/javascript" src="/eg2/dynamic/polyfills.js"></script>
-  <script type="text/javascript" src="/eg2/dynamic/styles.js"></script>
-  <script type="text/javascript" src="/eg2/dynamic/vendor.js"></script>
-  <script type="text/javascript" src="/eg2/dynamic/main.js"></script>
+  <script type="text/javascript" src="/eg2-dynamic/runtime.js"></script>
+  <script type="text/javascript" src="/eg2-dynamic/polyfills.js"></script>
+  <!--
+  <script type="text/javascript" src="/eg2-dynamic/styles.js"></script>
+  -->
+  <script type="text/javascript" src="/eg2-dynamic/vendor.js"></script>
+  <script type="text/javascript" src="/eg2-dynamic/main.js"></script>
   <!-- END import the dynamic Angular Element component -->
 
 </body>
index a7822cd..e5b314a 100644 (file)
@@ -64,6 +64,12 @@ import 'core-js/es7/reflect';
 import 'zone.js/dist/zone';  // Included with Angular CLI.
 
 
+/**
+ * Required fro Web components / Angular Elements
+ */
+import '@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js';
+
+
 /***************************************************************************************************
  * APPLICATION IMPORTS
  */