From e566ab18fec8bd4a959ca1ec13112320ff32b882 Mon Sep 17 00:00:00 2001 From: Kamil Kisiela Date: Wed, 25 May 2016 13:52:53 +0200 Subject: [PATCH] chore: support angular2 RC1 --- package.json | 10 +++++++--- src/angular2Apollo.ts | 2 +- src/apolloQueryPipe.ts | 2 +- tests/angular2Apollo.ts | 14 +++++--------- tests/apolloQueryPipe.ts | 5 ++--- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 8c9e79671..a4b39a16b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular2-apollo", - "version": "0.0.2", + "version": "0.1.0", "description": "Angular 2.0 client for Apollo", "main": "build/src/index.js", "typings": "./build/src/index.d.ts", @@ -31,13 +31,17 @@ }, "homepage": "https://github.com/apollostack/angular2-apollo#readme", "dependencies": { - "angular2": "2.0.0-beta.15", + "@angular/core": "2.0.0-rc.1", + "@angular/platform-browser": "2.0.0-rc.1", + "@angular/common": "2.0.0-rc.1", + "@angular/compiler": "2.0.0-rc.1", + "@angular/platform-browser-dynamic": "2.0.0-rc.1", "apollo-client": "0.1.2", "es6-shim": "0.35.0", "graphql": "^0.5.0", "lodash": "^4.11.1", "reflect-metadata": "0.1.2", - "rxjs": "5.0.0-beta.2", + "rxjs": "5.0.0-beta.6", "zone.js": "0.6.11" }, "devDependencies": { diff --git a/src/angular2Apollo.ts b/src/angular2Apollo.ts index 49978d536..72ffc3fe3 100644 --- a/src/angular2Apollo.ts +++ b/src/angular2Apollo.ts @@ -8,7 +8,7 @@ import { OpaqueToken, Injectable, Inject, -} from 'angular2/core'; +} from '@angular/core'; export const angularApolloClient = new OpaqueToken('AngularApolloClient'); export const defaultApolloClient = (client: ApolloClient): Provider => { diff --git a/src/apolloQueryPipe.ts b/src/apolloQueryPipe.ts index 1e695765d..9b7629370 100644 --- a/src/apolloQueryPipe.ts +++ b/src/apolloQueryPipe.ts @@ -1,6 +1,6 @@ /// -import {Pipe} from 'angular2/core'; +import {Pipe} from '@angular/core'; @Pipe({ name: 'apolloQuery', diff --git a/tests/angular2Apollo.ts b/tests/angular2Apollo.ts index d74f9e2b5..5306be190 100644 --- a/tests/angular2Apollo.ts +++ b/tests/angular2Apollo.ts @@ -1,10 +1,6 @@ import { - it, describe, expect -} from 'angular2/testing'; - -import { - Provider, Injector, -} from 'angular2/core'; + Provider, ReflectiveInjector, +} from '@angular/core'; import ApolloClient from 'apollo-client'; @@ -37,7 +33,7 @@ describe('angular2Apollo', () => { function rawApiCall(method: string, options = 'options', result = 'result') { spyOn(client, method).and.returnValue(result); - const injector = Injector.resolveAndCreate([defaultApolloClient(client), APOLLO_PROVIDERS]); + const injector = ReflectiveInjector.resolveAndCreate([defaultApolloClient(client), APOLLO_PROVIDERS]); const service = injector.get(Angular2Apollo); expect(service[method](options)).toBe(result); @@ -60,11 +56,11 @@ describe('angular2Apollo', () => { describe('defaultApolloClient', () => { it('should create a provider', () => { const provider = defaultApolloClient(client); - expect(provider).toBeAnInstanceOf(Provider); + expect(provider instanceof Provider).toBe(true); }); it('should set a AngularApolloClient', () => { - const injector = Injector.resolveAndCreate([defaultApolloClient(client)]); + const injector = ReflectiveInjector.resolveAndCreate([defaultApolloClient(client)]); expect(injector.get(angularApolloClient)).toBe(client); }); }); diff --git a/tests/apolloQueryPipe.ts b/tests/apolloQueryPipe.ts index 23edc094c..adef0e26a 100644 --- a/tests/apolloQueryPipe.ts +++ b/tests/apolloQueryPipe.ts @@ -1,4 +1,3 @@ -import {it, describe, expect, beforeEach} from 'angular2/testing'; import {ApolloQueryPipe} from '../src/apolloQueryPipe'; describe('ApolloQueryPipe', () => { @@ -11,8 +10,8 @@ describe('ApolloQueryPipe', () => { it('should capitalize all words in a string', () => { const object = { data: { - foo: 'bar' - } + foo: 'bar', + }, }; const result = pipe.transform(object, ['foo']);