OpenSlides/client/src/app/shared/models/base/detail-navigable.ts
Maximilian Krambach ba6d3da8f0 navigate to detail view after setting the history mode
(if a detailView is existant)
2019-02-01 14:42:19 +01:00

20 lines
531 B
TypeScript

/**
* One can navigate to the detail page of every object implementing this interface.
*/
export interface DetailNavigable {
/**
* Get the url for the detail view, so the user can navigate to it.
*/
getDetailStateURL(): string;
}
/**
* check if a given object implements implements this interface
*
* @param obj
* @returns true if the interface is implemented
*/
export function isDetailNavigable(obj: object): obj is DetailNavigable {
return (<DetailNavigable>obj).getDetailStateURL !== undefined;
}