Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-apollo

Package Overview
Dependencies
Maintainers
4
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-apollo

An API client for the 7digital Apollo platform built for Angular 2 projects.

  • 0.4.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-12.5%
Maintainers
4
Weekly downloads
 
Created
Source

Angular apollo

npm version CircleCI

An API client for the 7digital Apollo platform built for Angular 2 projects.

Installation

npm install angular-apollo

Usage

For a web project:

import { bootstrap }    from '@angular/platform-browser-dynamic';
import { HTTP_PROVIDERS } from '@angular/http';
import { ApiService, ListService, Config } from 'angular-apollo';

export class AppComponent {
    constructor(private playlistService:ListService){
        return this.playlistService.findById(10)
            .subscribe((playlist) => {
                this.apolloId = playlist.id;
            }) ;
    };
}

class MyConfig extends Config {
    baseUrl: 'http://www.example.com';
}

bootstrap(AppComponent, [
    HTTP_PROVIDERS,
    ListService,
    ApiService,
    {
        provide: Config,
        useClass: MyConfig
    }
    ]]);

For an ionic2 project:

import { ionicBootstrap } from 'ionic-angular';
import { HTTP_PROVIDERS } from '@angular/http';
import { ApiService, ListService, Config } from 'angular-apollo';

export class AppComponent {
    constructor(private playlistService:ListService){
        return this.playlistService.findById(10)
            .subscribe((playlist) => {
                this.apolloId = playlist.id;
            }) ;
    };
}

ionicBootstrap(AppComponent, [{
      provide: ApiService,
      useFactory: (http: Http) => {
          new ApiService(http, {baseUrl:'https://www.example.com'})
        }, 
      deps: [Http]
    },
    ListService,
    ApiService]);

Running the tests

Running the E2E tests requires the following environment variables:

TEST_USER_NAME
TEST_PASSWORD
TEST_DEVICE_ID
TEST_DEVICE_NAME
TEST_API_URL

Currently all tests are run with the npm run test command.

FAQs

Package last updated on 29 Jul 2016

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc