docs(angular): add component examples (#12485)
This commit is contained in:
parent
65a079cbe1
commit
9460d648ef
@ -359,6 +359,7 @@
|
||||
}
|
||||
},
|
||||
"required": ["name"],
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Simple Component\" %}\n\nCreate a component named `my-component`:\n\n```bash\nnx g @nrwl/angular:component my-component\n```\n\n{% /tab %}\n\n{% tab label=\"Standalone Component\" %}\n\nCreate a standalone component named `my-component`:\n\n```bash\nnx g @nrwl/angular:component my-component --standalone\n```\n\n{% /tab %}\n\n{% tab label=\"Single File Component\" %}\n\nCreate a component named `my-component` with inline styles and inline template:\n\n```bash\nnx g @nrwl/angular:component my-component --inlineStyle --inlineTemplate\n```\n\n{% /tab %}\n\n{% tab label=\"Component with OnPush Change Detection Strategy\" %}\n\nCreate a component named `my-component` with OnPush Change Detection Strategy:\n\n```bash\nnx g @nrwl/angular:component my-component --changeDetection=OnPush\n```\n\n{% /tab %}\n",
|
||||
"presets": []
|
||||
},
|
||||
"aliases": ["c"],
|
||||
|
||||
42
packages/angular/docs/component-examples.md
Normal file
42
packages/angular/docs/component-examples.md
Normal file
@ -0,0 +1,42 @@
|
||||
## Examples
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="Simple Component" %}
|
||||
|
||||
Create a component named `my-component`:
|
||||
|
||||
```bash
|
||||
nx g @nrwl/angular:component my-component
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Standalone Component" %}
|
||||
|
||||
Create a standalone component named `my-component`:
|
||||
|
||||
```bash
|
||||
nx g @nrwl/angular:component my-component --standalone
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Single File Component" %}
|
||||
|
||||
Create a component named `my-component` with inline styles and inline template:
|
||||
|
||||
```bash
|
||||
nx g @nrwl/angular:component my-component --inlineStyle --inlineTemplate
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Component with OnPush Change Detection Strategy" %}
|
||||
|
||||
Create a component named `my-component` with OnPush Change Detection Strategy:
|
||||
|
||||
```bash
|
||||
nx g @nrwl/angular:component my-component --changeDetection=OnPush
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
@ -110,5 +110,6 @@
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"required": ["name"]
|
||||
"required": ["name"],
|
||||
"examplesFile": "../../../docs/component-examples.md"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user