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
Then, import `RouterLink` in `src/app/home/home.page.ts`:
248
+
Then, import `RouterLink` in `home.page.ts`:
249
249
250
250
```ts title="src/app/home/home.page.ts"
251
251
import { RouterLink } from'@angular/router';
@@ -262,7 +262,7 @@ Navigating can also be performed using Angular's Router service. See the [Angula
262
262
263
263
## Add Icons to the New Page
264
264
265
-
Ionic Angular comes with [Ionicons](https://ionic.io/ionicons/) pre-installed. You can use any icon by setting the `name` property on the `ion-icon` component. Add the following icons to `src/app/new/new.page.html`:
265
+
Ionic Angular comes with [Ionicons](https://ionic.io/ionicons/) pre-installed. You can use any icon by setting the `name` property on the `ion-icon` component. Add the following icons to `new.page.html`:
266
266
267
267
```html title="src/app/new/new.page.html"
268
268
<ion-content>
@@ -273,7 +273,7 @@ Ionic Angular comes with [Ionicons](https://ionic.io/ionicons/) pre-installed. Y
273
273
</ion-content>
274
274
```
275
275
276
-
You'll also need to import and register these icons in `src/app/new/new.page.ts`:
276
+
You'll also need to import and register these icons in `new.page.ts`:
277
277
278
278
```ts title="src/app/new/new.page.ts"
279
279
// ...existing imports...
@@ -299,15 +299,15 @@ export class NewPage implements OnInit {
299
299
}
300
300
```
301
301
302
-
Alternatively, you can register icons in `src/app/app.component.ts` to use them throughout your app.
302
+
Alternatively, you can register icons in `app.component.ts` to use them throughout your app.
303
303
304
304
For more information, see the [Icon documentation](/docs/api/icon) and the [Ionicons documentation](https://ionic.io/ionicons/).
305
305
306
306
## Call Component Methods
307
307
308
308
Let's add a button that can scroll the content area to the bottom.
309
309
310
-
Update the `ion-content` in your `src/app/new/new.page.html` to include a button and some items after the existing icons:
310
+
Update the `ion-content` in your `new.page.html` to include a button and some items after the existing icons:
Copy file name to clipboardExpand all lines: docs/javascript/quickstart.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,7 +120,7 @@ This copies the necessary Ionic files that Capacitor will need to work with lazy
120
120
121
121
## Initialize Ionic
122
122
123
-
Replace the contents of `src/main.js` with the following:
123
+
Replace the contents of `main.js` with the following:
124
124
125
125
```js title="src/main.js"
126
126
// Load Ionic
@@ -230,7 +230,7 @@ This creates a custom element called `home-page` that contains the layout for yo
230
230
For detailed information about Ionic layout components, see the [Header](/docs/api/header), [Toolbar](/docs/api/toolbar), [Title](/docs/api/title), and [Content](/docs/api/content) documentation.
231
231
:::
232
232
233
-
Next, add a `<script>` tag before the `src/main.js` import in `index.html` to import the Home page:
233
+
Next, add a `<script>` tag before the `main.js` import in `index.html` to import the Home page:
234
234
235
235
```html title="index.html"
236
236
<scripttype="module">
@@ -246,7 +246,7 @@ At this point your browser should be displaying the Home page.
246
246
247
247
## Add an Ionic Component
248
248
249
-
You can enhance your Home page with more Ionic UI components. For example, add a [Button](/docs/api/button) to navigate to another page. Update the `HomePage` component in `src/pages/HomePage.js`:
249
+
You can enhance your Home page with more Ionic UI components. For example, add a [Button](/docs/api/button) to navigate to another page. Update the `HomePage` component in `HomePage.js`:
250
250
251
251
```js title="src/pages/HomePage.js"
252
252
classHomePageextendsHTMLElement {
@@ -314,7 +314,7 @@ Next, update the `<script>` tag which imports the Home page in the `index.html`
314
314
315
315
## Navigate to the New Page
316
316
317
-
To navigate to the new page, update the button in `src/pages/HomePage.js` to be inside of an `ion-router-link`:
317
+
To navigate to the new page, update the button in `HomePage.js` to be inside of an `ion-router-link`:
318
318
319
319
```html title="src/pages/HomePage.js"
320
320
<ion-router-linkhref="/new">
@@ -332,7 +332,7 @@ Navigating can also be performed programmatically using `document.querySelector(
332
332
333
333
Ionic JavaScript comes with [Ionicons](https://ionic.io/ionicons/) support. To use icons, you need to import them, register them with `addIcons`, and then use them with the `ion-icon` component.
334
334
335
-
Add the necessary imports and register the icons in `src/main.js`:
335
+
Add the necessary imports and register the icons in `main.js`:
@@ -164,7 +164,7 @@ For detailed information about Ionic layout components, see the [Header](/docs/a
164
164
165
165
## Add an Ionic Component
166
166
167
-
You can enhance your Home page with more Ionic UI components. For example, import and add a [Button](/docs/api/button) at the end of the `IonContent` in `src/pages/Home.tsx`:
167
+
You can enhance your Home page with more Ionic UI components. For example, import and add a [Button](/docs/api/button) at the end of the `IonContent` in `Home.tsx`:
@@ -230,7 +230,7 @@ When creating your own pages, always use `IonPage` as the root component. This i
230
230
231
231
## Navigate to the New Page
232
232
233
-
To navigate to the new page, create a route for it by first importing it at the top of `src/App.tsx` after the `Home` import:
233
+
To navigate to the new page, create a route for it by first importing it at the top of `App.tsx` after the `Home` import:
234
234
235
235
```tsx title="src/App.tsx"
236
236
importNewfrom'./pages/New';
@@ -252,7 +252,7 @@ Then, add its route in `IonRouterOutlet`:
252
252
</IonRouterOutlet>
253
253
```
254
254
255
-
Once that is done, update the button in `src/pages/Home.tsx`:
255
+
Once that is done, update the button in `Home.tsx`:
256
256
257
257
```tsx title="src/pages/Home.tsx"
258
258
<IonButtonrouterLink="/new">Navigate</IonButton>
@@ -266,7 +266,7 @@ Navigating can also be performed programmatically using React Router's `history`
266
266
267
267
Ionic React comes with [Ionicons](https://ionic.io/ionicons/) pre-installed. You can use any icon by setting the `icon` property of the `IonIcon` component.
268
268
269
-
Update the imports in `src/pages/New.tsx` to import `IonIcon` and the `heart` and `logoIonic` icons:
269
+
Update the imports in `New.tsx` to import `IonIcon` and the `heart` and `logoIonic` icons:
@@ -266,7 +266,7 @@ Navigating can also be performed programmatically using Vue Router, and routes c
266
266
267
267
Ionic Vue comes with [Ionicons](https://ionic.io/ionicons/) pre-installed. You can use any icon by setting the `icon` property of the `ion-icon` component.
268
268
269
-
Update the imports in `src/views/NewPage.vue` to import `IonIcon` and the `heart` and `logoIonic` icons:
269
+
Update the imports in `NewPage.vue` to import `IonIcon` and the `heart` and `logoIonic` icons:
270
270
271
271
```vue title="src/views/NewPage.vue"
272
272
<script setup lang="ts">
@@ -290,7 +290,7 @@ For more information, see the [Icon documentation](/docs/api/icon) and the [Ioni
290
290
291
291
Let's add a button that can scroll the content area to the bottom.
292
292
293
-
Update `src/views/NewPage.vue` to include a ref on `ion-content` and a button and some items after the existing icons:
293
+
Update `NewPage.vue` to include a ref on `ion-content` and a button and some items after the existing icons:
0 commit comments