Skip to content

Standard

This module allows managing HTML <meta> tags whose name attribute is defined in the HTML specification and the site's <title>. We call those standard meta tags

Setup

Depending on what metadata you need to set, add one of more of the following modules / providers.

Main

Standalone, module-free apps

This is the default approach for authoring Angular projects generated with Angular CLI v17 and above. It's also the recommended way to author Angular projects right now. Using standalone APIs is the preferred and recommended way to do so. You can use standalone APIs too despite the application is still module-based. Learn more about standalone at standalone components guide and standalone migration

Add provideNgxMetaStandard() to your standalone app's app.config.ts file providers. Check out get started setup for more details.

app.config.ts
import {provideNgxMetaStandard} from '@davidlj95/ngx-meta/standard';

export const appConfig: ApplicationConfig = {
  // ...
  providers: [
    // ...
    provideNgxMetaCore(),
    provideNgxMetaRouting(),
    provideNgxMetaStandard(),
    // ...
  ],
}
Non-standalone, module-based apps

This is the default and traditional approach for authoring Angular projects generated with Angular CLI before v17. It's not the preferred or recommended way to author Angular projects right now. Using standalone APIs is the preferred and recommended way to do so. You can use standalone APIs too despite the application is still module-based. Learn more about standalone at standalone components guide and standalone migration. You can anyway keep using the module-based equivalent APIs for now if you prefer to do so.

Add NgxMetaStandardModule to your module-based app's app.module.ts file. Check out get started setup for more details.

app.module.ts
import {NgxMetaStandardModule} from '@davidlj95/ngx-meta/standard';

@NgModule({
  // ...
  imports: [
    // ...
    NgxMetaCoreModule.forRoot(),
    NgxMetaRoutingModule.forRoot(),
    NgxMetaStandardModule,
    // ...
  ],
  // ...
})
export class AppModule {}

Type

Following Typescript type provides you with all implemented metadata you can set:

import { StandardMetadata } from '@davidlj95/ngx-meta/standard'

StandardMetadata API Reference

Resources