Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { BookingDataService } from './booking/booking-data-service';
import { OrderDataService } from './order/order-data-service';
import { provideClient } from './graphql-client';
import { ApolloModule } from 'apollo-angular';
// export enum BackendType {
// IN_MEMORY,
// REST,
// GRAPHQL,
// }
@NgModule({
imports: [
CommonModule,
HttpModule,
ApolloModule.forRoot(provideClient),
],
declarations: [],
providers: [
DishesDataService,
LoginDataService,
BookingDataService,
OrderDataService,
],
})
export class BackendModule {
constructor (@Optional() @SkipSelf() parentModule: BackendModule) {
if (parentModule) {
throw new Error('BackendModule is already loaded. Import it in the AppModule only');
}
@NgModule({
declarations: [
MyApp,
HomePage,
SearchPage,
CameraPage,
FeedPage,
ProfilePage,
TabsPage,
LoginPage,
RegisterPage
],
imports: [
IonicModule.forRoot(MyApp),
ApolloModule.forRoot(provideClient)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage,
SearchPage,
CameraPage,
FeedPage,
ProfilePage,
TabsPage,
LoginPage,
RegisterPage
],
providers: [AuthService, {provide: ErrorHandler, useClass: IonicErrorHandler}]
})
export class AppModule {}
getCredentialsFunction,
debug: true
});
const client: ApolloClient = new ApolloClient({
dataIdFromObject: (o: any) => o.id,
networkInterface: wsClient,
connectToDevTools: true,
});
export function provideClient(): ApolloClient {
return client;
}
@NgModule({
imports: [ApolloModule.forRoot(provideClient)],
exports: [ApolloModule]
})
export class AppApolloModule { }
declarations: [
MyApp,
AboutPage,
ContactPage,
HomePage,
TabsPage,
StaffPage,
ModalPage,
RegisterPage,
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp, {
tabsPlacement: 'bottom'
}),
ApolloModule.forRoot(provideClient),
IonicStorageModule.forRoot()
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
AboutPage,
ContactPage,
HomePage,
TabsPage,
StaffPage,
ModalPage,
RegisterPage,
],
providers: [
StatusBar,
SplashScreen,
],
/**
* Import Angular's modules.
*/
imports: [
BrowserAnimationsModule,
BrowserModule,
FormsModule,
ReactiveFormsModule,
HttpModule,
MdToolbarModule,
MdCardModule,
MdListModule,
MdGridListModule,
RouterModule.forRoot(ROUTES, { useHash: false, preloadingStrategy: PreloadAllModules }),
ApolloModule.forRoot(client),
],
/**
* Expose our Services and Providers into Angular's dependency injection.
*/
providers: [
ENV_PROVIDERS,
APP_PROVIDERS
]
})
export class AppModule {
constructor(
public appRef: ApplicationRef,
public appState: AppState
) { }
declarations: [
AppComponent,
DashboardComponent,
FilterPipe,
OrderByPipe,
SubstringPipe,
ResultsListComponent,
ResultsDetailComponent,
SearchComponent
],
/*
* Imports should contain any modules you've
* imported above which are defined elsewhere.
*/
imports: [
ApolloModule.forRoot(provideClient),
BrowserAnimationsModule,
BrowserModule,
FlexLayoutModule,
FormsModule,
HttpModule,
MdChipsModule,
MdIconModule,
MdInputModule,
MdListModule,
MdProgressSpinnerModule
],
/*
* Providers should contain any services which
* you will be injecting into components (either
* declared in this module or imported from elsewhere)
*/
beforeEach(() => {
TestBed.configureTestingModule({
providers: [DishesGraphQlService],
imports: [
ApolloModule.forRoot(provideClient),
],
});
});
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { ApolloModule } from 'apollo-angular';
import { AppComponent } from './app.component';
import { PostListComponent } from './post/post-list.component';
import { provideClient } from './client';
@NgModule({
declarations: [
AppComponent,
PostListComponent
],
imports: [
BrowserModule,
ApolloModule.forRoot(provideClient)
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}
import { AppComponent } from '../app.component';
import { IonicModule } from 'ionic-angular';
import { ApolloModule } from 'apollo-angular';
import { FormsModule } from '@angular/forms';
import { UnixTimeToStringPipe } from '../../pipes/unix-time-to-string';
import { ServiceWorkerModule } from '@angular/service-worker';
import { PushNotificationsService } from './services/push-notifications.service';
import { LoginPageService } from './services/login-page.service';
@NgModule({
imports: [
CommonModule,
FormsModule,
ServiceWorkerModule,
IonicModule.forRoot(AppComponent, { mode: 'md' }),
ApolloModule.forRoot(getApolloClient),
],
exports: [
CommonModule,
FormsModule,
IonicModule,
ApolloModule,
UnixTimeToStringPipe
],
declarations: [UnixTimeToStringPipe],
providers: [PushNotificationsService, LoginPageService],
})
export class SharedModule {
}
import { AppComponent } from './app.component'
import { FeedComponent } from './feed.component'
import { NewPostComponent } from './new-post.component'
import { routes } from './routes'
import { provideClient } from './client'
@NgModule({
declarations: [AppComponent, FeedComponent, NewPostComponent],
entryComponents: [AppComponent],
imports: [
BrowserModule,
FormsModule,
ReactiveFormsModule,
RouterModule.forRoot(routes),
ApolloModule.forRoot(provideClient),
],
bootstrap: [AppComponent],
})
export class AppModule {}