-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
@ViewChild(WizardComponent) not working with AOT build #131
Comments
ID References are working |
I am accessing the |
That's kinda strange, I also caught the same error and hopefully found this issue. For me, string reference works as expected, but it's really interesting why the problem appears. |
I recently ran into this issue with my own Angular modules that I was creating for my company. The problem seems to stem from using barrel index.ts files when exporting components from the public_api.ts (guessing you're using index.ts naming convention) file. Not sure why but I'm guessing it's how the declaration file is built. The way I fixed it was just to do a straight export for each component and then @ViewChild(className) works. |
@ZachRHale what do you mean by |
That wasn't very descriptive was it? For instance, if we have a components folder with an index.ts that exports each component components/index.ts
then in the public_api.ts we export all from
then the @ViewChild(className) will NOT work with an AOT build Instead, which is somewhat of a pain-in-the-ass, if you export each component from the direct path (maybe better than my straight export terminology) then @ViewChild(className) will work correctly with AOT. public_api.ts (correct)
|
Fixed with Pull Request #184 |
I've just released |
Hi,
My application is on Angular 6.0.5 and uses "angular-archwizard": "^3.0.0". I am handling wizard navigation in my TypeScript component for which I have a
@ViewChild(WizardComponent) public wizard: WizardComponent;
reference.
This works fine with JIT compilation. However when using --prod flag, I get the following error
This is my code:
this.wizard
is undefined.Kind regards,
Thorsten
The text was updated successfully, but these errors were encountered: