From 8f2870a9e492180bdce8178cd602a6a1ff70787b Mon Sep 17 00:00:00 2001 From: Christian Crowhurst Date: Sun, 27 Nov 2016 18:38:28 +0000 Subject: [PATCH] docs(EventsChannel): additional code comments --- src/core/public-interfaces.ts | 77 ++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/src/core/public-interfaces.ts b/src/core/public-interfaces.ts index 5835c558..a7cbfc09 100644 --- a/src/core/public-interfaces.ts +++ b/src/core/public-interfaces.ts @@ -572,6 +572,10 @@ export interface IUnregistrationFunc { * Supported events: * * * afterCreated - raised when a new instance of {@link INgTableParams} has finished being constructed + * * afterDataFiltered - raised when `ngTableDefaultGetData` instance filters data + * note: this event will not be raised when filtering is performed on server + * * afterDataSorted - raised when `ngTableDefaultGetData` instance orders data + * note: this event will not be raised when ordering is performed on server * * afterReloadData - raised when the {@link INgTableParams} `reload` method has finished loading new data * * datasetChanged - raised when {@link ISettings} `dataset` receives a new data array * * pagesChanged - raised when a new pages array has been generated @@ -598,49 +602,45 @@ export interface IEventsChannel { */ onAfterCreated(listener: IAfterCreatedListener, eventFilter?: IEventSelectorFunc): IUnregistrationFunc; /** - * Subscribe to receive notification whenever the `reload` method of an `NgTableParams` instance has successfully executed - * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a - * `scope` to have angular automatically unregister the listener when the `scope` is destroyed. + * Subscribe to receive notification whenever a `ngTableDefaultGetData` instance filters data + * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. * * @param listener the function that will be called when the event fires * @param scope the angular `$scope` that will limit the lifetime of the event subscription - * @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event + * @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event * @return a unregistration function that when called will unregister the `listener` */ - onAfterReloadData(listener: IAfterReloadDataListener, scope: IScope, eventFilter?: EventSelector): IUnregistrationFunc; + onAfterDataFiltered(listener: IAfterDataFilteredListener, scope: IScope, eventFilter?: EventSelector ): IUnregistrationFunc; /** - * Subscribe to receive notification whenever the `reload` method of an `NgTableParams` instance has successfully executed + * Subscribe to receive notification whenever a `ngTableDefaultGetData` instance filters data * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. * * @param listener the function that will be called when the event fires - * @param eventFilter a predicate function that should return true to receive the event + * @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event * @return a unregistration function that when called will unregister the `listener` */ - onAfterReloadData(listener: IAfterReloadDataListener, eventFilter?: EventSelector): IUnregistrationFunc; - + onAfterDataFiltered(listener: IAfterDataFilteredListener, eventFilter?: EventSelector ): IUnregistrationFunc; /** - * Subscribe to receive notification whenever a new data rows *array* is supplied as a `settings` value to a `NgTableParams` instance. - * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a - * `scope` to have angular automatically unregister the listener when the `scope` is destroyed. + * Subscribe to receive notification whenever a `ngTableDefaultGetData` instance orders data + * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. * * @param listener the function that will be called when the event fires * @param scope the angular `$scope` that will limit the lifetime of the event subscription - * @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event + * @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event * @return a unregistration function that when called will unregister the `listener` */ - onDatasetChanged(listener: IDatasetChangedListener, scope: IScope, eventFilter?: EventSelector): IUnregistrationFunc; + onAfterDataSorted(listener: IAfterDataSortedListener, scope: IScope, eventFilter?: EventSelector ): IUnregistrationFunc; /** - * Subscribe to receive notification whenever a new data rows *array* is supplied as a `settings` value to a `NgTableParams` instance. + * Subscribe to receive notification whenever a `ngTableDefaultGetData` instance orders data * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. * * @param listener the function that will be called when the event fires - * @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event + * @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event * @return a unregistration function that when called will unregister the `listener` */ - onDatasetChanged(listener: IDatasetChangedListener, eventFilter?: EventSelector): IUnregistrationFunc; - + onAfterDataSorted(listener: IAfterDataSortedListener, eventFilter?: EventSelector ): IUnregistrationFunc; /** - * Subscribe to receive notification whenever the paging buttons for an `NgTableParams` instance change + * Subscribe to receive notification whenever the `reload` method of an `NgTableParams` instance has successfully executed * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a * `scope` to have angular automatically unregister the listener when the `scope` is destroyed. * @@ -649,54 +649,57 @@ export interface IEventsChannel { * @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event * @return a unregistration function that when called will unregister the `listener` */ - onPagesChanged(listener: IPagesChangedListener, scope: IScope, eventFilter?: EventSelector): IUnregistrationFunc; + onAfterReloadData(listener: IAfterReloadDataListener, scope: IScope, eventFilter?: EventSelector): IUnregistrationFunc; /** - * Subscribe to receive notification whenever the paging buttons for an `NgTableParams` instance change + * Subscribe to receive notification whenever the `reload` method of an `NgTableParams` instance has successfully executed * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. * * @param listener the function that will be called when the event fires - * @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event + * @param eventFilter a predicate function that should return true to receive the event * @return a unregistration function that when called will unregister the `listener` */ - onPagesChanged(listener: IPagesChangedListener, eventFilter?: EventSelector): IUnregistrationFunc; + onAfterReloadData(listener: IAfterReloadDataListener, eventFilter?: EventSelector): IUnregistrationFunc; /** - * Subscribe to receive notification whenever a `ngTableDefaultGetData` instance filters data - * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. + * Subscribe to receive notification whenever a new data rows *array* is supplied as a `settings` value to a `NgTableParams` instance. + * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a + * `scope` to have angular automatically unregister the listener when the `scope` is destroyed. * * @param listener the function that will be called when the event fires * @param scope the angular `$scope` that will limit the lifetime of the event subscription - * @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event + * @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event * @return a unregistration function that when called will unregister the `listener` */ - onAfterDataFiltered(listener: IAfterDataFilteredListener, scope: IScope, eventFilter?: EventSelector ): IUnregistrationFunc; + onDatasetChanged(listener: IDatasetChangedListener, scope: IScope, eventFilter?: EventSelector): IUnregistrationFunc; /** - * Subscribe to receive notification whenever a `ngTableDefaultGetData` instance filters data + * Subscribe to receive notification whenever a new data rows *array* is supplied as a `settings` value to a `NgTableParams` instance. * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. * * @param listener the function that will be called when the event fires - * @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event + * @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event * @return a unregistration function that when called will unregister the `listener` */ - onAfterDataFiltered(listener: IAfterDataFilteredListener, eventFilter?: EventSelector ): IUnregistrationFunc; + onDatasetChanged(listener: IDatasetChangedListener, eventFilter?: EventSelector): IUnregistrationFunc; + /** - * Subscribe to receive notification whenever a `ngTableDefaultGetData` instance orders data - * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. + * Subscribe to receive notification whenever the paging buttons for an `NgTableParams` instance change + * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a + * `scope` to have angular automatically unregister the listener when the `scope` is destroyed. * * @param listener the function that will be called when the event fires * @param scope the angular `$scope` that will limit the lifetime of the event subscription - * @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event + * @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event * @return a unregistration function that when called will unregister the `listener` */ - onAfterDataSorted(listener: IAfterDataSortedListener, scope: IScope, eventFilter?: EventSelector ): IUnregistrationFunc; + onPagesChanged(listener: IPagesChangedListener, scope: IScope, eventFilter?: EventSelector): IUnregistrationFunc; /** - * Subscribe to receive notification whenever a `ngTableDefaultGetData` instance orders data + * Subscribe to receive notification whenever the paging buttons for an `NgTableParams` instance change * Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. * * @param listener the function that will be called when the event fires - * @param eventFilter either the specific `IDefaultGetData` instance you want to receive events for or a predicate function that should return true to receive the event + * @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event * @return a unregistration function that when called will unregister the `listener` */ - onAfterDataSorted(listener: IAfterDataSortedListener, eventFilter?: EventSelector ): IUnregistrationFunc; + onPagesChanged(listener: IPagesChangedListener, eventFilter?: EventSelector): IUnregistrationFunc; publishAfterCreated(publisher: INgTableParams): void; publishAfterReloadData(publisher: INgTableParams, newData: T[], oldData: T[]): void;