Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all 49296 articles
Browse latest View live

Page going blank when scrolling fast

$
0
0

I am developing an app with a heavily loaded home page (like the one from deliveroo) and I noticed that if I scroll too fast or even moderately fast the page contents go blank. I’ve tried all I could find about web performance from the Google’s docs and the metrics for this home page are fine. However, I still get this behavior, which is more easily noticed in low-end devices, android phones or even a xiaomi note 7 for example (the one I am using for testing, which has 6gb of RAM).

Has anyone noticed this too? How can I make the page elements not disappear when scrolling?

2 posts - 2 participants

Read full topic


How to disable drag on IonModal bottom sheet?

Maskito - model value is masked too

$
0
0

Hi, I using ionic with maskito for input mask - test app here Ionic Docs Example - StackBlitz

But, why is changed model?

I need mask only for user but I model need clean without mask.

Any ideas for this isssue?

Thanks a lot

1 post - 1 participant

Read full topic

IonPickerColumn, IonPickerColumnOption - forgot to export?

$
0
0

Hi.
I have encountered several issues.
I need to create a component with time - which, upon clicking - will open a modal with a wheel to select from (the type you see in ion-datetime). But I don’t need the calendar, only the time.

<ion-datetime-button />

The above mounts both buttons (for some reason) - and you also cannot hide one of them, because they both have the same ::part() attribute, but different ids.

I do not know how to target different ids of the elements with the same part attributes - if anybody knows how to do that (if it is even possible) - please let me know.

Since using shadow-dom was a terrible idea on Ionic team, I tried to make my own component for time via using

 <ion-picker>

I literally copied the example from documentation - and it does not work. It sees IonPicker, but does not see

IonPickerColumn,
IonPickerColumnOption

Did you forget to export them?

