g_form in Widget Angular Provider

Deepika Mishra
Mega Guru

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

3 REPLIES 3

Pedro Grilo1
Mega Sage

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

Hi Pedro,

I tried this way but then it is giving error for "scope"

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!