M
M
mletov2016-10-21 16:35:14
Angular
mletov, 2016-10-21 16:35:14

What are the scopes of $http? Why does undefined come with an event from the grid, but not with an event from the button?

Please tell me
there is a button

<button class="btn btn-primary" ng-click="formKontragentWork_Delete(123)" onclick="return false;">Удалить</button>

and there is ui grid, in which this function is also called in Cell Template
{
                    field: 'id', name: '', enableFiltering: false, cellTemplate: "<button type=\"button\" class=\"btn btn-xs btn-danger\" ng-click=\"grid.appScope.formKontragentWork_Delete(row.entity.id)\"><i class=\"fa fa-remove\">Удалить</i></button> ", width: 80
                }

and here is an interesting situation: in the first case, the function works fine, and in the second, an empty $http (undefined) comes into it, it is not possible to execute an ajax request in the function body. How can this be?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question