Skip to content

Ngx meta.makekeyvalmetadefinition

Home > @davidlj95/ngx-meta > makeKeyValMetaDefinition

makeKeyValMetaDefinition() function

Creates a NgxMetaMetaDefinition for its use with NgxMetaMetaService by understanding <meta> elements as key / value pair elements. Read the API reference docs for more info.

Signature:

makeKeyValMetaDefinition: (keyName: string, options?: {
    keyAttr?: string;
    valAttr?: string;
    extras?: MetaDefinition;
}) => NgxMetaMetaDefinition

Parameters

Parameter Type Description
keyName string Name of the key in the key/value meta definition
options { keyAttr?: string; valAttr?: string; extras?: MetaDefinition; } (Optional) Specifies HTML attribute defining key, HTML attribute defining value and optional extras to include in definition keyAttr defaults to name valAttr defaults to content extras defaults to nothing

Returns:

NgxMetaMetaDefinition

Remarks

One can think about some <meta> elements as key / value pairs. For instance <meta name='description' content='Lorem ipsum'> would actually be a key / pair meta where - description is the key - Lorem ipsum is the value - name is the key's HTML attribute - contentis the value's HTML attribute

Value is set by NgxMetaMetaService.set() by providing this model and an actual value