Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

m.e.i.n.e.l for statistics #13

Open
flowirtz opened this issue Jul 3, 2017 · 2 comments
Open

m.e.i.n.e.l for statistics #13

flowirtz opened this issue Jul 3, 2017 · 2 comments

Comments

@flowirtz
Copy link
Contributor

flowirtz commented Jul 3, 2017

Add the m.e.i.n.e.l-project which provides polymer components for easily displaying statistics from data APIs.

Main problem: Use Polymer components in Angular 2.

@flowirtz
Copy link
Contributor Author

Well...
Here is the deal: I attempted to include the meinel-components in multiple ways now. The most promising seems to be following this guide.
Apart from the guide being kinda outdated and not working fully, especially the delay in loading by using main-polymer.ts the polymer cli complains about the missing bootstrapModule (fixed below), I am facing one major issue:

The major issue

ERROR in Error encountered resolving symbol values statically. Calling function 'PolymerElement', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in /Users/ping/Desktop/Git/jenz/src/app/app.module.ts, resolving symbol AppModule in /Users/ping/Desktop/Git/jenz/src/app/app.module.ts

which basically means that PolymerElement('barchart-basic') in app.module.ts fails.

If you google that, you get a couple hints, but angular-cli guys basically say that this won't be supported anymore. A bummer.

How to fix

Either, figure out a way to bypass the mentioned error (maybe by exporting them by hand), or find a completely different way to turn Polymer components into angular2 ones in general.

Every change leading to this error is shown in the add-meinel branch.

@flowirtz
Copy link
Contributor Author

How to bypass bootstrapModule() missing

This. is. ugly.
Yes.
But it works and I don't see a better way atm thanks to angular cli.

// Ugly hack to convince Angular CLI that we call bootstrapModule somewhere
const hackThis = false;
if (hackThis) {
  platformBrowserDynamic().bootstrapModule(AppModule);
}

in main-polymer.ts

@flowirtz flowirtz removed their assignment Jul 23, 2017
flowirtz added a commit that referenced this issue Jul 23, 2017
BROKEN COMMIT - WONT BUILD

See #13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant