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 alone does nothing. |
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 | Allows to manage metadata of a page by specifying it in its Angular Route#data Check out provideNgxMetaRouting() for the standalone, recommended API. |
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. |
NgxMetaService | Manages the metadata values of the current page. |
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. |
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() | Allows to manage 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. |
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. |
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 |
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 |