nx/packages/angular/docs/application-examples.md

1.4 KiB

Examples

{% tabs %} {% tab label="Simple Application" %}

Create an application named my-app:

nx g @nx/angular:application my-app

{% /tab %}

{% tab label="Specify directory and style extension" %}

Create an application named my-app in the my-dir directory and use scss for styles:

{% callout type="note" title="Directory Flag Behavior Changes" %} The command below uses the as-provided directory flag behavior, which is the default in Nx 16.8.0. If you're on an earlier version of Nx or using the derived option, use --directory=my-dir. See the as-provided vs. derived documentation for more details. {% /callout %}

nx g @nx/angular:app my-app --directory=my-dir/my-app --style=scss

{% /tab %}

{% tab label="Single File Components application" %}

Create an application with Single File Components (inline styles and inline templates):

nx g @nx/angular:app my-app --inlineStyle --inlineTemplate

{% /tab %}

{% tab label="Standalone Components application" %}

Create an application that is setup to use standalone components:

nx g @nx/angular:app my-app --standalone

{% /tab %}

{% tab label="Set custom prefix and tags" %}

Set the prefix to apply to generated selectors and add tags to the application (used for linting).

nx g @nx/angular:app my-app --prefix=admin --tags=scope:admin,type:ui

{% /tab %} {% /tabs %}