I'm currently developing a messaging feature within a Chat application
that facilitates communication between logged in users via the Web Socket protocol
. In order to enhance user interaction, I am looking to incorporate a reply option into each message. I attempted to nest a link tagged with reply
within the message, along with an angular
tag using ng-click
to trigger a modal window for replying (as shown below).
The ng-click
content consists of a function that takes the message ID as input for replying.
However, my issue arises when clicking on reply
- the reply modal appears but the designated function is not executed!
Below is the snippet from ChatEndPoint.java
:
String m="<div>
<div>" +
_content
+ "</div>
<a href='#' data-toggle='modal' data-target='#replyModal'
ng-click='storemsgid("+_msgid+")'><small>reply</small></a>
</div> ";
Key Points:
- The variable
_content
holds a String value and_msgid
contains an Integer value. _content
is displayed in the chat console.- A function called
storemsgid(id)
exists in the HTML page, which is functional and not causing issues. - The new message will be added to the chat console (contained within a
div
tag) with its ownng-controller
, including thestoremsgid(id)
function.
I would greatly appreciate any assistance or guidance on this matter.
Thank you