Calling Parent Component through Nested Component

16 views
Skip to first unread message

Turkel

unread,
Oct 15, 2017, 4:03:14 PM10/15/17
to Angular and AngularJS discussion
Hi All,

I have an issue with calling a function of the Parent component, from the Nested component which is created by the Component() Angular function. Please see my component code:

Find Comments "//<-- Want to Call this function" and "//<-- Want to call Parent Component function here".

I need to post form data generated by nested component there are I need OnSubmit to be functional. On Submit should get form data post to server and print page by calling PrintPage function again. So PrintPage function would be refreshed on every return from server.
Actually I am calling own function in my code but let me know if there are any better way of doing this.


Regards,
Turkel.

Sander Elias

unread,
Oct 16, 2017, 1:58:56 AM10/16/17
to Angular and AngularJS discussion
Hi Trukel,

That is not how you should create a dynamic object. You will soon run into all kinds off edge-cases. Also, this demands the compiler to be loaded. That means you can't use AOT compiling, which will be the default in Angular version 5(very likely, might be V6) 
For now, this is the answer. But if you can wait, you might be able to use the angular-to-webcomponents compiler that's experimental now.

Regards
Sander

Turkel

unread,
Oct 16, 2017, 3:41:49 AM10/16/17
to Angular and AngularJS discussion
Hi,

You mean I will not be able to use AOT on Angular V5 ? this will not solve the issue :S I see Angular V5 will out on 18th of September so waiting is OK for me.
Any documentation for new version of Angular regarding to compiler?


Regards,
Turkel.

Reply all
Reply to author
Forward
0 new messages