本文整理匯總了TypeScript中ng2-ui-auth.NG2_UI_AUTH_PROVIDERS函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript NG2_UI_AUTH_PROVIDERS函數的具體用法?TypeScript NG2_UI_AUTH_PROVIDERS怎麽用?TypeScript NG2_UI_AUTH_PROVIDERS使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了NG2_UI_AUTH_PROVIDERS函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: main
export function main(initialHmrState?: any): Promise<any> {
//alert('dddee');
return bootstrap(App, [
...PROVIDERS,
...ENV_PROVIDERS,
...DIRECTIVES,
...PIPES,
...APP_PROVIDERS,
...APP_STORES,
SharedService,
UserService,
NG2_UI_AUTH_PROVIDERS({defaultHeaders: DEFAULT_POST_HEADER, providers: {google: {clientId: GOOGLE_CLIENT_ID}}}),
provide(LazyMapsAPILoaderConfig, {
useFactory: () => {
let config = new LazyMapsAPILoaderConfig();
config.libraries = ['places'];
return config;
}
})
])
.catch(err => console.error(err));
}
示例2: beforeEach
beforeEach(() => {
// Support for testing component that uses Router
let config:RouterConfig = [];
addProviders([
provideFakeRouter(TestComponent, config),
Configuration,
FormBuilder,
Auth,
HTTP_PROVIDERS,
MockBackend,
{provide: XHRBackend, useExisting: MockBackend},
NG2_UI_AUTH_PROVIDERS(
{
baseUrl: 'any',
providers: {
facebook: {
clientId: ''
},
google: {
clientId: ''
}
}
}),
AuthService,
MeetService
]);
});
示例3: beforeEach
beforeEach(() => {
// Support for testing component that uses Router
let config:RouterConfig = [
{path: '', component: HomeComponent},
{path: 'about', component: AboutComponent}
];
var BASE_API = new OpaqueToken('slsServiceApi');
addProviders([
provideFakeRouter(TestComponent, config),
Configuration,
Auth,
HTTP_PROVIDERS,
MockBackend,
{provide: XHRBackend, useExisting: MockBackend},
{provide: BASE_API, useValue: '<%= API %>'},
NG2_UI_AUTH_PROVIDERS(
{
baseUrl: BASE_API.toString(),
providers: {
facebook: {
clientId: ''
},
google: {
clientId: ''
}
}
}),
AuthService
]);
});
示例4: main
export function main(initialHmrState?: any): Promise<any> {
//alert('dddee');
return bootstrap(App, [
...PROVIDERS,
...ENV_PROVIDERS,
...DIRECTIVES,
...PIPES,
...APP_PROVIDERS,
...APP_STORES,
SharedService,
UserService,
NG2_UI_AUTH_PROVIDERS({defaultHeaders: DEFAULT_POST_HEADER, providers: {google: {clientId: GOOGLE_CLIENT_ID}}}),
])
.catch(err => console.error(err));
}
示例5: bootstrap
/**
* Bootstraps the application and makes the ROUTER_PROVIDERS and the APP_BASE_HREF available to it.
* @see https://angular.io/docs/ts/latest/api/platform-browser-dynamic/index/bootstrap-function.html
*/
bootstrap(AppComponent, [
Configuration,
disableDeprecatedForms(),
provideForms(),
HTTP_PROVIDERS,
APP_ROUTER_PROVIDERS,
NG2_UI_AUTH_PROVIDERS(
{
baseUrl: configuration.API,
providers: {
facebook: {
clientId: configuration.FACEBOOK_CLIENT_ID
},
google: {
clientId: configuration.GOOGLE_CLIENT_ID
}
}
}),
{provide: APP_BASE_HREF, useValue: '<%= APP_BASE %>'},
]);
// In order to start the Service Worker located at "./worker.js"
// uncomment this line. More about Service Workers here
// https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers
//
// if ('serviceWorker' in navigator) {
// (<any>navigator).serviceWorker.register('./worker.js').then((registration: any) =>
// console.log('ServiceWorker registration successful with scope: ', registration.scope))
示例6: bootstrap
import { APP_ROUTER_PROVIDERS } from './app.routes';
import { AppComponent } from './app.component';
import {
ANGULAR2_GOOGLE_MAPS_PROVIDERS
} from 'angular2-google-maps/core';
const GOOGLE_CLIENT_ID = '642712098499-uqphekumjjgp2idhosahbdlvvs2g4i44.apps.googleusercontent.com';
const FACEBOOK_CLIENT_ID = '217136761769180';
const DEFAULT_POST_HEADER: {[name: string]: string} = {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PATCH, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Origin, Content-Type, X-Auth-Token'
};
bootstrap(AppComponent, [
provide(APP_BASE_HREF, {useValue : '/' }),
APP_ROUTER_PROVIDERS,
HTTP_PROVIDERS,
ANGULAR2_GOOGLE_MAPS_PROVIDERS,
NG2_UI_AUTH_PROVIDERS({
defaultHeaders: DEFAULT_POST_HEADER,
providers: {
facebook: {
clientId: FACEBOOK_CLIENT_ID,
url: 'http://localhost:8080/auth/facebook'
},
}
})
]);
示例7: enableProdMode
const GOOGLE_CLIENT_ID = '616075536950-pauau0e7u0c980llqh99ftvg3sd32c61.apps.googleusercontent.com';
const GITHUB_CLIENT_ID = '54c368d51bca18a17397';
const API_SERVER = 'https://p.davintoo.com';
enableProdMode();
bootstrap(AppComponent, [
LoggerService,
GithubService,
ConfigService,
AuthService,
GoogleService,
ToastrService,
TetherService,
ROUTER_PROVIDERS,
HTTP_PROVIDERS,
NG2_UI_AUTH_PROVIDERS({
defaultHeaders: {
'Content-Type': 'application/json; charset=utf-8'
},
providers: {
google: {clientId: GOOGLE_CLIENT_ID, scope: [
'https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/drive.file',
'https://www.googleapis.com/auth/drive.install'
], url: API_SERVER + '/auth/google' },
github: {clientId: GITHUB_CLIENT_ID, scope: ['user:email,repo,gist'], url: API_SERVER + '/auth/github'}
}
})
]);