Register a collection of
Element and associate them with an
ID with the layout system for later use.
registerItem(registration: string, elements: Element): string;
|registration||string||string of the registration ID|
|elements||Element||Elements containing the reference to the elements to register for later usage|
- string defining the name of the registered item with the layout system (config.id if set).
LayoutUsageError if you attempt to add an item before the layout has been initialised.
LayoutRegistrationError if you attempt to use a
You would use this to register elements that you later want to load when using FoundationLayout.loadLayout(). Use FoundationLayout.layoutRequiredRegistrations() to see what components need to be registered for a certain config and then register them using this function before calling FoundationLayout.loadLayout().
When registering an element it is moved by reference into the internals of the layout, so if you pass elements already in the DOM then they will disappear. If you want to avoid this you can pass copies using