UPD: Apparently we are using IonicV7, whilist I was looking at documentation of IonicV8 (IonPickerColumn and IonPickerColumnOption were added in V8.

At least with one question we’re done - but I still cannot understand how to show only the time picker (with the wheel) and not show date with it. Is it possible?

3 posts - 2 participants

Read full topic

FileSystem plugin not implemented in android

$
0
0

I am using filesystem plugin to save images in storage and it works well in local environment in pc but when build an apk file and then installed and opened in real android device then it shows filesystem plugin is not implemented in android when i try to select any image from device.
after some research I found that we need to implement plugin in capacitor.config.ts file so I found the test app in the docs where they have implemented some other plugins (see in below code) so i want to know how can I implement same for filesystem plugin ??

Angular 17
Capacitor 6

///
///
///

import { CapacitorConfig } from ‘@capacitor/cli’;

const config: CapacitorConfig = {
appId: ‘com.capacitorjs.app.testapp’,
appName: ‘capacitor-testapp’,
webDir: ‘dist’,
plugins: {
CapacitorCookies: {
enabled: true,
},
CapacitorHttp: {
enabled: true,
},
SplashScreen: {
launchAutoHide: false,
},
LocalNotifications: {
smallIcon: ‘ic_stat_icon_config_sample’,
iconColor: ‘#CE0B7C’,
},
PushNotifications: {
presentationOptions: [“alert”, “sound”]
}
},
};

export default config;

2 posts - 2 participants

Read full topic

Too Many SVGs in dist

$
0
0

Hello,

I am probably missing something very basic here, but I notice my dist folder is extremely large after build because it includes hundreds of SVGs I do not use in the app. I use maybe four.

Would it be possible in Ionic 6 to specify somewhere in the build not to include unused SVG icons? This would save me an enormous amount of time when building and transferring files.

Thank you.

1 post - 1 participant

Read full topic

Redirect to page depending on ion-select value

$
0
0

Hi everybody,

I’m a very beginner and “rookie” in Ionic vue (let’s say in programming generally). I want to create a simple application and therefore I want a Dropdown-menu (Ion-select) showing a variety of machines. After selecting and clicking “OK”, I want the app to direct me to the specific machine page. How can I do this?

            <ion-item>
                <ion-select label="Stacked label" label-placement="stacked" placeholder="Select Machine" @ionChange="handleChange($event)">
                    <ion-select-option value="Machine 1">Machine 1</ion-select-option>
                    <ion-select-option value="Machine 2">Machine 2</ion-select-option>
                    <ion-select-option value="Machine 3">Machine 3</ion-select-option>
                    <ion-select-option value="Machine 4">Machine 4</ion-select-option>
                    <ion-select-option value="Machine 5">Machine 5</ion-select-option>
                    <ion-select-option value="Machine 6">Machine 6</ion-select-option> 
                </ion-select>
            </ion-item>

methods: {
    handleChange(ev) {
        
    }
}

Or asking differently: What is my method?

Thank you in advance and sorry for this (possibly) stupid question!

2 posts - 2 participants

Read full topic

Announcing Ionic 8.1


Ios Auto-complete OTP whit Capacitor and Ionic for ios

$
0
0

Auto-complete OTP whit Capacitor and Ionic form Ios

Hello everyone, I am working on an App made with Ionic and capacitor, I want to make the OTP auto complete on IOS when a text message arrives; It should be composed as seen in the img, does anyone know how to do it? thank you

WhatsApp Image 2024-05-02 at 10.30.41 AM

1 post - 1 participant

Read full topic

Ios simulator debug blankscreen can't find index js or css

$
0
0

Hello! I have android and web working perfectly, but when I load up my app in xcode simulator, I just get a blank white screen. Using safari inspector, the console error is: “Failed to load resource: The file “index-A7etc.js” couldn’t be opened because there is no such file.” Same for the index css file.

In /ios/App/App/public/index.html (and inspector), I have

<script type="module" crossorigin src="/assets/index-A7nrEjMf.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-3asAeYVN.css">

In /ios/App/App/public/assets/ is the index.js and index.css files with the right names, and all the rest of my pages. I don’t know why it’s not being read?

I’ve been through many forum topics, I really hope I didn’t miss one. I don’t know what I’m doing wrong.

capacitor/app: 6.0.0
capacitor/core: ^6.0.0
capacitor/ios: ^6.0.0
ionic/vue: ^8.1.0

Any suggestions I would be super grateful, thank you!

1 post - 1 participant

Read full topic

Weak APIs vulnerability

$
0
0

Description: The review detected that the mobile application had a few insecure APIs
present within its code. These outdated APIs are affected by numerous vulnerabilities,
including buffer overflow attacks which, if left unpatched, can expose the organization
and any third-party data holder to increased risk of compromise. If an attacker can find
entry points to these functions, they can try to send malicious inputs at run-time and try
to exploit the vulnerability by causing Buffer Overflows
Results: The following APIs were found present within the executable.
Screenshot 2024-05-03 at 11.55.36 PM

how we can fix this vulnerability in ionic angular?

1 post - 1 participant

Read full topic

No "container" part on ion-select

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0 - 2

$
0
0

Ionic cordova build gives me that error. I noticed that there is a similar post, but now it’s not only warnings but the build fails. Should I downgrade something?

1 post - 1 participant

Read full topic

Ionic apk builds fine locally but Gitlab APK gets white screen

$
0
0

This is a very wierd issue. When I build a signed apk locally either through vscode or android studio, the apk works perfect.
These are my commands that I use to build. Like I said locally this works fine
ionic build --prod
npx cap sync
npx cap copy
cd android
./gradle assembleRelease

However when I upload to Gitlab I use the same sequence and the apk is built to the outputs/apk/release folder fine but when installing I get just a white screen.

Here is the gitlab that I am using

build_android:
  stage: build
  
  script:  
    - npm install -g @ionic/cli --legacy-peer-deps
    - npm install @capacitor/core @capacitor/cli --legacy-peer-deps     
    - ionic build --prod
    - npx cap sync android
    - npx cap copy
  artifacts:
   paths:
   - node_modules  
  cache:
    key:
      files:
        - package-lock.json
        - package.json
    paths:
      - node_modules/
      - android
    policy: pull
    
sign_android:
  stage: sign
  image: eclipse-temurin:17-jdk-jammy  
  needs: [build_android]
# Packages installation before running script
  script:
    - ls
    - apt-get --quiet update --yes
    - apt-get --quiet install --yes wget unzip    
    - export ANDROID_HOME="${PWD}/android-sdk-root"
    - install -d $ANDROID_HOME
    # Here we are installing androidSDK tools from official source,
    # (the key thing here is the url from where you are downloading these sdk tool for command line, so please do note this url pattern there and here as well)
    # after that unzipping those tools and
    # then running a series of SDK manager commands to install necessary android SDK packages that'll allow the app to build
    - wget --no-verbose --output-document=$ANDROID_HOME/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip
    - unzip -q -d "$ANDROID_HOME/cmdline-tools" "$ANDROID_HOME/cmdline-tools.zip"
    - mv -T "$ANDROID_HOME/cmdline-tools/cmdline-tools" "$ANDROID_HOME/cmdline-tools/tools"
    - export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/cmdline-tools/tools/bin
    - wget --quiet --output-document=gradle.zip https://services.gradle.org/distributions/${ANDROID_GRADLE_VERSION}-bin.zip
    - unzip -q gradle.zip
    # Nothing fancy here, just checking sdkManager version
    - sdkmanager --version

    # use yes to accept all licenses
    - yes | sdkmanager --licenses > /dev/null || true
    - sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}"
    - sdkmanager "platform-tools"
    - sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}"   
   
     - cd android
  
    - ./gradlew assembleRelease
   
   
  artifacts:
   paths:
      - android/app/build/outputs/apk/release/app-release.apk

