Socket
Socket
Sign inDemoInstall

@ionic/angular

Package Overview
Dependencies
2
Maintainers
24
Versions
2977
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ionic/angular

Angular specific wrappers for @ionic/core


Version published
Weekly downloads
126K
increased by1.12%
Maintainers
24
Created
Weekly downloads
 

Package description

What is @ionic/angular?

@ionic/angular is a package that provides Angular integration for the Ionic Framework, which is a popular framework for building cross-platform mobile applications using web technologies. It allows developers to create high-quality mobile apps with a native look and feel using Angular.

What are @ionic/angular's main functionalities?

UI Components

Ionic provides a wide range of pre-built UI components that are designed to look and feel like native mobile components. This includes buttons, headers, footers, forms, and more.

<ion-header>
  <ion-toolbar>
    <ion-title>
      Home
    </ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <ion-button (click)="doSomething()">Click Me</ion-button>
</ion-content>

Navigation

Ionic's navigation system allows for easy navigation between pages in your application. It supports both stack-based and tab-based navigation.

import { Component } from '@angular/core';
import { NavController } from '@ionic/angular';

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage {
  constructor(private navCtrl: NavController) {}

  goToNextPage() {
    this.navCtrl.navigateForward('/next-page');
  }
}

Theming

Ionic allows for extensive theming and customization of your application. You can define custom colors, fonts, and other styles to match your brand.

:root {
  --ion-color-primary: #3880ff;
  --ion-color-secondary: #0cd1e8;
  --ion-color-tertiary: #7044ff;
  --ion-color-success: #10dc60;
  --ion-color-warning: #ffce00;
  --ion-color-danger: #f04141;
  --ion-color-light: #f4f5f8;
  --ion-color-medium: #989aa2;
  --ion-color-dark: #222428;
}

Native Device Integration

Ionic, in combination with Capacitor, allows for easy integration with native device features such as the camera, GPS, and more.

import { Component } from '@angular/core';
import { Camera, CameraResultType } from '@capacitor/camera';

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage {
  async takePicture() {
    const image = await Camera.getPhoto({
      quality: 90,
      allowEditing: false,
      resultType: CameraResultType.Uri
    });
    console.log(image.webPath);
  }
}

Other packages similar to @ionic/angular

Readme

Source

@ionic/angular

Ionic Angular specific building blocks on top of @ionic/core components.

License

Testing ng-add in ionic

  1. Pull the latest from main
  2. Build ionic/angular: npm run build
  3. Run npm link from ionic/angular/dist directory
  4. Create a blank angular project
ng new add-test
// Say yes to including the router, we need it
cd add-test
  1. To run schematics locally, we need the schematics-cli (once published, this will not be needed)
npm install @angular-devkit/schematics-cli
  1. Link @ionic/angular
npm link @ionic/angular
  1. Run the local copy of the ng-add schematic
$ npx schematics @ionic/angular:ng-add

You'll now be able to add ionic components to a vanilla Angular app setup.

Keywords

FAQs

Last updated on 07 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc