wannabegeek / ng2-split-pane

Split View module for Angular 2
MIT License
43 stars 25 forks source link

Component attribute on abstract class break AOT compilation #4

Closed cpa-level-it closed 7 years ago

cpa-level-it commented 7 years ago

I think the component attribute on the classes SplitSeparatorComponent and SplitPaneComponent breaks the AOT compilation.

At least in my case when I compile it I have the following error ;

ERROR in No template specified for component SplitSeparatorComponent

When I remove the attribute the compilation works.

I don't know if it's applicable for everyone as I'm directly using your .ts files in my solution instead of importing the npm package.

wannabegeek commented 7 years ago

Sorry for the delay, but I think this is an angular bug. I can fix some of the warnings/errors, but AOT build breaks on abstract classes, which I can't set in the declarations section of the NgModule. See, https://github.com/angular/angular/issues/13590

vstoykov commented 7 years ago

@wannabegeek Is @Componenet really needed for the abstract class. Is it possible to compile correctly without it. Only real components need it.

@cpa-level-it I have some troubles with trying to make a PR with AOT compilation enabled because I'm trying to use angular since recently and I'm not very proficient at it. I changed to many files and probably messes something.

Can you provide a PR with your changes?

simongregersen commented 7 years ago

@vstoykov: In the way that the class is implemented, yes @Componentis needed, as the implementation of the abstract class heavily uses Angular decorators (@Input, @Output, and @ViewChield). It may be an 'issue' with the AOT transpiler (as it works with JIT), or simply the fact that you can't declare components that are defined by an abstract class.

simongregersen commented 7 years ago

I got a somehow proper solution up and running, sending a PR ASAP.