1 post - 1 participant

Read full topic

Cannot manage multiple menus

$
0
0

Hello !

I would like to manage multiple menus in my app, but I could not figure out how to do it.

As I understood from the doc page of Ionic (ion-menu: API Framework Docs for Types of Menu Components), I have to create a class where I define the action to be made when the button is clicked on.

When I create this class directly in the page where the menu is to be used, it works. But, as I want this menus to appear on multiple pages, I would like to define the class at one single location and be able to call it wherever I want.

When doing this, he always tells me that the property does not exist. Do you know what am I doing wrong?

Thanks A LOT for your help !

Here are the details :

--------------My “services.ts” file where I define my class ----------------

import { Injectable } from ‘@angular/core’;
import { MenuController } from ‘@ionic/angular’;

@Injectable({
providedIn: ‘root’
})
export class MenuService {

constructor(private menuCtrl: MenuController) {}

openFirstMenu() {
this.menuCtrl.open(‘first-menu’);
}

openSecondMenu() {
this.menuCtrl.open(‘second-menu’);
}

openEndMenu() {
this.menuCtrl.open(‘end’);
}

------------- My app module file ----------------------------

import { NgModule } from ‘@angular/core’;
import { BrowserModule } from ‘@angular/platform-browser’;
import { RouteReuseStrategy } from ‘@angular/router’;

import { IonicModule, IonicRouteStrategy } from ‘@ionic/angular’;

import { AppComponent } from ‘./app.component’;
import { AppRoutingModule } from ‘./app-routing.module’;
import { MenuService } from ‘…/Services/services’;

@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule,],
providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }, MenuService],
bootstrap: [AppComponent],
})
export class AppModule {
}

------------ My app components file -------------------

import { Component } from ‘@angular/core’;
import { MenuService } from ‘…/Services/services’;

@Component({
selector: ‘app-root’,
templateUrl: ‘app.component.html’,
styleUrls: [‘app.component.scss’],
})

export class AppComponent {

constructor(private menuService: MenuService) {}

public appPages = [
{ title: ‘Dashboard’, url: ‘/dashboard’, icon: ‘bar-chart’},
{ title: ‘Maintenance’, url: ‘/maintenance’, icon: ‘construct’ },
{ title: ‘Favorites’, url: ‘/folder/favorites’, icon: ‘heart’ },
{ title: ‘Archived’, url: ‘/folder/archived’, icon: ‘archive’ },
{ title: ‘Trash’, url: ‘/folder/trash’, icon: ‘trash’ },
{ title: ‘Spam’, url: ‘/folder/spam’, icon: ‘warning’ },
];
public labels = [‘Family’, ‘Friends’, ‘Notes’, ‘Work’, ‘Travel’, ‘Reminders’];

public enginePropertyList = [
{ id: ‘0’, sn:‘my serial number’, model: ‘my engine model’},
];

ngOnInit() {
this.menuService.openFirstMenu();
this.menuService.openSecondMenu();
this.menuService.openEndMenu();
}

}

-------------- My maintenance.page.ts where I try to import the elements of my class ---------------

import { Component, OnInit } from ‘@angular/core’;
import { MenuService } from ‘…/…/Services/services’;

@Component({
selector: ‘app-maintenance’,
templateUrl: ‘./maintenance.page.html’,
styleUrls: [‘./maintenance.page.scss’],
})
export class MaintenancePage implements OnInit {

constructor(private menuService: MenuService) {}

ngOnInit() {
this.menuService.openFirstMenu();
this.menuService.openSecondMenu();
this.menuService.openEndMenu();
}

}

