留言板

How to call my portlets action method from Angular Js 2

JB Shaik,修改在7 年前。

How to call my portlets action method from Angular Js 2

Junior Member 帖子: 35 加入日期: 17-3-22 最近的帖子
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,修改在7 年前。

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

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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,修改在7 年前。

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

Junior Member 帖子: 35 加入日期: 17-3-22 最近的帖子
Thanks David for the info.

Do you perhaps have an example for 'resource request handlers' in Liferay.
thumbnail
Ravi Darji,修改在6 年前。

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

Junior Member 帖子: 56 加入日期: 14-5-14 最近的帖子
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,修改在6 年前。

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

Junior Member 帖子: 35 加入日期: 17-3-22 最近的帖子
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,修改在6 年前。

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

Junior Member 帖子: 56 加入日期: 14-5-14 最近的帖子
Sure JB Shaik