h2020-westlife-eu / virtualfolder

Virtual Folder
http://internal-wiki.west-life.eu/w/index.php?title=D6.1
MIT License
1 stars 0 forks source link

PDB autocomplete component based on Angular 2 not compatible with Aurelia framework. #30

Closed TomasKulhanek closed 7 years ago

TomasKulhanek commented 7 years ago

Adding autocomplete scripts to HTML

<!--  pdb autocomplet -->
  <script src="../scripts/autocomplete/inline.bundle.js"></script>
  <script src="../scripts/autocomplete/vendor.bundle.js"></script>
  <script src="../scripts/autocomplete/main.bundle.js"></script>
<!-- end pdb autocomplete -->

Cause the following:

cannot enable long stack traces after promises have been created    See http://goo.gl/MqrFmX"

originalStack:"y@http://localhost:9000/scripts/autocomplete/vendor.bundle.js:1279:2211
[7]</module.exports/Promise.longStackTraces@http://localhost:9000/scripts/vendor-bundle.js:638:1
[7]</module.exports/Promise.config@http://localhost:9000/scripts/vendor-bundle.js:772:13
@http://localhost:9000/scripts/app-bundle.js:532:1
newContext/context.execCb@http://localhost:9000/scripts/vendor-bundle.js:5432:24
newContext/Module.prototype.check@http://localhost:9000/scripts/vendor-bundle.js:4615:47
newContext/Module.prototype.enable@http://localhost:9000/scripts/vendor-bundle.js:4912:17
newContext/Module.prototype.init@http://localhost:9000/scripts/vendor-bundle.js:4525:21
callGetModule@http://localhost:9000/scripts/vendor-bundle.js:4939:17
newContext/context.completeLoad@http://localhost:9000/scripts/vendor-bundle.js:5326:21
newContext/context.onScriptLoad@http://localhost:9000/scripts/vendor-bundle.js:5453:21
P</P</t.prototype.invokeTask@http://localhost:9000/scripts/autocomplete/vendor.bundle.js:1279:9659
P</S</n.prototype.runTask@http://localhost:9000/scripts/autocomplete/vendor.bundle.js:1279:5351
t/this.invoke@http://localhost:9000/scripts/autocomplete/vendor.bundle.js:1279:10539
TomasKulhanek commented 7 years ago

Within vendor-bundle, there is declared bluebird.js config which may collide with Angular2 - setting the environment.js debug:false - leads to longStackTrace to be false as well and Aurelia APP bootstraps and shows correctly, however, pdb-autocomplete-component fails with another error:

Error: Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.
Most likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)
TomasKulhanek commented 7 years ago

Rewritten the autocomplete component into Aurelia framework. Basic functionality seems working. Code integrated into VF web UI.