-------------- My html code where I have my buttons to access my menus ----------------

Menu

Tap a button below to open a specific menu.

  <ion-button expand="block" (click)="openFirstMenu()">Open First Menu</ion-button>
  <ion-button expand="block" (click)="openSecondMenu()">Open Second Menu</ion-button>
  <ion-button expand="block" (click)="openEndMenu()">Open End Menu</ion-button>
</ion-content>

-------------- The displayed errors ---------------------------

[ng] Error: src/app/maintenance/maintenance.page.html:37:43 - error TS2339: Property ‘openFirstMenu’ does not exist on type ‘MaintenancePage’.
[ng]
[ng] 37 <ion-button expand=“block” (click)=“openFirstMenu()”>Open First Menu
[ng] ~~~~~~~~~~~~~
[ng]
[ng] src/app/maintenance/maintenance.page.ts:6:16
[ng] 6 templateUrl: ‘./maintenance.page.html’,
[ng] ~~~~~~~~~~~~~~~~~~~~~~~~~
[ng] Error occurs in the template of component MaintenancePage.
[ng]
[ng]
[ng] Error: src/app/maintenance/maintenance.page.html:38:43 - error TS2339: Property ‘openSecondMenu’ does not exist on type ‘MaintenancePage’.
[ng]
[ng] 38 <ion-button expand=“block” (click)=“openSecondMenu()”>Open Second Menu
[ng] ~~~~~~~~~~~~~~
[ng]
[ng] src/app/maintenance/maintenance.page.ts:6:16
[ng] 6 templateUrl: ‘./maintenance.page.html’,
[ng] ~~~~~~~~~~~~~~~~~~~~~~~~~
[ng] Error occurs in the template of component MaintenancePage.
[ng]
[ng]
[ng] Error: src/app/maintenance/maintenance.page.html:39:43 - error TS2339: Property ‘openEndMenu’ does not exist on type ‘MaintenancePage’.
[ng]
[ng] 39 <ion-button expand=“block” (click)=“openEndMenu()”>Open End Menu
[ng] ~~~~~~~~~~~
[ng]
[ng] src/app/maintenance/maintenance.page.ts:6:16
[ng] 6 templateUrl: ‘./maintenance.page.html’,
[ng] ~~~~~~~~~~~~~~~~~~~~~~~~~
[ng] Error occurs in the template of component MaintenancePage.
[ng]
[ng]
[ng]
[ng] × Failed to compile.

1 post - 1 participant

Read full topic


Firebase Push Notification not fire listener on IOS

$
0
0

I integrated Firebase Push Notification in my ionic capacitor app.

It works on Android but on iOS registration listener not fired after permission granted. I can’t understand why.

PushNotifications.addListener('registration', (token: Token) => {
      alert('Push registration success, token: ' + token.value);
      this.push.registerToken(token.value);
    });

    PushNotifications.addListener('registrationError', (error: any) => {
      alert('Error on registration: ' + JSON.stringify(error));
    });

    PushNotifications.addListener(
      'pushNotificationReceived',
      (notification: PushNotificationSchema) => {
        alert('Push received: ' + JSON.stringify(notification));
      },
    );

    PushNotifications.addListener(
      'pushNotificationActionPerformed',
      (notification: ActionPerformed) => {
        alert('Push action performed: ' + JSON.stringify(notification));
      },
    );

    PushNotifications.requestPermissions().then(result => {
      if (result.receive === 'granted') {
        // Register with Apple / Google to receive push via APNS/FCM
        PushNotifications.register().then((response) => {
          alert("registration complete");
          console.log('[NOTIFICATIONS] register complete: ', response);
        }, (err) => {
          alert("registration error");
          console.error('[NOTIFICATIONS] register error: ', err);
        });
      } else {
        // Show some error
      }
    });

alert(“registration complete”); is called but after nothing

Could you please help me to understand?

1 post - 1 participant

Read full topic

Country code on IOS doesn't get copy pasted automatically while holding and selecting,on android it is working fine

$
0
0

Country code eg: (+91909090909) on IOS ‘+’ doesn’t get selected and copy pasted automatically, but on android is selected and copy pasted. I see all the special characters and even when we have same in between

