You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(angular): update schematics to support Angular's latest build system (#30525)
Issue number: resolvesionic-team/ionic-docs#2091
---------
## What is the current behavior?
Documentation to test `ng add` schematic for @ionic/angular is outdated
& it fails when running with:
```
Invalid projectType for my-app: undefined
```
## What is the new behavior?
Fix the schematic to support the latest Angular build system & update
the documentation for testing local Ionic Framework with `ng add`.
## Does this introduce a breaking change?
- [ ] Yes
- [x] No
## Other information
_I am using `Angular CLI: 20.0.4`_
Run these commands first to see the error:
```sh
ng new my-app --style=css --ssr=false --zoneless=false
cd my-app
ng add @ionic/angular --skip-confirmation
```
Switch to this branch (`fix-angular-schematics`) and then follow the
[new
steps](https://github.com/ionic-team/ionic-framework/blob/b9b345303c7e1446a990c11a8ae6f70c1f773493/packages/angular/README.md#testing-local-ionic-framework-with-ng-add)
and confirm the error is gone.
--------
`Co-authored-by: soundproofboot <[email protected]>`
---------
Co-authored-by: Brandy Smith <[email protected]>
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.
21
+
## Testing Local Ionic Framework with `ng add`
22
+
23
+
This guide shows you how to test the local Ionic Framework build with a new Angular application using `ng add`. This is useful for development and testing changes before publishing.
# Change to whichever directory you want the app in
74
+
cd~/Documents/
75
+
ng new my-app --style=css --ssr=false --zoneless=false
76
+
cd my-app
77
+
```
78
+
79
+
8. Install the local`@ionic/angular` package:
80
+
```sh
81
+
npm install ~/Downloads/ionic-angular.tgz
82
+
```
83
+
84
+
9. Run `ng add`:
85
+
```sh
86
+
ng add @ionic/angular --skip-confirmation
87
+
```
88
+
89
+
10. Serve the app:
90
+
```sh
91
+
ng serve
92
+
```
93
+
94
+
The local Ionic Framework build is now active in the Angular app. Changes to the Ionic source code require rebuilding the packages and reinstalling the tarball to see updates.
0 commit comments