Skip to content

report() bug reproduced code. lifecycle, viewChild and angular syntax. #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/angular/ionic-angular-modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@angular/platform-browser": "^16.0.0",
"@angular/platform-browser-dynamic": "^16.0.0",
"@angular/router": "^16.0.0",
"@ionic/angular": "^7.0.0",
"@ionic/angular": "^7.5.0",
"ionicons": "^7.0.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/angular/ionic-angular-standalone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@capacitor/haptics": "5.0.6",
"@capacitor/keyboard": "5.0.6",
"@capacitor/status-bar": "5.0.6",
"@ionic/angular": "^7.0.0",
"@ionic/angular": "^7.5.0",
"ionicons": "^7.0.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>lifecycle</ion-title>
</ion-toolbar>
</ion-header>

<ion-content [fullscreen]="true">
<ion-header collapse="condense">
<ion-toolbar>
<ion-title size="large">lifecycle</ion-title>
</ion-toolbar>
</ion-header>
</ion-content>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { LifecyclePage } from './lifecycle.page';

describe('LifecyclePage', () => {
let component: LifecyclePage;
let fixture: ComponentFixture<LifecyclePage>;

beforeEach(async(() => {
fixture = TestBed.createComponent(LifecyclePage);
component = fixture.componentInstance;
fixture.detectChanges();
}));

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Component, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule, ViewWillEnter, ViewDidEnter, ViewWillLeave, ViewDidLeave } from '@ionic/angular';

@Component({
selector: 'app-lifecycle',
templateUrl: './lifecycle.page.html',
styleUrls: ['./lifecycle.page.scss'],
standalone: true,
imports: [IonicModule, CommonModule, FormsModule]
})
/**
* Error due to `@ionic/angular/standalone` not containing a lifecycle.
*/
export class LifecyclePage implements OnInit, ViewWillEnter, ViewDidEnter, ViewWillLeave, ViewDidLeave {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error due to @ionic/angular/standalone not containing a lifecycle.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks to be a missing set of exports from Ionic Framework. This will be addressed here: ionic-team/ionic-framework#28346!


constructor() { }

ngOnInit() {
}

ionViewWillEnter() {
}

ionViewDidEnter() {
}

ionViewWillLeave() {
}

ionViewDidLeave() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<ion-header>
<ion-toolbar>
<ion-buttons slot="start" *ngIf="!isForce"><!-- I have checked to the point where ngIf is having an impact.-->
<ion-button><ion-icon name="close-outline" slot="icon-only"></ion-icon></ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>

<ion-content>
<div class="ion-text-center ion-padding-top">
<ion-button
class="medium-size"
type="submit"
shape="round"
fill="outline"
[disabled]="isLoading"
>
<ion-spinner slot="start" *ngIf="isSpinner"></ion-spinner>
Login
</ion-button>
</div>
</ion-content>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NotImportOnePage } from './not-import-one.page';

describe('NotImportOnePage', () => {
let component: NotImportOnePage;
let fixture: ComponentFixture<NotImportOnePage>;

beforeEach(async(() => {
fixture = TestBed.createComponent(NotImportOnePage);
component = fixture.componentInstance;
fixture.detectChanges();
}));

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Component, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';

@Component({
selector: 'app-not-import-one',
templateUrl: './not-import-one.page.html',
styleUrls: ['./not-import-one.page.scss'],
standalone: true,
imports: [IonicModule, CommonModule, FormsModule]
})
export class NotImportOnePage implements OnInit {
isForce = false;
isLoading = false;
isSpinner = false;
constructor() { }

ngOnInit() {
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<ion-header [translucent]="true">
<ion-toolbar>
<ion-title>view-child</ion-title>
</ion-toolbar>
</ion-header>

<ion-content [fullscreen]="true">
<ion-header collapse="condense">
<ion-toolbar>
<ion-title size="large">view-child</ion-title>
</ion-toolbar>
</ion-header>
</ion-content>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ViewChildPage } from './view-child.page';

describe('ViewChildPage', () => {
let component: ViewChildPage;
let fixture: ComponentFixture<ViewChildPage>;

beforeEach(async(() => {
fixture = TestBed.createComponent(ViewChildPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {Component, OnInit, ViewChild} from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import {IonContent, IonicModule} from '@ionic/angular';

@Component({
selector: 'app-view-child',
templateUrl: './view-child.page.html',
styleUrls: ['./view-child.page.scss'],
standalone: true,
imports: [IonicModule, CommonModule, FormsModule]
})
export class ViewChildPage implements OnInit {
/**
* Referencing the template's ion-content results in a double call.
*/
@ViewChild(IonContent)
content!: IonContent;

constructor() { }

ngOnInit() {
}
}