1 post - 1 participant

Read full topic

Drag&Drop / reorder in list does not work

$
0
0

I have a list where it should be possible to change the order of the entries (text) using drag and drop (ion-reorder). Unfortunately it does not work or at least nothing happens. I don’t get any error messages and compilation works without any problems.

liste.page.html

<ion-content [fullscreen]=“true”>



Meine To-do-Liste



<ion-row>
  <ion-col>  
    <div class="noItem" *ngIf="TodoListe.length == 0">
      Bitte füge einen Eintrag hinzu, indem du auf das Plus-Symbol drückst.
    </div>
    
    <ion-list>
      <ion-reorder-group (ionItemReorder)="reorderItems($event)">
        <ion-item-sliding *ngFor="let item of TodoListe; let i = index" [id]="'item-' + i">
          <ion-item>
            <ion-label>{{item}}</ion-label>
            <ion-reorder slot="end"></ion-reorder> 
          </ion-item>
          
          <ion-item-options side="end">
            <ion-item-option color="danger" (click)="deleteItem(i)">
              <ion-icon name="trash"></ion-icon>
            </ion-item-option>
          </ion-item-options>
          <ion-item-options side="start">
            <ion-item-option (click)="editItem(i)">
              <ion-icon name="create"></ion-icon>
            </ion-item-option>
          </ion-item-options> 
        </ion-item-sliding>
        
      </ion-reorder-group>
    </ion-list>                
  </ion-col>
</ion-row>

liste.page.ts

reorderItems(ev: any) {
const element = this.TodoListe[ev.detail.from];
this.TodoListe.splice(ev.detail.from, 1);
this.TodoListe.splice(ev.detail.to, 0, element);
ev.detail.complete();
}

What am I missing here? Who can help me with this or suggest what is going wrong?

1 post - 1 participant

Read full topic

Ionic 7: Error NG1010: Value

$
0
0

Good day everyone, I had to update a project from Ionic 6 to Ionic 7 and I have had some problems, among them, when executing the command: ionic cordova build android, it returns: src/app/app.module.ts:88: 12 - error NG1010: Value
I have relied on the update guide and I don’t know if anything additional is missing.

My configuration: Ionic:

Ionic CLI : 7.2.0 (C:\Users\jvich\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/angular 6.7.5
@angular-devkit/build-angular : 17.3.6
@angular-devkit/schematics : 17.3.6
@angular/cli : 17.3.6
@ionic/angular-toolkit : 11.0.1

Cordova:

Cordova CLI : 6.5.0
Cordova Platforms : android 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 24 other plugins)

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

Android SDK Tools : 26.1.1 (C:\Users\jvich\AppData\Local\Android\Sdk)
NodeJS : v18.19.1 (C:\Program Files\nodejs\node.exe)
npm : 2.15.12
OS : Windows 10

1 post - 1 participant

Read full topic

Ionic Storage (Ionic 8, Angular 17) error: `ERROR NullInjectorError: NullInjectorError: No provider for Storage`

$
0
0

I am currently encountering challenges in integrating Ionic Storage within my Ionic 8 (Angular 17) application.

I have adhered to the official documentation guidelines for implementing Ionic Storage within an independent service. The following is the content of the storage.service.js file:

import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root',
})
export class StorageService {
  private _storage: Storage | null = null;

  constructor(private storage: Storage) {
    this.init();
  }

  async init() {
    const storage = await this.storage['create']();
    this._storage = storage;
  }

  public async get(key: string) {
    const value = await this._storage?.['get'](key);

    return value;
  }

  public async set(key: string, value: any) {
    await this._storage?.['set'](key, value);
  }
}

I am utilizing this service within another service for authentication-related purposes. The following is the content of the auth.service.js file:

import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { StorageService } from './storage.service';

interface Credentials {
  username: string;
  password: string;
}

export interface AuthResponse {
  auth_token: string;
}

@Injectable({
  providedIn: 'root',
})
export class AuthService {
  constructor(
    private httpClient: HttpClient,
    private storageService: StorageService
  ) {}

  async getAuthToken(): Promise<string> {
    const token = await this.storageService.get('token');

    return token;
  }

  async isAuthenticated(): Promise<boolean> {
    const token = await this.getAuthToken();

    if (token) {
      return true;
    }

    return false;
  }

