g_form in Widget Angular Provider

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2022 11:45 PM
Hi All,
I have a requirement in my project in which I am using Widget Angular Provider, where I am creating provider of "Type:Service". In this I am doing a Ajax using $.ajax({}); inside which I need to have g_form object.
I am unable to use g_form in Angular Provider, please let me know how can I achieve the same.
Regards,
Deepika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 01:40 AM
Hi!
Don't think g_form is directly available on angular providers as it isn't also on the widget clients script.
You can try something like the below as it may apply in your context:
var g_form;
if (angular.isDefined($scope.getGlideForm))
g_form = $scope.getGlideForm();
I hope it helps!
Pedro

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 02:24 AM
Hi Pedro,
I tried this way but then it is giving error for "scope"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2022 03:36 AM
Hi,
You will have to bring the $scope (or scope) to the angular provider.
Have a look at the same code on the OOB directive "spTiny" (/sp_angular_provider.do?sys_id=75cadef20fa70010c43d008c07767e8b)
I hope it helps!