Compare commits

..

31 Commits

Author SHA1 Message Date
github-actions
cdb972a2a3 v6.2.4 2022-08-24 12:59:50 +00:00
Amanda Johnston
27318d75df fix(alert): use aria-labelledby and aria-describedby instead of aria-label (#25805)
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
2022-08-23 15:31:00 -05:00
Liam DeBeasi
65af865db7 test(vue): add multi-version testing (#25785) 2022-08-23 16:05:34 -04:00
Liam DeBeasi
037d579b2a fix(modal): role attribute can be customized (#25804) 2022-08-23 14:37:58 -04:00
Liam DeBeasi
a39d776f08 fix(react): duplicate page transitions do not happen on react 18 (#25798)
resolves #25797
2022-08-23 14:19:38 -04:00
Liam DeBeasi
30200051bb fix(vue): lifecycles now fire on tabs pages (#25786)
resolves #25784
2022-08-23 13:17:45 -04:00
Liam DeBeasi
71fad3884b fix(breadcrumb): separator is not announced by narrators (#25796) 2022-08-23 12:23:00 -04:00
Amanda Johnston
d395a73cb6 fix(alert): add default aria-label (#25800) 2022-08-22 15:11:58 -05:00
Liam DeBeasi
4f24b0e9e3 chore(): update stencil to resolve css hmr issue (#25799) 2022-08-22 15:50:21 -04:00
Sean Perkins
bd715a5256 fix(refresher): use componentOnReady utility for CE build (#25783)
Resolves #25782
2022-08-22 12:52:47 -04:00
Liam DeBeasi
d631195124 fix(select): compareWith passes params in correct order (#25764)
resolves #25759
2022-08-22 11:34:22 -04:00
Liam DeBeasi
3b211b60fd fix(datetime): close month/year picker when hidden (#25789)
resolves #25787
2022-08-22 11:15:02 -04:00
Liam DeBeasi
08dd3e277b test(angular): add support for multi-version testing (#25665) 2022-08-18 16:46:15 -04:00
Liam DeBeasi
436a8ce508 merge release-6.2.3
Release 6.2.3
2022-08-17 13:06:16 -05:00
Liam DeBeasi
bfa97a5396 chore(angular): run prettier 2022-08-17 17:23:32 +00:00
ionitron
419c8d758c chore(): update package lock files 2022-08-17 14:14:39 +00:00
github-actions
9ed57d83e7 v6.2.3 2022-08-17 14:10:20 +00:00
Liam DeBeasi
2547b0b4e1 chore(ci): account for components.d.ts in clean build (#25769) 2022-08-16 17:17:24 -04:00
Sean Perkins
bafa759655 fix(css): preserve whitespace in selectors when minifying css (#25767)
Resolves #25766
2022-08-16 16:26:59 -04:00
Amanda Johnston
bb37446032 fix(footer): remove toolbar bottom padding if near bottom slot tabs or keyboard is open (#25746)
Co-authored-by: EinfachHans <EinfachHans@users.noreply.github.com>
2022-08-16 13:22:43 -05:00
Liam DeBeasi
79c65dc382 test(playwright): add new utilities for skipping tests (#25758) 2022-08-16 09:18:42 -04:00
Sean Perkins
e750e33616 fix(refresher): refresher is visible with multiple custom scroll targets (#25750)
Resolves #25495
2022-08-15 14:58:38 -04:00
Liam DeBeasi
f47c5de1e6 test(toast): migrate tests to playwright (#25751) 2022-08-12 11:54:25 -04:00
Liam DeBeasi
d7116581c8 fix(datetime): highlights now show above content in modal (#25756)
resolves #25755
2022-08-12 11:39:15 -04:00
Liam DeBeasi
abb56d22b4 fix(input): exclude date inputs from scroll assist (#25749)
resolves #25745
2022-08-11 11:43:53 -04:00
Amanda Johnston
d0ba963599 fix(header): hide from screen readers when collapsed (#25744) 2022-08-11 09:04:48 -05:00
Sean Perkins
2ddaf7a5a2 chore(angular): use generated proxy declarations (#25728) 2022-08-10 23:12:55 -04:00
Sean Perkins
ae3cf144a6 test(accordion): standalone waits before capturing screenshot (#25733) 2022-08-10 22:42:43 -04:00
Liam DeBeasi
de20541486 fix(item): form validation caret color renders correctly (#25725)
resolves #25719
2022-08-10 16:12:51 -04:00
Liam DeBeasi
3ac667ca83 merge release-6.2.2
Release 6.2.2
2022-08-10 14:39:13 -05:00
ionitron
22830257cf chore(): update package lock files 2022-08-10 19:01:39 +00:00
420 changed files with 65780 additions and 1082 deletions

View File

@@ -30,7 +30,7 @@ runs:
with:
name: ionic-core
output: core/CoreBuild.zip
paths: core/dist core/components core/css core/hydrate core/loader
paths: core/dist core/components core/css core/hydrate core/loader core/src/components.d.ts
- uses: ./.github/workflows/actions/upload-archive
with:
name: ionic-core-src

View File

@@ -1,5 +1,8 @@
name: 'Test Angular E2E'
description: 'Test Angular E2E'
inputs:
app:
description: 'The specific test application'
runs:
using: 'composite'
steps:
@@ -29,15 +32,19 @@ runs:
name: ionic-angular-server
path: ./packages/angular-server
filename: AngularServerBuild.zip
- name: Create Test App
run: ./build.sh ${{ inputs.app }}
shell: bash
working-directory: ./angular/test
- name: Install Dependencies
run: npm install
shell: bash
working-directory: ./angular/test/test-app
working-directory: ./angular/test/build/${{ inputs.app }}
- name: Sync Built Changes
run: npm run sync
shell: bash
working-directory: ./angular/test/test-app
working-directory: ./angular/test/build/${{ inputs.app }}
- name: Run Tests
run: npm run test
shell: bash
working-directory: ./angular/test/test-app
working-directory: ./angular/test/build/${{ inputs.app }}

View File

@@ -1,5 +1,8 @@
name: 'Test Vue E2E'
description: 'Test Vue E2E'
inputs:
app:
description: 'The specific test application'
runs:
using: 'composite'
steps:
@@ -29,19 +32,23 @@ runs:
name: ionic-vue-router
path: ./packages/vue-router
filename: VueRouterBuild.zip
- name: Create Test App
run: ./build.sh ${{ inputs.app }}
shell: bash
working-directory: ./packages/vue/test
- name: Install Dependencies
run: npm install
shell: bash
working-directory: ./packages/vue/test-app
working-directory: ./packages/vue/test/build/${{ inputs.app }}
- name: Sync
run: npm run sync
shell: bash
working-directory: ./packages/vue/test-app
working-directory: ./packages/vue/test/build/${{ inputs.app }}
- name: Run Spec Tests
run: npm run test:unit
shell: bash
working-directory: ./packages/vue/test-app
working-directory: ./packages/vue/test/build/${{ inputs.app }}
- name: Run E2E Tests
run: npm run test:e2e
shell: bash
working-directory: ./packages/vue/test-app
working-directory: ./packages/vue/test/build/${{ inputs.app }}

View File

@@ -106,11 +106,26 @@ jobs:
- uses: ./.github/workflows/actions/build-vue-router
test-vue-e2e:
strategy:
fail-fast: false
matrix:
apps: [vue3]
needs: [build-vue, build-vue-router]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/actions/test-vue-e2e
with:
app: ${{ matrix.apps }}
verify-test-vue-e2e:
if: ${{ always() }}
needs: test-vue-e2e
runs-on: ubuntu-latest
steps:
- name: Check build matrix status
if: ${{ needs.test-vue-e2e.result != 'success' }}
run: exit 1
build-angular:
needs: [build-core]
@@ -127,11 +142,26 @@ jobs:
- uses: ./.github/workflows/actions/build-angular-server
test-angular-e2e:
strategy:
fail-fast: false
matrix:
apps: [ng12, ng13, ng14]
needs: [build-angular, build-angular-server]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/actions/test-angular-e2e
with:
app: ${{ matrix.apps }}
verify-test-angular-e2e:
if: ${{ always() }}
needs: test-angular-e2e
runs-on: ubuntu-latest
steps:
- name: Check build matrix status
if: ${{ needs.test-angular-e2e.result != 'success' }}
run: exit 1
build-react:
needs: [build-core]

11
.gitignore vendored
View File

@@ -22,7 +22,6 @@ temp/
core/theme-builder/
core/test-components/
core/css/
angular/css/
$RECYCLE.BIN/
.DS_Store
@@ -56,7 +55,6 @@ prerender-hydrated.html
prerender-static.html
# stencil
angular/css/
packages/react/css/
packages/vue/css/
core/components/
@@ -65,11 +63,18 @@ core/hydrate/
core/loader/
core/www/
.stencil/
angular/build/
# playwright
core/test-results/
core/playwright-report/
core/**/*-snapshots
# angular
angular/css/
angular/test/build/
.angular/
# vue
packages/vue/test/build/
.npmrc

View File

@@ -3,6 +3,42 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [6.2.4](https://github.com/ionic-team/ionic-framework/compare/v6.2.3...v6.2.4) (2022-08-24)
### Bug Fixes
* **alert:** add default aria-label ([#25800](https://github.com/ionic-team/ionic-framework/issues/25800)) ([d395a73](https://github.com/ionic-team/ionic-framework/commit/d395a73cb6c419e6c0072746b8e4768cd5f78ef3))
* **alert:** use aria-labelledby and aria-describedby instead of aria-label ([#25805](https://github.com/ionic-team/ionic-framework/issues/25805)) ([27318d7](https://github.com/ionic-team/ionic-framework/commit/27318d75df60dfce1a90f23ba31ea2b6636ba42f))
* **breadcrumb:** separator is not announced by narrators ([#25796](https://github.com/ionic-team/ionic-framework/issues/25796)) ([71fad38](https://github.com/ionic-team/ionic-framework/commit/71fad3884bc55b266067efb346500c848b856946))
* **datetime:** close month/year picker when hidden ([#25789](https://github.com/ionic-team/ionic-framework/issues/25789)) ([3b211b6](https://github.com/ionic-team/ionic-framework/commit/3b211b60fd9a88be6e232f839ecc4be090181530)), closes [#25787](https://github.com/ionic-team/ionic-framework/issues/25787)
* **modal:** role attribute can be customized ([#25804](https://github.com/ionic-team/ionic-framework/issues/25804)) ([037d579](https://github.com/ionic-team/ionic-framework/commit/037d579b2a3a660358f1e9c9b020c9510bb9c6b0))
* **react:** duplicate page transitions do not happen on react 18 ([#25798](https://github.com/ionic-team/ionic-framework/issues/25798)) ([a39d776](https://github.com/ionic-team/ionic-framework/commit/a39d776f087514b7fa744f44ce8ce2a04ed8aa43)), closes [#25797](https://github.com/ionic-team/ionic-framework/issues/25797)
* **refresher:** use componentOnReady utility for CE build ([#25783](https://github.com/ionic-team/ionic-framework/issues/25783)) ([bd715a5](https://github.com/ionic-team/ionic-framework/commit/bd715a52562f1f175d4bb6ea2dbfdd67a3e91db1)), closes [#25782](https://github.com/ionic-team/ionic-framework/issues/25782)
* **select:** compareWith passes params in correct order ([#25764](https://github.com/ionic-team/ionic-framework/issues/25764)) ([d631195](https://github.com/ionic-team/ionic-framework/commit/d6311951243fd9b867ae5d4a7a08c8d341f8eb7a)), closes [#25759](https://github.com/ionic-team/ionic-framework/issues/25759)
* **vue:** lifecycles now fire on tabs pages ([#25786](https://github.com/ionic-team/ionic-framework/issues/25786)) ([3020005](https://github.com/ionic-team/ionic-framework/commit/30200051bbab6ce57fd363668dafc49287c87c56)), closes [#25784](https://github.com/ionic-team/ionic-framework/issues/25784)
## [6.2.3](https://github.com/ionic-team/ionic-framework/compare/v6.2.2...v6.2.3) (2022-08-17)
### Bug Fixes
* **css:** preserve whitespace in selectors when minifying css ([#25767](https://github.com/ionic-team/ionic-framework/issues/25767)) ([bafa759](https://github.com/ionic-team/ionic-framework/commit/bafa759655a0f3ca206255ba429f21d319c37aed)), closes [#25766](https://github.com/ionic-team/ionic-framework/issues/25766)
* **datetime:** highlights now show above content in modal ([#25756](https://github.com/ionic-team/ionic-framework/issues/25756)) ([d711658](https://github.com/ionic-team/ionic-framework/commit/d7116581c8e92716f49877abc78d93dc39c34e1d)), closes [#25755](https://github.com/ionic-team/ionic-framework/issues/25755)
* **footer:** remove toolbar bottom padding if near bottom slot tabs or keyboard is open ([#25746](https://github.com/ionic-team/ionic-framework/issues/25746)) ([bb37446](https://github.com/ionic-team/ionic-framework/commit/bb374460320b0ba2ee03a5a0ecebb3e7a9f0728e))
* **header:** hide from screen readers when collapsed ([#25744](https://github.com/ionic-team/ionic-framework/issues/25744)) ([d0ba963](https://github.com/ionic-team/ionic-framework/commit/d0ba9635998f2157970156438c1bb74d6b9682f2))
* **input:** exclude date inputs from scroll assist ([#25749](https://github.com/ionic-team/ionic-framework/issues/25749)) ([abb56d2](https://github.com/ionic-team/ionic-framework/commit/abb56d22b4a81d1bc34c689de4ef7218e7503b20)), closes [#25745](https://github.com/ionic-team/ionic-framework/issues/25745)
* **item:** form validation caret color renders correctly ([#25725](https://github.com/ionic-team/ionic-framework/issues/25725)) ([de20541](https://github.com/ionic-team/ionic-framework/commit/de20541486bcf6e1d15f0ae5b0c5f177cce5eb38)), closes [#25719](https://github.com/ionic-team/ionic-framework/issues/25719)
* **refresher:** refresher is visible with multiple custom scroll targets ([#25750](https://github.com/ionic-team/ionic-framework/issues/25750)) ([e750e33](https://github.com/ionic-team/ionic-framework/commit/e750e336167397ed996d9833763286f4881e79b5)), closes [#25495](https://github.com/ionic-team/ionic-framework/issues/25495)
## [6.2.2](https://github.com/ionic-team/ionic-framework/compare/v6.2.1...v6.2.2) (2022-08-10)

View File

@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [6.2.4](https://github.com/ionic-team/ionic/compare/v6.2.3...v6.2.4) (2022-08-24)
**Note:** Version bump only for package @ionic/angular
## [6.2.3](https://github.com/ionic-team/ionic/compare/v6.2.2...v6.2.3) (2022-08-17)
**Note:** Version bump only for package @ionic/angular
## [6.2.2](https://github.com/ionic-team/ionic/compare/v6.2.1...v6.2.2) (2022-08-10)

View File

@@ -1,15 +1,15 @@
{
"name": "@ionic/angular",
"version": "6.2.2",
"version": "6.2.4",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@ionic/angular",
"version": "6.2.2",
"version": "6.2.4",
"license": "MIT",
"dependencies": {
"@ionic/core": "^6.2.1",
"@ionic/core": "^6.2.3",
"jsonc-parser": "^3.0.0",
"tslib": "^2.0.0"
},
@@ -1023,9 +1023,9 @@
"dev": true
},
"node_modules/@ionic/core": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.1.tgz",
"integrity": "sha512-bWlE2ZMR7tMyqcBhncc21zZPMZfCEoyGQP2bdu/ft1uov0ozw/wfETygd07C+0DOkbU6x1OYncIvo+1bzK4alA==",
"version": "6.2.3",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.3.tgz",
"integrity": "sha512-TqSVN5nfDC8Ovcfgv6PH6FsNY8P9Awl2zSXVMBpgr5CSFNOb6xB4U8utdhMtJbuo/OYgqAbjSVq+pD4RiBt1rw==",
"dependencies": {
"@stencil/core": "^2.16.0",
"ionicons": "^6.0.2",
@@ -7939,9 +7939,9 @@
"dev": true
},
"@ionic/core": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.1.tgz",
"integrity": "sha512-bWlE2ZMR7tMyqcBhncc21zZPMZfCEoyGQP2bdu/ft1uov0ozw/wfETygd07C+0DOkbU6x1OYncIvo+1bzK4alA==",
"version": "6.2.3",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.2.3.tgz",
"integrity": "sha512-TqSVN5nfDC8Ovcfgv6PH6FsNY8P9Awl2zSXVMBpgr5CSFNOb6xB4U8utdhMtJbuo/OYgqAbjSVq+pD4RiBt1rw==",
"requires": {
"@stencil/core": "^2.16.0",
"ionicons": "^6.0.2",

View File

@@ -1,6 +1,6 @@
{
"name": "@ionic/angular",
"version": "6.2.2",
"version": "6.2.4",
"description": "Angular specific wrappers for @ionic/core",
"keywords": [
"ionic",
@@ -44,7 +44,7 @@
"validate": "npm i && npm run lint && npm run test && npm run build"
},
"dependencies": {
"@ionic/core": "^6.2.2",
"@ionic/core": "^6.2.4",
"jsonc-parser": "^3.0.0",
"tslib": "^2.0.0"
},

View File

@@ -1,4 +1,3 @@
import * as d from './proxies';
export const DIRECTIVES = [
@@ -77,5 +76,5 @@ export const DIRECTIVES = [
d.IonThumbnail,
d.IonTitle,
d.IonToggle,
d.IonToolbar
d.IonToolbar,
];

View File

@@ -1,6 +1,6 @@
// DIRECTIVES
export { BooleanValueAccessorDirective as BooleanValueAccessor } from './directives/control-value-accessors/boolean-value-accessor';
export { NumericValueAccessorDirective as NumericValueAccessor } from './directives/control-value-accessors/numeric-value-accesssor';
export { NumericValueAccessorDirective as NumericValueAccessor } from './directives/control-value-accessors/numeric-value-accessor';
export { RadioValueAccessorDirective as RadioValueAccessor } from './directives/control-value-accessors/radio-value-accessor';
export { SelectValueAccessorDirective as SelectValueAccessor } from './directives/control-value-accessors/select-value-accessor';
export { TextValueAccessorDirective as TextValueAccessor } from './directives/control-value-accessors/text-value-accessor';

View File

@@ -4,7 +4,7 @@ import { IonicConfig } from '@ionic/core';
import { appInitialize } from './app-initialize';
import { BooleanValueAccessorDirective } from './directives/control-value-accessors/boolean-value-accessor';
import { NumericValueAccessorDirective } from './directives/control-value-accessors/numeric-value-accesssor';
import { NumericValueAccessorDirective } from './directives/control-value-accessors/numeric-value-accessor';
import { RadioValueAccessorDirective } from './directives/control-value-accessors/radio-value-accessor';
import { SelectValueAccessorDirective } from './directives/control-value-accessors/select-value-accessor';
import { TextValueAccessorDirective } from './directives/control-value-accessors/text-value-accessor';
@@ -18,84 +18,7 @@ import {
} from './directives/navigation/router-link-delegate';
import { IonModal } from './directives/overlays/modal';
import { IonPopover } from './directives/overlays/popover';
import {
IonAccordion,
IonAccordionGroup,
IonApp,
IonAvatar,
IonBackButton,
IonBackdrop,
IonBadge,
IonBreadcrumb,
IonBreadcrumbs,
IonButton,
IonButtons,
IonCard,
IonCardContent,
IonCardHeader,
IonCardSubtitle,
IonCardTitle,
IonCheckbox,
IonChip,
IonCol,
IonContent,
IonDatetime,
IonDatetimeButton,
IonFab,
IonFabButton,
IonFabList,
IonFooter,
IonGrid,
IonHeader,
IonIcon,
IonImg,
IonInfiniteScroll,
IonInfiniteScrollContent,
IonInput,
IonItem,
IonItemDivider,
IonItemGroup,
IonItemOption,
IonItemOptions,
IonItemSliding,
IonLabel,
IonList,
IonListHeader,
IonMenu,
IonMenuButton,
IonMenuToggle,
IonNav,
IonNavLink,
IonNote,
IonProgressBar,
IonRadio,
IonRadioGroup,
IonRange,
IonRefresher,
IonRefresherContent,
IonReorder,
IonReorderGroup,
IonRippleEffect,
IonRow,
IonSearchbar,
IonSegment,
IonSegmentButton,
IonSelect,
IonSelectOption,
IonSkeletonText,
IonSlide,
IonSlides,
IonSpinner,
IonSplitPane,
IonTabBar,
IonTabButton,
IonText,
IonTextarea,
IonThumbnail,
IonTitle,
IonToggle,
IonToolbar,
} from './directives/proxies';
import { DIRECTIVES } from './directives/proxies-list';
import { VirtualFooter } from './directives/virtual-scroll/virtual-footer';
import { VirtualHeader } from './directives/virtual-scroll/virtual-header';
import { VirtualItem } from './directives/virtual-scroll/virtual-item';
@@ -106,87 +29,12 @@ import { ModalController } from './providers/modal-controller';
import { PopoverController } from './providers/popover-controller';
const DECLARATIONS = [
// proxies
IonAccordion,
IonAccordionGroup,
IonApp,
IonAvatar,
IonBackButton,
IonBackdrop,
IonBadge,
IonBreadcrumb,
IonBreadcrumbs,
IonButton,
IonButtons,
IonCard,
IonCardContent,
IonCardHeader,
IonCardSubtitle,
IonCardTitle,
IonCheckbox,
IonChip,
IonCol,
IonContent,
IonDatetime,
IonDatetimeButton,
IonFab,
IonFabButton,
IonFabList,
IonFooter,
IonGrid,
IonHeader,
IonIcon,
IonImg,
IonInfiniteScroll,
IonInfiniteScrollContent,
IonInput,
IonItem,
IonItemDivider,
IonItemGroup,
IonItemOption,
IonItemOptions,
IonItemSliding,
IonLabel,
IonList,
IonListHeader,
IonMenu,
IonMenuButton,
IonMenuToggle,
IonModal,
IonNav,
IonNavLink,
IonNote,
IonPopover,
IonProgressBar,
IonRadio,
IonRadioGroup,
IonRange,
IonRefresher,
IonRefresherContent,
IonReorder,
IonReorderGroup,
IonRippleEffect,
IonRow,
IonSearchbar,
IonSegment,
IonSegmentButton,
IonSelect,
IonSelectOption,
IonSkeletonText,
IonSlide,
IonSlides,
IonSpinner,
IonSplitPane,
IonTabBar,
IonTabButton,
IonText,
IonTextarea,
IonThumbnail,
IonToggle,
IonToolbar,
IonTitle,
// generated proxies
...DIRECTIVES,
IonTabs,
// manual proxies
IonModal,
IonPopover,
// ngModel accessors
BooleanValueAccessorDirective,
@@ -196,6 +44,7 @@ const DECLARATIONS = [
TextValueAccessorDirective,
// navigation
IonTabs,
IonRouterOutlet,
IonBackButtonDelegateDirective,
NavDelegate,

69
angular/test/README.md Normal file
View File

@@ -0,0 +1,69 @@
# Angular E2E Test Apps
Ionic Framework supports multiple versions of Angular. As a result, we need to verify that Ionic works correctly with each of these Angular versions.
## Test App Build Structure
Unlike other test applications, these test apps are broken up into multiple directories. These directories are then combined to create a single application. This allows us to share common application code, tests, etc so that each app is being tested the same way. Below details the different pieces that help create a single test application.
**apps** - This directory contains partial applications for each version of Angular we want to test. Typically these directories contain new `package.json` files, `angular.json` files, and more. If you have code that is specific to a particular version of Angular, put it in this directory.
**base** - This directory contains the base application that each test app will use. This is where tests, application logic, and more live. If you have code that needs to be run on every test app, put it in this directory.
**build** - When the `apps` and `base` directories are merged, the final result is put in this directory. The `build` directory should never be committed to git.
**build.sh** - This is the script that merges the `apps` and `base` directories and places the built application in the `build` directory.
Usage:
```shell
# Build a test app using apps/ng14 as a reference
./build.sh ng14
```
## How to modify test apps
To add new tests, components, or pages, modify the `base` project. This ensures that tests are run for every tested version.
If you want to add a version-specific change, add the change inside of the appropriate projects in `apps`. Be sure to replicate the directory structure. For example, if you are adding a new E2E test file called `test.spec.ts` in `apps/ng14`, make sure you place the file in `apps/ng14/e2e/src/test.spec.ts`.
### Version-specific tests
If you need to add E2E tests that are only run on a specific version of the JS Framework, replicate the `VersionTest` component on each partial application. This ensures that tests for framework version X do not get run for framework version Y.
## Adding New Test Apps
As we add support for new versions of Angular, we will also need to update this directory to test against new applications. The following steps can serve as a guide for adding new apps:
1. Navigate to the built app for the most recent version of Angular that Ionic tests.
2. Update the application by following the steps on https://update.angular.io/.
3. Make note of any files that changed during the upgrade (`package.json`, `package-lock.json`, `angular.json`, etc).
4. Copy the changed files to a new directory in `apps`.
5. Add a new entry to the matrix for `test-core-angular` in `./github/workflows/build.yml`. This will allow the new test app to run against all PRs.
6. Commit these changes and push.
Example:
In this example, we are going to add the Angular 14 test app.
1. Build the Angular 13 test app using `./build.sh ng13`.
2. Navigate to `build/ng13`.
3. Perform the upgrade steps on https://update.angular.io/. The "From" field should say "13.0" and the "To" field should say "14.0".
Note: You may encounter some other peer dependency issues not covered by the Angular Upgrade Guide. These peer dependency issues can be resolved manually by updating the installed version of each dependency.
4. Observe that the output of the Angular upgrade indicates that the following files were modified:
`angular.json`
`package-lock.json`
`package.json`
`tsconfig.json`
`src/app/form/form.component.ts`
`src/app/modal-example/modal-example.component.ts`
5. Create a directory in `apps` named `ng14`.
6. Copy the modified files to the `apps/ng14` directory.
7. Open `./github/workflows/build.yml` and find the `test-angular-e2e` job.
8. Find the `apps` field under `matrix`.
9. Add "ng14" to the `apps` field.
10. Committ these changes and push.

34797
angular/test/apps/ng12/package-lock.json generated Normal file
View File

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,68 @@
{
"name": "ionic-angular-test-app",
"version": "0.0.0",
"private": true,
"scripts": {
"ng": "ng",
"start": "ng serve",
"sync:build": "sh scripts/build-ionic.sh",
"sync": "sh scripts/sync.sh",
"build": "ng build --configuration production --no-progress",
"lint": "ng lint",
"postinstall": "ngcc",
"serve:ssr": "node dist/test-app/server/main.js",
"build:ssr": "ng build --prod && ng run test-app:server:production",
"dev:ssr": "ng run test-app:serve-ssr",
"prerender": "ng run test-app:prerender",
"cy.open": "cypress open",
"cy.run": "cypress run",
"test": "concurrently \"npm run start -- --configuration production\" \"wait-on http-get://localhost:4200 && npm run cy.run\" --kill-others --success first",
"test.watch": "concurrently \"npm run start\" \"wait-on http-get://localhost:4200 && npm run cy.open\" --kill-others --success first"
},
"dependencies": {
"@angular/animations": "^12.2.16",
"@angular/common": "^12.2.16",
"@angular/compiler": "^12.2.16",
"@angular/core": "^12.2.16",
"@angular/forms": "^12.2.16",
"@angular/platform-browser": "^12.2.16",
"@angular/platform-browser-dynamic": "^12.2.16",
"@angular/platform-server": "^12.2.16",
"@angular/router": "^12.2.16",
"@ionic/angular": "^6.1.15",
"@ionic/angular-server": "^6.1.15",
"@nguniversal/express-engine": "^12.1.3",
"angular-in-memory-web-api": "^0.11.0",
"core-js": "^2.6.11",
"express": "^4.15.2",
"rxjs": "^6.5.5",
"tslib": "^2.0.0",
"typescript-eslint-language-service": "^4.1.5",
"zone.js": "^0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^12.2.18",
"@angular-eslint/builder": "^12.7.0",
"@angular-eslint/eslint-plugin": "^12.7.0",
"@angular-eslint/eslint-plugin-template": "^12.7.0",
"@angular-eslint/schematics": "^12.7.0",
"@angular-eslint/template-parser": "^12.7.0",
"@angular/cli": "^12.2.16",
"@angular/compiler-cli": "^12.2.16",
"@angular/language-service": "^12.2.16",
"@nguniversal/builders": "^12.1.3",
"@types/express": "^4.17.7",
"@types/node": "^12.12.54",
"@typescript-eslint/eslint-plugin": "4.28.2",
"@typescript-eslint/parser": "4.28.2",
"concurrently": "^6.0.0",
"cypress": "^10.2.0",
"eslint": "^7.26.0",
"ts-loader": "^6.2.2",
"ts-node": "^8.3.0",
"typescript": "~4.3.5",
"wait-on": "^5.2.1",
"webpack": "^5.61.0",
"webpack-cli": "^4.9.2"
}
}

View File

@@ -18,8 +18,8 @@
"@angular/platform-browser-dynamic": "^13.1.3",
"@angular/platform-server": "^13.1.3",
"@angular/router": "^13.1.3",
"@ionic/angular": "^6.0.12",
"@ionic/angular-server": "^6.0.12",
"@ionic/angular": "^6.1.15",
"@ionic/angular-server": "^6.1.15",
"@nguniversal/express-engine": "^13.1.1",
"angular-in-memory-web-api": "^0.11.0",
"core-js": "^2.6.11",
@@ -2690,11 +2690,11 @@
"dev": true
},
"node_modules/@ionic/angular": {
"version": "6.1.9",
"resolved": "https://registry.npmjs.org/@ionic/angular/-/angular-6.1.9.tgz",
"integrity": "sha512-TeuMZnDMTpmueOJNACQ52ERUlb0pgwl5EgdRzl1R5bl8d8qjkUCnXgn042xPVfsEjD2ZxPGDFfOuYGqeYIfYkQ==",
"version": "6.1.15",
"resolved": "https://registry.npmjs.org/@ionic/angular/-/angular-6.1.15.tgz",
"integrity": "sha512-1CY/MwlOMlUbyDwlTOYzsxGzugFrgY0QftyMQE99KeMC1z/a8ZazNYvSHGNUAetneO+hU9LIXtM/q14a9bC/Hw==",
"dependencies": {
"@ionic/core": "^6.1.9",
"@ionic/core": "^6.1.15",
"jsonc-parser": "^3.0.0",
"tslib": "^2.0.0"
},
@@ -2707,9 +2707,9 @@
}
},
"node_modules/@ionic/angular-server": {
"version": "6.1.9",
"resolved": "https://registry.npmjs.org/@ionic/angular-server/-/angular-server-6.1.9.tgz",
"integrity": "sha512-9psF+OSDXnPH1fLJA+kcRlGea4U5v6MCKBbcHeCa1Hwf7B7/AyZtYcB7rC5HI3EkmlvV0GtIjzeJ508RHvMamw==",
"version": "6.1.15",
"resolved": "https://registry.npmjs.org/@ionic/angular-server/-/angular-server-6.1.15.tgz",
"integrity": "sha512-2ygmB54PTW2SnSqfpjnqVVtCTj1WE8qloUOcma1oK7tfJnJYrzgO5YKDqmlUJMaaquxZa6YvJaenHRj6b0G54w==",
"dependencies": {
"tslib": "^2.2.0"
},
@@ -2722,9 +2722,9 @@
}
},
"node_modules/@ionic/core": {
"version": "6.1.9",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.1.9.tgz",
"integrity": "sha512-EaClsiGB/E9wPkujnrMZ71BLVcA8t6DBZu+caJMmqPLF/64S37CiyfrrMbL1UnxDWP2TXsPFH3seWl6Ek/W1bw==",
"version": "6.1.15",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.1.15.tgz",
"integrity": "sha512-NvBlHR7O4kfp9KYz6oLsghFzGZImA7hM4qS4tFRUI62R+Q5iCJEY4OmXE5bif5K+SQkMhQY+x1l2Nq20waLzLg==",
"dependencies": {
"@stencil/core": "^2.16.0",
"ionicons": "^6.0.2",
@@ -3423,9 +3423,9 @@
"dev": true
},
"node_modules/@stencil/core": {
"version": "2.16.1",
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.16.1.tgz",
"integrity": "sha512-s/UJp9qxExL3DyQPT70kiuWeb3AdjbUZM+5lEIXn30I2DLcLYPOPXfsoWJODieQywq+3vPiLZeIdkoqjf6jcSw==",
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.17.1.tgz",
"integrity": "sha512-ErjQsNALgZQ9SYeBHhqwL1UO+Zbptwl3kwrRJC2tGlc3G/T6UvPuaKr+PGsqI+CZGia+0+R5EELQvFu74mYeIg==",
"bin": {
"stencil": "bin/stencil"
},
@@ -9851,6 +9851,18 @@
"@stencil/core": "~2.16.0"
}
},
"node_modules/ionicons/node_modules/@stencil/core": {
"version": "2.16.1",
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.16.1.tgz",
"integrity": "sha512-s/UJp9qxExL3DyQPT70kiuWeb3AdjbUZM+5lEIXn30I2DLcLYPOPXfsoWJODieQywq+3vPiLZeIdkoqjf6jcSw==",
"bin": {
"stencil": "bin/stencil"
},
"engines": {
"node": ">=12.10.0",
"npm": ">=6.0.0"
}
},
"node_modules/ip": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz",
@@ -18207,27 +18219,27 @@
"dev": true
},
"@ionic/angular": {
"version": "6.1.9",
"resolved": "https://registry.npmjs.org/@ionic/angular/-/angular-6.1.9.tgz",
"integrity": "sha512-TeuMZnDMTpmueOJNACQ52ERUlb0pgwl5EgdRzl1R5bl8d8qjkUCnXgn042xPVfsEjD2ZxPGDFfOuYGqeYIfYkQ==",
"version": "6.1.15",
"resolved": "https://registry.npmjs.org/@ionic/angular/-/angular-6.1.15.tgz",
"integrity": "sha512-1CY/MwlOMlUbyDwlTOYzsxGzugFrgY0QftyMQE99KeMC1z/a8ZazNYvSHGNUAetneO+hU9LIXtM/q14a9bC/Hw==",
"requires": {
"@ionic/core": "^6.1.9",
"@ionic/core": "^6.1.15",
"jsonc-parser": "^3.0.0",
"tslib": "^2.0.0"
}
},
"@ionic/angular-server": {
"version": "6.1.9",
"resolved": "https://registry.npmjs.org/@ionic/angular-server/-/angular-server-6.1.9.tgz",
"integrity": "sha512-9psF+OSDXnPH1fLJA+kcRlGea4U5v6MCKBbcHeCa1Hwf7B7/AyZtYcB7rC5HI3EkmlvV0GtIjzeJ508RHvMamw==",
"version": "6.1.15",
"resolved": "https://registry.npmjs.org/@ionic/angular-server/-/angular-server-6.1.15.tgz",
"integrity": "sha512-2ygmB54PTW2SnSqfpjnqVVtCTj1WE8qloUOcma1oK7tfJnJYrzgO5YKDqmlUJMaaquxZa6YvJaenHRj6b0G54w==",
"requires": {
"tslib": "^2.2.0"
}
},
"@ionic/core": {
"version": "6.1.9",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.1.9.tgz",
"integrity": "sha512-EaClsiGB/E9wPkujnrMZ71BLVcA8t6DBZu+caJMmqPLF/64S37CiyfrrMbL1UnxDWP2TXsPFH3seWl6Ek/W1bw==",
"version": "6.1.15",
"resolved": "https://registry.npmjs.org/@ionic/core/-/core-6.1.15.tgz",
"integrity": "sha512-NvBlHR7O4kfp9KYz6oLsghFzGZImA7hM4qS4tFRUI62R+Q5iCJEY4OmXE5bif5K+SQkMhQY+x1l2Nq20waLzLg==",
"requires": {
"@stencil/core": "^2.16.0",
"ionicons": "^6.0.2",
@@ -18760,9 +18772,9 @@
"dev": true
},
"@stencil/core": {
"version": "2.16.1",
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.16.1.tgz",
"integrity": "sha512-s/UJp9qxExL3DyQPT70kiuWeb3AdjbUZM+5lEIXn30I2DLcLYPOPXfsoWJODieQywq+3vPiLZeIdkoqjf6jcSw=="
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.17.1.tgz",
"integrity": "sha512-ErjQsNALgZQ9SYeBHhqwL1UO+Zbptwl3kwrRJC2tGlc3G/T6UvPuaKr+PGsqI+CZGia+0+R5EELQvFu74mYeIg=="
},
"@tootallnate/once": {
"version": "2.0.0",
@@ -23492,6 +23504,13 @@
"integrity": "sha512-AyKfFaUKVoBz4eB8XkU7H1R5HFnVsgq5ijqSdbXC0lES9PDK/J6LUQz6XUJq0mVVQF5k9kczSPOLMW3mszG0mQ==",
"requires": {
"@stencil/core": "~2.16.0"
},
"dependencies": {
"@stencil/core": {
"version": "2.16.1",
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.16.1.tgz",
"integrity": "sha512-s/UJp9qxExL3DyQPT70kiuWeb3AdjbUZM+5lEIXn30I2DLcLYPOPXfsoWJODieQywq+3vPiLZeIdkoqjf6jcSw=="
}
}
},
"ip": {

View File

@@ -29,8 +29,8 @@
"@angular/platform-browser-dynamic": "^13.1.3",
"@angular/platform-server": "^13.1.3",
"@angular/router": "^13.1.3",
"@ionic/angular": "^6.0.12",
"@ionic/angular-server": "^6.0.12",
"@ionic/angular": "^6.1.15",
"@ionic/angular-server": "^6.1.15",
"@nguniversal/express-engine": "^13.1.1",
"angular-in-memory-web-api": "^0.11.0",
"core-js": "^2.6.11",

View File

@@ -0,0 +1,53 @@
import { Component } from '@angular/core';
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
@Component({
selector: 'app-form',
templateUrl: './form.component.html',
})
export class FormComponent {
submitted = 'false';
profileForm: FormGroup;
outsideToggle = new FormControl(true);
constructor(fb: FormBuilder) {
this.profileForm = fb.group({
datetime: ['2010-08-20', Validators.required],
select: [undefined, Validators.required],
toggle: [false],
input: ['', Validators.required],
input2: ['Default Value'],
checkbox: [false],
range: [5, Validators.min(10)],
}, {
updateOn: typeof (window as any) !== 'undefined' && window.location.hash === '#blur' ? 'blur' : 'change'
});
}
setTouched() {
const formControl = this.profileForm.get('input');
formControl.markAsTouched();
}
onSubmit(_ev) {
this.submitted = 'true';
}
setValues() {
this.profileForm.patchValue({
datetime: '2010-08-20',
select: 'nes',
toggle: true,
input: 'Some value',
input2: 'Another values',
checkbox: true,
range: 50
});
}
markAllAsTouched() {
this.profileForm.markAllAsTouched();
}
}

View File

@@ -0,0 +1,70 @@
import { Component, Input, NgZone, OnInit, Optional } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { ModalController, NavParams, IonNav, ViewWillLeave, ViewDidEnter, ViewDidLeave } from '@ionic/angular';
@Component({
selector: 'app-modal-example',
templateUrl: './modal-example.component.html',
})
export class ModalExampleComponent implements OnInit, ViewWillLeave, ViewDidEnter, ViewWillLeave, ViewDidLeave {
@Input() value: string;
form = new FormGroup({
select: new FormControl([])
});
valueFromParams: string;
onInit = 0;
willEnter = 0;
didEnter = 0;
willLeave = 0;
didLeave = 0;
modal: HTMLElement;
constructor(
private modalCtrl: ModalController,
@Optional() public nav: IonNav,
navParams: NavParams
) {
this.valueFromParams = navParams.get('prop');
}
ngOnInit() {
NgZone.assertInAngularZone();
this.onInit++;
}
ionViewWillEnter() {
if (this.onInit !== 1) {
throw new Error('ngOnInit was not called');
}
NgZone.assertInAngularZone();
this.willEnter++;
}
ionViewDidEnter() {
NgZone.assertInAngularZone();
this.didEnter++;
}
ionViewWillLeave() {
NgZone.assertInAngularZone();
this.willLeave++;
}
ionViewDidLeave() {
NgZone.assertInAngularZone();
this.didLeave++;
}
closeModal() {
this.modalCtrl.dismiss();
}
push() {
this.nav.push(ModalExampleComponent, {
'value': 'pushed!'
});
}
pop() {
this.nav.pop();
}
}

View File

@@ -0,0 +1,26 @@
{
"compileOnSave": false,
"compilerOptions": {
"importHelpers": true,
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"module": "es2020",
"target": "es2015",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
],
"plugins": [
{
"name": "typescript-eslint-language-service"
}
]
}
}

28316
angular/test/apps/ng14/package-lock.json generated Normal file
View File

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,68 @@
{
"name": "ionic-angular-test-app",
"version": "0.0.0",
"private": true,
"scripts": {
"ng": "ng",
"start": "ng serve",
"sync:build": "sh scripts/build-ionic.sh",
"sync": "sh scripts/sync.sh",
"build": "ng build --configuration production --no-progress",
"lint": "ng lint",
"postinstall": "ngcc",
"serve:ssr": "node dist/test-app/server/main.js",
"build:ssr": "ng build --prod && ng run test-app:server:production",
"dev:ssr": "ng run test-app:serve-ssr",
"prerender": "ng run test-app:prerender",
"cy.open": "cypress open",
"cy.run": "cypress run",
"test": "concurrently \"npm run start -- --configuration production\" \"wait-on http-get://localhost:4200 && npm run cy.run\" --kill-others --success first",
"test.watch": "concurrently \"npm run start\" \"wait-on http-get://localhost:4200 && npm run cy.open\" --kill-others --success first"
},
"dependencies": {
"@angular/animations": "^14.1.0",
"@angular/common": "^14.1.0",
"@angular/compiler": "^14.1.0",
"@angular/core": "^14.1.0",
"@angular/forms": "^14.1.0",
"@angular/platform-browser": "^14.1.0",
"@angular/platform-browser-dynamic": "^14.1.0",
"@angular/platform-server": "^14.1.0",
"@angular/router": "^14.1.0",
"@ionic/angular": "^6.1.15",
"@ionic/angular-server": "^6.1.15",
"@nguniversal/express-engine": "^14.0.3",
"angular-in-memory-web-api": "^0.11.0",
"core-js": "^2.6.11",
"express": "^4.15.2",
"rxjs": "^6.5.5",
"tslib": "^2.0.0",
"typescript-eslint-language-service": "^4.1.5",
"zone.js": "^0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^14.1.0",
"@angular-eslint/builder": "^14.0.2",
"@angular-eslint/eslint-plugin": "^14.0.2",
"@angular-eslint/eslint-plugin-template": "^14.0.2",
"@angular-eslint/schematics": "^14.0.2",
"@angular-eslint/template-parser": "^14.0.2",
"@angular/cli": "^14.1.0",
"@angular/compiler-cli": "^14.1.0",
"@angular/language-service": "^14.1.0",
"@nguniversal/builders": "^14.0.3",
"@types/express": "^4.17.7",
"@types/node": "^12.12.54",
"@typescript-eslint/eslint-plugin": "4.28.2",
"@typescript-eslint/parser": "4.28.2",
"concurrently": "^6.0.0",
"cypress": "^10.2.0",
"eslint": "^7.26.0",
"ts-loader": "^6.2.2",
"ts-node": "^8.3.0",
"typescript": "~4.6.0",
"wait-on": "^5.2.1",
"webpack": "^5.61.0",
"webpack-cli": "^4.9.2"
}
}

View File

@@ -0,0 +1,26 @@
{
"compileOnSave": false,
"compilerOptions": {
"importHelpers": true,
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"module": "es2020",
"target": "es2020",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
],
"plugins": [
{
"name": "typescript-eslint-language-service"
}
]
}
}

View File

@@ -140,8 +140,9 @@
}
}
},
"defaultProject": "test-app",
"cli": {
"defaultCollection": "@angular-eslint/schematics"
"schematicCollections": [
"@angular-eslint/schematics"
]
}
}

View File

@@ -0,0 +1,20 @@
# Copy angular dist
rm -rf node_modules/@ionic/angular
cp -a ../../../dist node_modules/@ionic/angular
# Copy angular server
rm -rf node_modules/@ionic/angular-server
cp -a ../../../../packages/angular-server/dist node_modules/@ionic/angular-server
# # Copy core dist
rm -rf node_modules/@ionic/core
mkdir node_modules/@ionic/core
cp -a ../../../../core/css node_modules/@ionic/core/css
cp -a ../../../../core/dist node_modules/@ionic/core/dist
cp -a ../../../../core/hydrate node_modules/@ionic/core/hydrate
cp -a ../../../../core/loader node_modules/@ionic/core/loader
cp -a ../../../../core/package.json node_modules/@ionic/core/package.json
# # Copy ionicons
rm -rf node_modules/ionicons
cp -a ../../../../core/node_modules/ionicons node_modules/ionicons

View File

@@ -24,6 +24,7 @@ import { AccordionComponent } from './accordion/accordion.component';
const routes: Routes = [
{ path: '', component: HomePageComponent },
{ path: 'version-test', loadChildren: () => import('./version-test').then(m => m.VersionTestModule) },
{ path: 'accordions', component: AccordionComponent },
{ path: 'alerts', component: AlertComponent },
{ path: 'inputs', component: InputsComponent },

View File

@@ -0,0 +1,53 @@
import { Component } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators, UntypedFormControl } from '@angular/forms';
@Component({
selector: 'app-form',
templateUrl: './form.component.html',
})
export class FormComponent {
submitted = 'false';
profileForm: UntypedFormGroup;
outsideToggle = new UntypedFormControl(true);
constructor(fb: UntypedFormBuilder) {
this.profileForm = fb.group({
datetime: ['2010-08-20', Validators.required],
select: [undefined, Validators.required],
toggle: [false],
input: ['', Validators.required],
input2: ['Default Value'],
checkbox: [false],
range: [5, Validators.min(10)],
}, {
updateOn: typeof (window as any) !== 'undefined' && window.location.hash === '#blur' ? 'blur' : 'change'
});
}
setTouched() {
const formControl = this.profileForm.get('input');
formControl.markAsTouched();
}
onSubmit(_ev) {
this.submitted = 'true';
}
setValues() {
this.profileForm.patchValue({
datetime: '2010-08-20',
select: 'nes',
toggle: true,
input: 'Some value',
input2: 'Another values',
checkbox: true,
range: 50
});
}
markAllAsTouched() {
this.profileForm.markAllAsTouched();
}
}

View File

@@ -0,0 +1,70 @@
import { Component, Input, NgZone, OnInit, Optional } from '@angular/core';
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { ModalController, NavParams, IonNav, ViewWillLeave, ViewDidEnter, ViewDidLeave } from '@ionic/angular';
@Component({
selector: 'app-modal-example',
templateUrl: './modal-example.component.html',
})
export class ModalExampleComponent implements OnInit, ViewWillLeave, ViewDidEnter, ViewWillLeave, ViewDidLeave {
@Input() value: string;
form = new UntypedFormGroup({
select: new UntypedFormControl([])
});
valueFromParams: string;
onInit = 0;
willEnter = 0;
didEnter = 0;
willLeave = 0;
didLeave = 0;
modal: HTMLElement;
constructor(
private modalCtrl: ModalController,
@Optional() public nav: IonNav,
navParams: NavParams
) {
this.valueFromParams = navParams.get('prop');
}
ngOnInit() {
NgZone.assertInAngularZone();
this.onInit++;
}
ionViewWillEnter() {
if (this.onInit !== 1) {
throw new Error('ngOnInit was not called');
}
NgZone.assertInAngularZone();
this.willEnter++;
}
ionViewDidEnter() {
NgZone.assertInAngularZone();
this.didEnter++;
}
ionViewWillLeave() {
NgZone.assertInAngularZone();
this.willLeave++;
}
ionViewDidLeave() {
NgZone.assertInAngularZone();
this.didLeave++;
}
closeModal() {
this.modalCtrl.dismiss();
}
push() {
this.nav.push(ModalExampleComponent, {
'value': 'pushed!'
});
}
pop() {
this.nav.pop();
}
}

Some files were not shown because too many files have changed in this diff Show More