app.module.ts 3.26 KB
Newer Older
Lukas Burgey's avatar
Lukas Burgey committed
1
import {NgModule,Pipe,PipeTransform} from '@angular/core';
2 3 4 5 6 7
import {BrowserModule} from '@angular/platform-browser';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {FormsModule} from '@angular/forms';
import {JsonPipe} from '@angular/common';
import {HttpModule} from '@angular/http';
import {HttpClientModule, HttpClientXsrfModule} from '@angular/common/http';
Lukas Burgey's avatar
Lukas Burgey committed
8

9 10 11 12 13 14 15
import {MatButtonModule} from '@angular/material';
import {MatToolbarModule} from '@angular/material';
import {MatTableModule} from '@angular/material/table';
import {MatSnackBarModule} from '@angular/material/snack-bar';
import {MatExpansionModule} from '@angular/material/expansion';
import {MatIconModule} from '@angular/material/icon';
import {MatDialogModule} from '@angular/material/dialog';
Lukas Burgey's avatar
Lukas Burgey committed
16 17 18
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatSelectModule} from '@angular/material/select';
import {MatInputModule} from '@angular/material/input';
19
import {MatCheckboxModule} from '@angular/material/checkbox';
20
import {MatTooltipModule} from '@angular/material/tooltip';
Lukas Burgey's avatar
Lukas Burgey committed
21 22
import {MatProgressBarModule} from '@angular/material/progress-bar';
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
23

24 25 26
// Other libs
import {StompRService} from '@stomp/ng2-stompjs';
import {CookieService} from 'ngx-cookie-service';
Lukas Burgey's avatar
Lukas Burgey committed
27

28 29 30 31
// Our stuff
import {UserService} from './user.service';
import {SnackBarService} from './snackbar.service';
import {DialogService} from './dialog.service';
Lukas Burgey's avatar
Lukas Burgey committed
32

33 34 35 36
import {AppComponent} from './app.component';
import {MgmtComponent} from './mgmt/mgmt.component';
import {LoginComponent} from './login/login.component';
import {ProfileComponent} from './profile/profile.component';
Lukas Burgey's avatar
Lukas Burgey committed
37
import {QuestionnaireComponent} from './questionnaire/questionnaire.component';
38 39 40
import {ServiceComponent} from './service/service.component';
import {SshKeysComponent} from './ssh-keys/ssh-keys.component';
import {AccountComponent} from './account/account.component';
Lukas Burgey's avatar
Lukas Burgey committed
41 42


Lukas Burgey's avatar
Lukas Burgey committed
43 44 45 46 47 48 49
@Pipe({ name: 'ObjNgFor',  pure: false })
export class ObjNgFor implements PipeTransform {
    transform(value: any, args: any[] = null): any {
        return Object.keys(value);//.map(key => value[key]);
    }
}

Lukas Burgey's avatar
Lukas Burgey committed
50 51 52 53 54
@NgModule({
  declarations: [
    AppComponent,
    MgmtComponent,
    LoginComponent,
Lukas Burgey's avatar
Lukas Burgey committed
55
    ProfileComponent,
Lukas Burgey's avatar
Lukas Burgey committed
56
    QuestionnaireComponent,
Lukas Burgey's avatar
Lukas Burgey committed
57 58
    ServiceComponent,
    SshKeysComponent,
Lukas Burgey's avatar
Lukas Burgey committed
59
    AccountComponent,
Lukas Burgey's avatar
Lukas Burgey committed
60
    ObjNgFor,
Lukas Burgey's avatar
Lukas Burgey committed
61 62 63 64
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
Lukas Burgey's avatar
Lukas Burgey committed
65
    FormsModule,
Lukas Burgey's avatar
Lukas Burgey committed
66
    HttpModule,
Lukas Burgey's avatar
Lukas Burgey committed
67 68 69 70 71
    HttpClientModule,
    HttpClientXsrfModule.withOptions({
      cookieName: 'csrftoken',
      headerName: 'HTTP_X_CSRFTOKEN',
    }),
Lukas Burgey's avatar
Lukas Burgey committed
72
    MatButtonModule,
Lukas Burgey's avatar
Lukas Burgey committed
73 74 75 76 77 78 79 80 81
    MatToolbarModule,
    MatTableModule,
    MatSnackBarModule,
    MatExpansionModule,
    MatIconModule,
    MatDialogModule,
    MatFormFieldModule,
    MatSelectModule,
    MatInputModule,
82
    MatCheckboxModule,
83
    MatTooltipModule,
Lukas Burgey's avatar
Lukas Burgey committed
84 85
    MatProgressBarModule,
    MatProgressSpinnerModule,
Lukas Burgey's avatar
Lukas Burgey committed
86 87
  ],
  providers: [
Lukas Burgey's avatar
Lukas Burgey committed
88 89 90
    CookieService,
    UserService,
    SnackBarService,
91
    DialogService,
92
    StompRService,
Lukas Burgey's avatar
Lukas Burgey committed
93 94
    JsonPipe,
    ObjNgFor,
Lukas Burgey's avatar
Lukas Burgey committed
95 96 97 98 99
  ],
  bootstrap: [AppComponent],
  entryComponents: [
    ProfileComponent,
    SshKeysComponent,
Lukas Burgey's avatar
Lukas Burgey committed
100
    AccountComponent,
Lukas Burgey's avatar
Lukas Burgey committed
101
    QuestionnaireComponent,
Lukas Burgey's avatar
Lukas Burgey committed
102 103 104
  ],
})
export class AppModule {
Lukas Burgey's avatar
Lukas Burgey committed
105
  constructor() {
Lukas Burgey's avatar
Lukas Burgey committed
106 107 108
  }
}