本文整理汇总了TypeScript中angular2-apollo.defaultApolloClient函数的典型用法代码示例。如果您正苦于以下问题:TypeScript defaultApolloClient函数的具体用法?TypeScript defaultApolloClient怎么用?TypeScript defaultApolloClient使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了defaultApolloClient函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: enableProdMode
import { APP_ROUTER_PROVIDERS } from './app/app.routes';
// Apollo-client
import {
defaultApolloClient,
APOLLO_PROVIDERS
} from 'angular2-apollo';
import apolloClient from './app/client';
const ENV_PROVIDERS = [];
// depending on the env mode, enable prod mode or add debugging modules
if (process.env.ENV === 'build') {
enableProdMode();
} else {
ENV_PROVIDERS.push(ELEMENT_PROBE_PROVIDERS);
}
const app = bootstrap(AppComponent, [
// These are dependencies of our App
APOLLO_PROVIDERS,
defaultApolloClient(apolloClient),
APP_ROUTER_PROVIDERS,
ENV_PROVIDERS,
disableDeprecatedForms(),
provideForms()
// { provide: LocationStrategy, useClass: HashLocationStrategy } // uncomment this to use #/ routes
])
.catch(err => console.error(err));
export default app;
开发者ID:scaphold-io,项目名称:angular2-apollo-client-webpack-starter,代码行数:30,代码来源:main.ts
示例2: enableProdMode
import { HTTP_PROVIDERS } from '@angular/http';
import {defaultApolloClient,APOLLO_PROVIDERS} from 'angular2-apollo';
import ApolloClient, {createNetworkInterface} from 'apollo-client';
if (environment.production) {
enableProdMode();
}
const client = new ApolloClient({
networkInterface: createNetworkInterface('http://localhost:8080')
});
bootstrap(AppComponent, [
HTTP_PROVIDERS,
//Forms
disableDeprecatedForms(),
provideForms(),
//Routing
appRouterProviders,
FIREBASE_PROVIDERS,
//Apollo
APOLLO_PROVIDERS,
defaultApolloClient(client),
// Initialize Firebase app
defaultFirebase({
apiKey: "AIzaSyBjP_3k1BwzoUizos6vKOyF_z-65CzTqsw",
authDomain: "fir-angular2-68e19.firebaseapp.com",
databaseURL: "https://fir-angular2-68e19.firebaseio.com",
storageBucket: "fir-angular2-68e19.appspot.com",
})
]);
开发者ID:Gmannheim,项目名称:Angular2-Firebase,代码行数:30,代码来源:main.ts
示例3: useFactory
useFactory: function useFactory(backend, defaultOptions) {
return defaultApolloClient(apolloClient)
},
开发者ID:scaphold-io,项目名称:angular2-apollo-client-webpack-starter,代码行数:3,代码来源:app.component.spec.ts
注:本文中的angular2-apollo.defaultApolloClient函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论