@ionic/platform-client-angular

Ionic Platform Client for Angular 2

Ionic Platform is no longer supported. See https://ionicframework.com/pro
Last updated 4 years ago by dwieeb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ionic/platform-client-angular 
SYNC missed versions from official npm registry.

Ionic Platform Client for Angular 2

Angular 2 integration for the Ionic Platform in your app.

Installation

$ npm install --save @ionic/platform-client-angular

Usage

In your app.ts file, tell Angular about the platform providers by calling the imported providers function with a config and passing it to ionicBootstrap function. Then, use the injectable platform classes (Auth, User, Push, Deploy, etc.) in your app's classes just as you would any other service class.

import ...
import {Auth, User, providers} from '@ionic/platform-client-angular';

let platformConfig = {
  'core': {
    'app_id': 'YOUR-APP-ID'
  }
};

@Component({
  template: '<ion-nav [root]="rootPage"></ion-nav>'
})
export class MyApp {
  rootPage: any = TabsPage;

  constructor(platform: Platform, user: User) {
    platform.ready().then(() => {
      Auth.signup({'email': 'hi@ionic.io', 'password': 'puppies123'}).then(() => {
        // `user` is now the authenticated user
      }, (err) => {
        // something went wrong!
      });
    });
  }
}

ionicBootstrap(MyApp, providers(platformConfig), { /* Ionic Framework Config */ });

Issues

This package wraps the platform client to add Angular integration. Because of this, most issues should be reported in the platform client issues or the platform issues.

Current Tags

  • 0.0.8                                ...           latest (4 years ago)

6 Versions

  • 0.0.8 [deprecated]           ...           4 years ago
  • 0.0.7 [deprecated]           ...           4 years ago
  • 0.0.5 [deprecated]           ...           4 years ago
  • 0.0.4 [deprecated]           ...           4 years ago
  • 0.0.3 [deprecated]           ...           4 years ago
  • 0.0.2 [deprecated]           ...           4 years ago

Copyright 2014 - 2016 © taobao.org |