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
Copy file name to clipboardExpand all lines: versioned_docs/version-v7/angular/your-first-app.md
+75-27Lines changed: 75 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,15 @@ sidebar_label: Build Your First App
4
4
---
5
5
6
6
<head>
7
-
<title>Build Your First Ionic Mobile App: Angular Development Tutorial</title>
7
+
<title>Build Your First Ionic Mobile App with Angular | Ionic Capacitor Camera</title>
8
8
<meta
9
9
name="description"
10
-
content="Ionic's single codebase builds for any platform using just HTML, CSS, & JavaScript. Develop your first mobile app with our step-by-step Angular tutorial."
10
+
content="This Angular tutorial teaches the fundamentals of Ionic app development by creating a realistic app step-by-step. Learn to run your first Ionic app with Angular."
11
11
/>
12
12
</head>
13
13
14
+
# Your First Ionic App: Angular
15
+
14
16
The great thing about Ionic is that with one codebase, you can build for any platform using just HTML, CSS, and JavaScript. Follow along as we learn the fundamentals of Ionic app development by creating a realistic app step by step.
15
17
16
18
Here’s the finished app running on all 3 platforms:
@@ -19,9 +21,9 @@ Here’s the finished app running on all 3 platforms:
@@ -34,11 +36,11 @@ We'll create a Photo Gallery app that offers the ability to take photos with you
34
36
35
37
Highlights include:
36
38
37
-
- One Angular-based codebase that runs on the web, iOS, and Android using Ionic Framework [UI components](https://ionicframework.com/docs/components).
39
+
- One Angular-based codebase that runs on the web, iOS, and Android using Ionic Framework [UI components](../components.md).
38
40
- Deployed as a native iOS and Android mobile app using [Capacitor](https://capacitorjs.com), Ionic's official native app runtime.
39
-
- Photo Gallery functionality powered by the Capacitor [Camera](https://capacitorjs.com/docs/apis/camera), [Filesystem](https://capacitorjs.com/docs/apis/filesystem), and [Preferences](https://capacitorjs.com/docs/apis/preferences) APIs.
41
+
- Photo Gallery functionality powered by the Capacitor [Camera](../native/camera.md), [Filesystem](../native/filesystem.md), and [Preferences](../native/preferences.md) APIs.
40
42
41
-
Find the complete app code referenced in this guide [on GitHub](https://github.com/ionic-team/photo-gallery-capacitor-ng).
43
+
Find the [complete app code](https://github.com/ionic-team/tutorial-photo-gallery-angular) referenced in this guide on GitHub.
42
44
43
45
## Download Required Tools
44
46
@@ -47,9 +49,8 @@ Download and install these right away to ensure an optimal Ionic development exp
47
49
-**Node.js** for interacting with the Ionic ecosystem. [Download the LTS version here](https://nodejs.org/en/).
48
50
-**A code editor** for... writing code! We are fans of [Visual Studio Code](https://code.visualstudio.com/).
49
51
-**Command-line interface/terminal (CLI)**:
50
-
-**Windows** users: for the best Ionic experience, we recommend the built-in command line (cmd) or the Powershell
51
-
CLI, running in Administrator mode.
52
-
-**Mac/Linux** users, virtually any terminal will work.
52
+
-**Windows** users: for the best Ionic experience, we recommend the built-in command line (cmd) or the Powershell CLI, running in Administrator mode.
53
+
-**Mac/Linux** users: virtually any terminal will work.
53
54
54
55
## Install Ionic Tooling
55
56
@@ -71,12 +72,18 @@ Consider setting up npm to operate globally without elevated permissions. See [R
71
72
72
73
## Create an App
73
74
74
-
Next, create an Ionic Angular app that uses the “Tabs” starter template and adds Capacitor for native functionality:
75
+
Next, create an Ionic Angular app that uses the "Tabs" starter template and adds Capacitor for native functionality:
When prompted to choose between `NgModules` and `Standalone`, opt for `NgModules` as this tutorial follows the `NgModules` approach.
84
+
85
+
:::
86
+
80
87
This starter project comes complete with three pre-built pages and best practices for Ionic development. With common building blocks already in place, we can add more features easily!
Some Capacitor plugins, including the Camera API, provide the web-based functionality and UI via the Ionic [PWA Elements library](https://github.com/ionic-team/ionic-pwa-elements).
103
+
Some Capacitor plugins, including the [Camera API](../native/camera.md), provide the web-based functionality and UI via the Ionic [PWA Elements library](https://github.com/ionic-team/pwa-elements).
// Call the element loader before the bootstrapModule/bootstrapApplication call
119
+
//CHANGE: Call the element loader before the `bootstrapModule` call.
110
120
defineCustomElements(window);
121
+
122
+
platformBrowserDynamic()
123
+
.bootstrapModule(AppModule)
124
+
.catch((err) =>console.log(err));
111
125
```
112
126
113
127
That’s it! Now for the fun part - let’s see the app in action.
@@ -124,53 +138,87 @@ And voilà! Your Ionic app is now running in a web browser. Most of your app can
124
138
125
139
## Photo Gallery!!!
126
140
127
-
There are three tabs. Click on the Tab2 tab. It’s a blank canvas, aka the perfect spot to transform into a Photo Gallery. The Ionic CLI features Live Reload, so when you make changes and save them, the app is updated immediately!
141
+
There are three tabs. Click on the "Tab2" tab. It’s a blank canvas, aka the perfect spot to transform into a Photo Gallery. The Ionic CLI features Live Reload, so when you make changes and save them, the app is updated immediately!
128
142
129
143

130
144
131
-
Open the photo-gallery app folder in your code editor of choice, then navigate to `/src/app/tab2/tab2.page.html`. We see:
`ion-header` represents the top navigation and toolbar, with "Tab 2" as the title (there are two of them due to iOS [Collapsible Large Title](https://ionicframework.com/docs/api/title#collapsible-large-titles) support). Rename both `ion-title` elements to:
165
+
`ion-header` represents the top navigation and toolbar, with "Tab 2" as the title (there are two of them due to iOS [Collapsible Large Title](../api/title.md#collapsible-large-titles) support). Rename both `ion-title` elements to:
150
166
151
167
```html
152
168
<ion-title>Photo Gallery</ion-title>
153
169
```
154
170
155
-
We put the visual aspects of our app into `<ion-content>`. In this case, it’s where we’ll add a button that opens the device’s camera as well as displays the image captured by the camera. Start by adding a [floating action button](https://ionicframework.com/docs/api/fab) (FAB) to the bottom of the page and set the camera image as the icon.
171
+
We put the visual aspects of our app into `<ion-content>`. In this case, it’s where we’ll add a button that opens the device’s camera as well as displays the image captured by the camera. Start by adding a [floating action button](../api/fab.md) (FAB) to the bottom of the page and set the camera image as the icon.
Save all changes to see them automatically applied in the browser. That’s just the start of all the cool things we can do with Ionic. Up next, implement camera taking functionality on the web, then build it for iOS and Android.
224
+
That’s just the start of all the cool things we can do with Ionic. Up next, implement camera taking functionality on the web, then build it for iOS and Android.
0 commit comments