Custom Document Collection
# help-with-umbraco
p
Hi! I need to implement custom document collection like UmbDocumentCollectionElement (https://github.com/umbraco/Umbraco-CMS/blob/release-15.1.1/src/Umbraco.Web.UI.Client/src/packages/documents/documents/collection/document-collection.element.ts) I want to create custom collection that should extend from UmbCollectionDefaultElement (https://github.com/umbraco/Umbraco-CMS/blob/release-15.1.1/src/Umbraco.Web.UI.Client/src/packages/core/collection/default/collection-default.element.ts), but I do know how properly register custom collection context. I have implemented context like UmbDocumentCollectionContext (https://github.com/umbraco/Umbraco-CMS/blob/release-15.1.1/src/Umbraco.Web.UI.Client/src/packages/documents/documents/collection/document-collection.context.ts) but it is not used by UmbCollectionDefaultElement How to register custom collection context and use it in UmbCollectionDefaultElement, as I understand here (https://github.com/umbraco/Umbraco-CMS/blob/4f3dd044f66ab877f7bc42287867ee998c29e9eb/src/Umbraco.Web.UI.Client/src/packages/core/collection/default/collection-default.element.ts#L39) should be injected my custom collection context, but when i am using my custom collection element I can't consume context here https://github.com/umbraco/Umbraco-CMS/blob/4f3dd044f66ab877f7bc42287867ee998c29e9eb/src/Umbraco.Web.UI.Client/src/packages/core/collection/default/collection-default.element.ts#L39 Please can someone explain how to properly register custom collection context as it umbraco did with UmbDocumentCollectionContext (https://github.com/umbraco/Umbraco-CMS/blob/release-15.1.1/src/Umbraco.Web.UI.Client/src/packages/documents/documents/collection/document-collection.context.ts) to use it in custom implementation that extends UmbCollectionDefaultElement (https://github.com/umbraco/Umbraco-CMS/blob/release-15.1.1/src/Umbraco.Web.UI.Client/src/packages/core/collection/default/collection-default.element.ts)