1 | # @ionic/angular
|
2 |
|
3 | Ionic Angular specific building blocks on top of [@ionic/core](https://www.npmjs.com/package/@ionic/core) components.
|
4 |
|
5 |
|
6 | ## Related
|
7 |
|
8 | * [Ionic Core Components](https://www.npmjs.com/package/@ionic/core)
|
9 | * [Ionic Documentation](https://ionicframework.com/docs/)
|
10 | * [Ionic Discord](https://ionic.link/discord)
|
11 | * [Ionic Forum](https://forum.ionicframework.com/)
|
12 | * [Ionicons](http://ionicons.com/)
|
13 | * [Stencil](https://stenciljs.com/)
|
14 | * [Capacitor](https://capacitor.ionicframework.com/)
|
15 |
|
16 |
|
17 | ## License
|
18 |
|
19 | * [MIT](https://raw.githubusercontent.com/ionic-team/ionic/main/LICENSE)
|
20 |
|
21 | ## Testing ng-add in ionic
|
22 |
|
23 | 1. Pull the latest from `main`
|
24 | 2. Build ionic/angular: `npm run build`
|
25 | 3. Run `npm link` from `ionic/angular/dist` directory
|
26 | 4. Create a blank angular project
|
27 |
|
28 | ```
|
29 | ng new add-test
|
30 | // Say yes to including the router, we need it
|
31 | cd add-test
|
32 | ```
|
33 |
|
34 | 5. To run schematics locally, we need the schematics-cli (once published, this will not be needed)
|
35 |
|
36 | ```
|
37 | npm install @angular-devkit/schematics-cli
|
38 | ```
|
39 |
|
40 | 6. Link `@ionic/angular`
|
41 |
|
42 | ```
|
43 | npm link @ionic/angular
|
44 | ```
|
45 |
|
46 |
|
47 | 7. Run the local copy of the ng-add schematic
|
48 |
|
49 | ```
|
50 | $ npx schematics @ionic/angular:ng-add
|
51 | ```
|
52 |
|
53 |
|
54 | You'll now be able to add ionic components to a vanilla Angular app setup.
|
55 |
|
56 | ## Project Structure
|
57 |
|
58 | **common**
|
59 |
|
60 | This is where logic that is shared between lazy loaded and standalone components live. For example, the lazy loaded IonPopover and standalone IonPopover components extend from a base IonPopover implementation that exists in this directory.
|
61 |
|
62 | **Note:** This directory exposes internal APIs and is only accessed in the `standalone` and `src` submodules. Ionic developers should never import directly from `@ionic/angular/common`. Instead, they should import from `@ionic/angular` or `@ionic/angular/standalone`.
|
63 |
|
64 | **standalone**
|
65 |
|
66 | This is where the standalone component implementations live. It was added as a separate entry point to avoid any lazy loaded logic from accidentally being pulled in to the final build. Having a separate directory allows the lazy loaded implementation to remain accessible from `@ionic/angular` for backwards compatibility.
|
67 |
|
68 | Ionic developers can access this by importing from `@ionic/angular/standalone`.
|
69 |
|
70 | **src**
|
71 |
|
72 | This is where the lazy loaded component implementations live.
|
73 |
|
74 | Ionic developers can access this by importing from `@ionic/angular`.
|