akserg / ng2-slim-loading-bar

Angular 2 component shows slim loading bar at the top of the page.
MIT License
358 stars 93 forks source link

Question about AoT #39

Closed Richie765 closed 7 years ago

Richie765 commented 7 years ago

Thanks for sharing these great ng2 components. Forgive me if this is a silly question. I'm still learning Angular which sometimes gives me a hard time.

When I look in src/slim-loading-bar.component.js I can see the template HTML code in there. I can also find it in bundles/index.umd.js as well as in my end product (built with ng built --prod --aot).

I think that means that ngc didn't compile the template and it still needs to be compiled, probably in the browser. Which means slower startup times and the overhead of including the compiler client-side.

The templates of my own app-components cannot be found in the generated code, they seem to be compiled into JavaScript.

Since you know a lot more about Angular 2 than me. Is this correct? Is there a way to optimize this process?

Richie765 commented 7 years ago

After investigating more, this seems to be an issue with Angular. It doesn't strip the Metadata even-though it's no longer needed. So it's not an issue with your package.

akserg commented 7 years ago

Hi @Richie765 Interesting points. I will have a look.