docs: add command for creating angular workspace (#32804)

Improved documentation

Add command to create Angular workspace, it is required for executing `ng generate library <my-lib>` .

PR Close #32804
This commit is contained in:
Harinder Singh 2019-09-22 10:18:08 +05:30 committed by Miško Hevery
parent 4b30108734
commit 127cec0214
1 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# Creating Libraries
# Creating Libraries
You can create and publish new libraries to extend Angular functionality. If you find that you need to solve the same problem in more than one app (or want to share your solution with other developers), you have a candidate for a library.
@ -13,9 +13,15 @@ A simple example might be a button that sends users to your company website, tha
Use the Angular CLI to generate a new library skeleton with the following command:
<code-example language="bash">
ng new my-workspace --create-application=false
cd my-workspace
ng generate library my-lib
</code-example>
<div class="alert is-helpful">
<p>You can use the monorepo model to use the same workspace for multiple projects. See [Setting up for a multi-project workspace](guide/file-structure#multiple-projects).</p>
</div>
This creates the `projects/my-lib` folder in your workspace, which contains a component and a service inside an NgModule.
The workspace configuration file, `angular.json`, is updated with a project of type 'library'.