API Reference
ngx-meta package
Classes
Class | Description |
---|---|
NgxMetaCoreModule | Provides Check out provideNgxMetaCore() for the standalone, recommended API. Use NgxMetaCoreModule.forRoot() method. Importing the module class alone does nothing. |
NgxMetaElementsService | Manages <meta> elements inside <head> |
NgxMetaJsonLdModule | Provides JSON-LD module metadata managers. Check out provideNgxMetaJsonLd() for the standalone, recommended API. |
NgxMetaMetadataLoaderModule | Allows to load metadata managers after library has been initialized. Check out provideNgxMetaMetadataLoader() for the standalone, recommended API. |
NgxMetaMetaService | Creates, updates or removes Uses Angular Meta APIs under the hood. |
NgxMetaOpenGraphModule | Provides Open Graph module basic and optional metadata managers. Check out provideNgxMetaOpenGraph() for the standalone, recommended API. |
NgxMetaOpenGraphProfileModule | Provides Open Graph module profile metadata managers. Check out provideNgxMetaOpenGraphProfile() for the standalone, recommended API. |
NgxMetaRoutingModule | Enables managing metadata of a page by specifying it in its Angular Route#data Use NgxMetaRoutingModule.forRoot() method. Importing the module class alone does nothing. Check out provideNgxMetaRouting() for the standalone, recommended API. |
NgxMetaService | Manages the metadata values of the current page. |
NgxMetaStandardModule | Provides standard module metadata managers. Check out provideNgxMetaStandard() for the standalone, recommended API. |
NgxMetaTwitterCardModule | Provides Twitter Cards module metadata managers. Check out provideNgxMetaTwitterCard() for the standalone, recommended API. |
Abstract Classes
Abstract Class | Description |
---|---|
NgxMetaMetadataManager | Abstract class every metadata manager must implement. Used as injection token to provide metadata managers the library will take into account. |
Functions
Function | Description |
---|---|
makeComposedKeyValMetaDefinition(names, options) | Creates a key / value meta definition (NgxMetaMetaDefinition) where the key name is composed by several strings joined by a separator. See also makeKeyValMetaDefinition() |
makeKeyValMetaDefinition(keyName, options) | Creates a NgxMetaMetaDefinition for its use with NgxMetaMetaService by understanding <meta> elements as key / value pair elements. |
makeMetadataManagerProviderFromSetterFactory(setterFactory, opts) | Creates an Angular factory provider providing an NgxMetaMetadataManager. See manage custom metadata guide for an example. |
provideNgxMetaCore(features) | Provides ngx-meta 's core library services. |
provideNgxMetaJsonLd() | Provides JSON-LD module metadata managers. |
provideNgxMetaManager(jsonPath, setterFactory, options) | Creates an NgxMetaMetadataManager provider to manage some metadata. Check out manage your custom metadata guide to learn how to provide your custom metadata managers. |
provideNgxMetaMetadataLoader() | Allows to load metadata managers after library has been initialized. |
provideNgxMetaOpenGraph() | Provides Open Graph module basic and optional metadata managers. |
provideNgxMetaOpenGraphProfile() | Provides Open Graph module profile metadata managers |
provideNgxMetaRouting() | Enables managing metadata of a page by specifying it in its Angular Route#data |
provideNgxMetaStandard() | Provides standard module metadata managers. |
provideNgxMetaTwitterCard() | Provides Twitter Cards module metadata managers. |
provideOpenGraphDescription() | Manages the OpenGraph.description metadata |
provideOpenGraphImage() | Manages the OpenGraph.image metadata |
provideOpenGraphLocale() | Manages the OpenGraph.locale metadata |
provideOpenGraphProfileFirstName() | Manages the OpenGraphProfile.firstName metadata |
provideOpenGraphProfileGender() | Manages the OpenGraphProfile.gender metadata |
provideOpenGraphProfileLastName() | Manages the OpenGraphProfile.lastName metadata |
provideOpenGraphProfileUsername() | Manages the OpenGraphProfile.username metadata |
provideOpenGraphSiteName() | Manages the OpenGraph.siteName metadata |
provideOpenGraphTitle() | Manages the OpenGraph.title metadata |
provideOpenGraphType() | Manages the OpenGraph.type metadata |
provideOpenGraphUrl() | Manages the OpenGraph.url metadata |
provideStandardApplicationName() | Manages the Standard.applicationName metadata |
provideStandardAuthor() | Manages the Standard.author metadata |
provideStandardCanonicalUrl() | Manages the Standard.canonicalUrl metadata |
provideStandardDescription() | Manages the Standard.description metadata |
provideStandardGenerator() | Manages the Standard.generator metadata |
provideStandardKeywords() | Manages the Standard.keywords metadata |
provideStandardLocale() | Manages the Standard.locale metadata |
provideStandardThemeColor() | Manages the Standard.themeColor metadata |
provideStandardTitle() | Manages the Standard.title metadata |
provideTwitterCardCard() | Manages the TwitterCard.card metadata |
provideTwitterCardCreator() | Manages the TwitterCard.creator metadata |
provideTwitterCardDescription() | Manages the TwitterCard.description metadata |
provideTwitterCardImage() | Manages the TwitterCard.image metadata |
provideTwitterCardSite() | Manages the TwitterCard.site metadata |
provideTwitterCardTitle() | Manages the TwitterCard.title metadata |
withManagerDeps(deps) | Specifies dependencies to inject to the setter factory function passed to provideNgxMetaManager() See also: |
withManagerGlobal(global) | Sets the global key to use for a metadata manager created with provideNgxMetaManager() |
withManagerObjectMerging() | Enables object merging for the manager being created with provideNgxMetaManager() See MetadataResolverOptions.objectMerge for more information. |
withNameAttribute(value) | Creates an attribute name/value identifying a |
withNgxMetaBaseUrl(baseUrl) | Provides a base URL to enable resolving relative URLs. Including relative URLs provided by Angular's router. Metadata values requiring absolute URLs may accept relative URLs then. Internally, the library will turn the relative URL into an absolute URL using the base URL as prefix. The special value ANGULAR_ROUTER_URL can be used to query the Angular's router URL to be used as relative URL. Which with the feature enabled will be resolved into an absolute URL. Do not use the value if the feature isn't enabled. Otherwise, an invalid URL may end up used as metadata value. |
withNgxMetaDefaults(defaults) | Sets up default metadata values. When setting metadata values for a page, default values will be used as fallback when a metadata value isn't specified. |
withOptions(options) | Helper function to combine multiple options (objects). In case of specifying same options more than once, the latter one will take precedence. Provide them sorted by ascendant priority. Less priority options first. Top priority options last. Can be used to combine options for: |
withPropertyAttribute(value) | Creates an attribute name/value identifying a |
Interfaces
Interface | Description |
---|---|
GlobalMetadata | Specifies metadata that will be used by more than one module. |
GlobalMetadataImage | Specifies image metadata (will be used for link previews / social cards) to be used for more than one module. Like: - OpenGraph.image (needs standard module) - TwitterCard.image (needs Twitter Cards module) Open Graph allows for more attributes for the image. Specify OpenGraph.image if you want to customize those too. |
JsonLdMetadata | Utility type to provide specific JSON-LD module metadata |
MakeComposedKeyValMetaDefinitionOptions | Options argument object for makeComposedKeyValMetaDefinition() |
MakeKeyValMetaDefinitionOptions | Options argument object for makeKeyValMetaDefinition() |
MakeMetadataManagerProviderFromSetterFactoryOptions | Options argument object for makeMetadataManagerProviderFromSetterFactory(). |
MetadataResolverOptions | Options to resolve metadata values for a metadata manager Used in NgxMetaMetadataManager.resolverOptions with type MetadataResolverOptions |
NgxMetaCoreModuleForRootOptions | Configuration options for NgxMetaCoreModule.forRoot() |
NgxMetaMetaDefinition | Models a To create one, you may also use one of these utility functions: |
NgxMetaRouteData | Utility type to ensure metadata values are set properly inside an Angular `Route.data` You can also provide specific metadata module types to ensure type safety of the metadata values. Open doc details to see an example. |
OpenGraph | Open Graph module metadata values that can be set. |
OpenGraphImage | See OpenGraph.image |
OpenGraphMetadata | Utility type to provide specific Open Graph module metadata. |
OpenGraphProfile | Open Graph profile metadata for this page. Requires Open Graph profile metadata managers to work |
Standard | Standard module metadata values that can be set. |
StandardMetadata | Utility type to provide specific standard module metadata. |
StandardThemeColorMetadataObject | See Standard.themeColor |
TwitterCard | Twitter Cards module metadata values that can be set. |
TwitterCardCreatorId | See TwitterCardCreator |
TwitterCardCreatorUsername | See TwitterCardCreator |
TwitterCardImage | Image for the card. Equivalent to OpenGraph.image. This one can be omitted if equivalent is set. Can be set with GlobalMetadata.image. Used in TwitterCard.image with type TwitterCardImage |
TwitterCardMetadata | Utility type to provide specific Twitter Cards module metadata |
TwitterCardSiteId | See TwitterCardSite |
TwitterCardSiteUsername | See TwitterCardSite |
Variables
Type Aliases
Type Alias | Description |
---|---|
AngularRouterUrl | Type alias for ANGULAR_ROUTER_URL symbol |
BaseUrl | Base URL type for withNgxMetaBaseUrl() feature |
MetadataSetter | See NgxMetaMetadataManager.set |
MetadataSetterFactory | Utility type for a factory function that returns a MetadataSetter given some injectable dependencies. Used as part of makeMetadataManagerProviderFromSetterFactory(). |
MetadataValues | Metadata values to use for a page. Broadly speaking, it's just a JSON object. See the metadata values JSON guide for more information about typing metadata values JSON with stricter types |
NgxMetaElementAttributes | Models a Almost equivalent to Angular's MetaDefinition Only difference is |
NgxMetaElementNameAttribute | See NgxMetaElementsService.set() |
NgxMetaMetaContent | Content to be set for a specific Can be |
OpenGraphProfileGender | Genders for OpenGraphProfile.gender property |
OpenGraphType | Types for OpenGraph.type property |
StandardThemeColorMetadata | See Standard.themeColor |
TwitterCardCreator |
Used in TwitterCard.creator with type TwitterCardCreator |
TwitterCardSite |
Either TwitterCardSiteUsername or TwitterCardSiteId is required. Used in TwitterCard.site with type TwitterCardSite |
TwitterCardType | Card types for TwitterCard.card property |