Fórum

How to call my portlets action method from Angular Js 2

JB Shaik, modificado 7 Anos atrás.

How to call my portlets action method from Angular Js 2

Junior Member Postagens: 35 Data de Entrada: 22/03/17 Postagens Recentes
Hi,

I'm using Angular Js2 and Liferay 7.

I want to call to my action method in portlet on clicking of my submit button( Angular Js 2 ). I managed to do the same with JSP and it was pretty simple and it's working. I want to do the same from Angular Js 2.

Working JSP :

<portlet:actionurl name="submitAction" var="submitActionURL"></portlet:actionurl>
<form action="${submitActionURL}" method="post">

<div>
<input type="submit" value="Submit Action" class="submit">
</div>
</form>


===============================================================================
I'm having issues with below code.

I added this in my view.jsp

<portlet:actionurl name="submitAction" var="submitActionURL"></portlet:actionurl>


And my html included in ts file has below code.

<form action="${submitActionURL}">
<div>
<input type="submit" value="Submit Action" class="submit">
</div>
</form>


Can you please assist.
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: How to call my portlets action method from Angular Js 2

Liferay Legend Postagens: 14918 Data de Entrada: 02/09/06 Postagens Recentes
You shouldn't.

The action phase is part of a full lifecycle event of action -> render and that will throw out your whole angular context.

Instead you should be building out resource request handlers which can be invoked from the browser w/o involving a full portlet lifecycle event.
JB Shaik, modificado 7 Anos atrás.

RE: How to call my portlets action method from Angular Js 2

Junior Member Postagens: 35 Data de Entrada: 22/03/17 Postagens Recentes
Thanks David for the info.

Do you perhaps have an example for 'resource request handlers' in Liferay.
thumbnail
Ravi Darji, modificado 6 Anos atrás.

RE: How to call my portlets action method from Angular Js 2

Junior Member Postagens: 56 Data de Entrada: 14/05/14 Postagens Recentes
Hi Shaik,

Its humble request to you that,
Can you please share the portlet source code for reference? as i am also doing R&D for integration Angular js 2 in liferay 7.
My mail id is ravs.liferay@gmail.com

your help would be appreciated.

Thanks & Regards,
Ravi Darji
JB Shaik, modificado 6 Anos atrás.

RE: How to call my portlets action method from Angular Js 2

Junior Member Postagens: 35 Data de Entrada: 22/03/17 Postagens Recentes
Hi Ravi,

Sorry man. I haven't built that part yet. I was just busy with other stuff.

I will try and let you know If I come right with it. In meantime, please let me know If you are winning with this.
thumbnail
Ravi Darji, modificado 6 Anos atrás.

RE: How to call my portlets action method from Angular Js 2

Junior Member Postagens: 56 Data de Entrada: 14/05/14 Postagens Recentes
Sure JB Shaik