  authenticate(credentials: Credentials): Observable<AuthResponse> {
    return this.httpClient.post<AuthResponse>(
      `${import.meta.env['NG_APP_API_BASE_URL']}/${
        import.meta.env['NG_APP_API_PREFIX']
      }/token/login`,
      credentials
    );
  }

  async processPostLoginOps(token: string): Promise<void> {
    await this.storageService.set('token', token);

    const authenticated = await this.isAuthenticated();

    if (authenticated) {
      throw new Error('Unable to login');
    }
  }
}

Finally I am integrating this service within a page. The following is the content of the login.page.ts file:

import { CommonModule } from '@angular/common';
import { Component, OnInit } from '@angular/core';
import {
  FormBuilder,
  FormGroup,
  FormsModule,
  ReactiveFormsModule,
  Validators,
} from '@angular/forms';
import { Router } from '@angular/router';
import {
  IonButton,
  IonCard,
  IonCardContent,
  IonCol,
  IonContent,
  IonGrid,
  IonHeader,
  IonInput,
  IonItem,
  IonList,
  IonNav,
  IonRow,
  IonTitle,
  IonText,
  IonToolbar,
} from '@ionic/angular/standalone';
import { LoadingController, ToastController } from '@ionic/angular';
import { AuthService, AuthResponse } from 'src/app/services/auth.service';
import { Capacitor } from '@capacitor/core';

@Component({
  selector: 'app-login',
  templateUrl: './login.page.html',
  styleUrls: ['./login.page.scss'],
  standalone: true,
  imports: [
    IonButton,
    IonCard,
    IonCardContent,
    IonCol,
    IonContent,
    IonGrid,
    IonHeader,
    IonInput,
    IonItem,
    IonList,
    IonNav,
    IonRow,
    IonTitle,
    IonText,
    IonToolbar,
    CommonModule,
    FormsModule,
    ReactiveFormsModule
  ],
})
export class LoginPage implements OnInit {
  form!: FormGroup;
  disabled: boolean = true;
  loadingOverlay!: HTMLIonLoadingElement;
  errorToast!: HTMLIonToastElement;

  constructor(
    private router: Router,
    private formBuilder: FormBuilder,
    private loadingController: LoadingController,
    private toastController: ToastController,
    private authService: AuthService
  ) {}

  async ngOnInit(): Promise<void> {
    this.initForm();
    this.subscribeToFormChanges();
    await this.setOrResetLoadingOverlay();
    await this.setToasts();
  }

  private async setToasts() {
    this.errorToast = await this.toastController.create({
      duration: 1500,
      position: 'bottom'
    });
  }

  private async setOrResetLoadingOverlay() {
    this.loadingOverlay = await this.loadingController.create({});
  }

  initForm(): void {
    this.form = this.formBuilder.group({
      username: ['', Validators.required],
      password: ['', Validators.required],
    });
  }

  subscribeToFormChanges(): void {
    this.form.statusChanges.subscribe((status) => {
      if (status === 'VALID') {
        this.disabled = false;
      } else {
        this.disabled = true;
      }
    });
  }

  async authenticate() {
    this.loadingOverlay.message = 'Logging in';
    await this.loadingOverlay.present();

    this.authService
      .authenticate({
        username: this.form.value.username,
        password: this.form.value.password,
      })
      .subscribe({
        next: async (response: AuthResponse) => {
          this.loadingOverlay.dismiss();
          this.loadingOverlay.message = 'fdnfgnfgn';
          this.loadingOverlay.present();

          try {
            this.authService.processPostLoginOps(response.auth_token);

            this.router.navigate(['/']).then(() => window.location.reload());
          } catch (error) {
            await this.setOrResetLoadingOverlay();
            
            this.errorToast.message = 'Unable to login';
            this.errorToast.present();
          }
        },
        error: async (error: any) => {
          this.loadingOverlay.dismiss();
          await this.setOrResetLoadingOverlay();

          this.errorToast.message = 'Unable to login';
          this.errorToast.present();
        },
      });
  }

  register(): void {
    this.router.navigate(['/register']);
  }
}

I am encountering the following error in my browser console: ERROR NullInjectorError: NullInjectorError: No provider for Storage!, upon attempting to configure Ionic Storage within Ionic 8 (Angular 17). Any guidance on the correct setup procedure would be greatly appreciated. Thank you in advance.

2 posts - 2 participants

Read full topic

Viewing all 49296 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>