Angular and Ionic: one codebase for web, Android and iOS

A hybrid app is written once and runs everywhere: in the browser and, packaged with Capacitor, as an installable app from the stores.

An open laptop on a table next to a cup of coffee

How it works

  • Angular and TypeScript

    They hold the app’s logic: data, rules, navigation. TypeScript keeps the code readable and checkable as it grows.

  • Ionic

    It provides the interface components (lists, cards, menus, modals) with the look and gestures of iOS and Android.

  • Capacitor

    It connects the app to the operating system through plugins: camera, files, notifications, calendar, sharing. Where a plugin is missing, I write one.

The same code knows where it’s running

A small service decides what to do on the web and what to do on the phone, with no duplication.

platform.ts

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

@Injectable({ providedIn: 'root' })
export class Platform {
  readonly native = Capacitor.isNativePlatform();
  readonly system = Capacitor.getPlatform(); // 'web' | 'ios' | 'android'
}

What I take care of in a real project

  • Performance

    Lists with thousands of items using virtual scrolling, on-demand loading of sections, fast startup.

  • Photos and video

    On-device compression and background upload, even with the app closed or an unstable network.

  • Phone integration

    Push and local notifications, the system calendar, sharing files, images and video.

  • Quality

    A responsive interface on different screens, crash and log reporting to learn what really goes wrong.

  • Publishing

    Xcode, app signing, App Store Connect and TestFlight, Android packages and Google Play.

A detail learned in the field

For buttons and elements that appear and disappear while scrolling, I prefer to keep them in the DOM and only toggle a CSS class, instead of adding and removing them with *ngIf. In my projects scrolling on iOS stays smoother.

to-top.component.html

<!-- always in the DOM: only the class changes -->
<ion-fab class="to-top" [class.hidden]="!showToTop()">
  <ion-fab-button (click)="scrollToTop()">
    <ion-icon name="chevron-up" />
  </ion-fab-button>
</ion-fab>

/* SCSS */
.to-top {
  transition: opacity 0.2s;
  &.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
}

When it’s not the right choice

For 3D games, augmented reality or apps that process sensors in real time at very high rates, native code is better. For everything else, which means most management, sport, ordering and booking apps, a hybrid app costs less and updates faster.