custom form widget with a button, but the ng-click not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2018 02:58 PM
Hi Experts,
I need to add a Cancel button form, so I cloned the form, and simply added a button, a function to be triggered, nothing else changed, but it seems the ng-click is not fire, i.e the function is not called by click the button, not sure if I miss anything trivial stuff?
Thanks for any help!
Jerry
Here are the codes:
HTML part: added:
<span>
<button class="test" ng-click="confirmDelete()">
<span> Cancel </span> <span class="glyphicon glyphicon-trash"></span>
</button>
</span>
Client script part, added:
function confirmDelete(){
//spModal.alert('How do you feel today?');
spUtil.addInfoMessage("Hello, from confirm delete");
}
the button shows on the form from the portal at the position I want:, but nothing happen when clicking it
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2018 03:02 PM
Can you try this
function confirmDelete(){
//spModal.alert('How do you feel today?');
alert("Hello, from confirm delete");
}
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2018 03:12 PM
Hi,
just tried, still not working. however, the function itself does work since I added the following in the client script part, it does generate the message even with my previous spUtil API when the page is reloaded, but the click still does nothing:
//add debug message here
spUtil.addInfoMessage("Hello, from the client script");
confirmDelete();
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2018 03:37 PM
Confirm if you added this script to the client controller in the widget
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2018 11:52 PM