first I got a Filter "fromMSDate" that I use to transform json dates not normal dates, if this filter is place then refresh my input that is bound to filterOptions.filterText I get 'Circular dependency' and 'Unknown provider: fromMSDate | dateFilterProvider <- fromMSDate '
//Module
var mainApp = angular.module('mainApp', ['ngGrid']);
//Controller
mainApp.controller('MandateListController', function MandateListController($scope) { $scope.filterOptions = { filterText: '' }; $scope.mandates = data; $scope.gridOptions = { data: "mandates", filterOptions: $scope.filterOptions, sortInfo: { fields: ['ExpectedDate', 'ProjectName'], directions: ['desc', 'asc'], columns: ['ExpectedDate', 'ProjectName'] }, columnDefs: [ { field: 'ProjectName', displayName: 'Project Name', width: '30%', cellClass: 'text-center' }, { field: 'Amount', displayName: 'Size', cellFilter: 'number:2', cellClass: 'text-right' }, { field: 'RatingId', displayName: 'Rating', cellClass: 'text-center' }, { field: 'CurrencyId', displayName: 'Currency', cellClass: 'text-center' }, { field: 'MaturityId', displayName: 'Maturity', cellClass: 'text-center' }, { field: 'EstimatedPl', displayName: 'Estimated P/L', cellFilter: 'number:2', cellClass: 'text-right' }, { field: 'ExpectedDate', displayName: 'Expected Date', cellClass: 'text-center', cellFilter: "fromMSDate | date:'mediumDate'" } ] }; });
//filter
mainApp.filter("fromMSDate", [function () { var result = function(date, formatstring) { if (formatstring === null || formatstring === undefined) { formatstring = "DD MMM YYYY"; } return moment(date).format(formatstring); }; return result; }]);
"fromMSDate"
filter anywhere, so according to this code, you shouldn't ever get the "Unknown Provider" error. You must have more code than what you've shown above. Somewhere you're injecting the "fromMSDate" filter. We need to see that code to know what other dependencies you have. – tennisgent