Angular ng-model returns undefined

I am working on an old project and there is a problem with the filters.
So this is the html part.

<input type="text" class="form-control" ng-model="FilterEventsEdit"
       ng-change="FilterEvents()"
       style="width: 300px; margin-bottom: 5px; display: inline;">

And here is the JS

$scope.FilterEvents = function () {
    $scope.EventsGridDataSource.filter({
        logic: "or",
        filters: [
            { field: "Name", operator: "contains",
              value: $scope.FilterEventsEdit },
            { field: "Expression", operator: "contains",
              value: $scope.FilterEventsEdit }
        ]
    });
};

I always get the $scope.FilterEventsEdit as undefined.
I have the same logic, but with different models, and they are working. Can’t find what is the problem here.

106 thoughts on “Angular ng-model returns undefined”

Leave a Comment