2020-02-08 22:33:31 +00:00
|
|
|
import { NgModule } from '@angular/core';
|
|
|
|
import { BrowserModule } from '@angular/platform-browser';
|
|
|
|
import { RouteReuseStrategy } from '@angular/router';
|
2020-02-08 02:01:00 +00:00
|
|
|
|
2020-02-08 22:33:31 +00:00
|
|
|
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
|
|
|
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
|
|
|
import { StatusBar } from '@ionic-native/status-bar/ngx';
|
2020-02-08 02:01:00 +00:00
|
|
|
|
2020-02-08 22:33:31 +00:00
|
|
|
import { AppComponent } from './app.component';
|
|
|
|
import { AppRoutingModule } from './app-routing.module';
|
|
|
|
import { HttpClientModule } from '@angular/common/http';
|
|
|
|
import { ComponentsModule } from './components/components.module';
|
2020-10-12 17:24:08 +00:00
|
|
|
import { TreeModule } from '@circlon/angular-tree-component';
|
2020-02-08 22:33:31 +00:00
|
|
|
import {AgGridModule} from 'ag-grid-angular';
|
2020-02-09 08:07:31 +00:00
|
|
|
import {MonacoEditorModule} from 'ngx-monaco-editor';
|
2020-02-11 05:55:59 +00:00
|
|
|
import { APP_BASE_HREF, PlatformLocation } from '@angular/common';
|
2021-03-11 17:09:48 +00:00
|
|
|
import {MarkdownModule, MarkedOptions} from 'ngx-markdown';
|
2020-10-21 18:54:18 +00:00
|
|
|
import {ConnectionServiceModule} from 'ng-connection-service';
|
2020-10-21 18:55:34 +00:00
|
|
|
import { ServiceWorkerModule } from '@angular/service-worker';
|
|
|
|
import { environment } from '../environments/environment';
|
2020-11-10 15:40:10 +00:00
|
|
|
import { AngularResizedEventModule } from 'angular-resize-event';
|
2020-11-16 15:37:45 +00:00
|
|
|
import { IonicSelectableModule } from 'ionic-selectable';
|
2021-03-11 17:09:48 +00:00
|
|
|
import * as hljs from 'highlight.js';
|
|
|
|
import { HighlightModule, HIGHLIGHT_OPTIONS } from 'ngx-highlightjs';
|
2020-02-11 05:55:59 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This function is used internal to get a string instance of the `<base href="" />` value from `index.html`.
|
|
|
|
* This is an exported function, instead of a private function or inline lambda, to prevent this error:
|
|
|
|
*
|
|
|
|
* `Error encountered resolving symbol values statically.`
|
|
|
|
* `Function calls are not supported.`
|
|
|
|
* `Consider replacing the function or lambda with a reference to an exported function.`
|
|
|
|
*
|
|
|
|
* @param platformLocation an Angular service used to interact with a browser's URL
|
|
|
|
* @return a string instance of the `<base href="" />` value from `index.html`
|
|
|
|
*/
|
|
|
|
export function getBaseHref(platformLocation: PlatformLocation): string {
|
|
|
|
return platformLocation.getBaseHrefFromDOM();
|
|
|
|
}
|
2020-02-08 02:01:00 +00:00
|
|
|
|
|
|
|
@NgModule({
|
|
|
|
declarations: [AppComponent],
|
|
|
|
entryComponents: [],
|
|
|
|
imports: [
|
|
|
|
BrowserModule,
|
|
|
|
IonicModule.forRoot(),
|
2020-02-08 04:19:35 +00:00
|
|
|
AppRoutingModule,
|
|
|
|
HttpClientModule,
|
2020-02-08 09:36:14 +00:00
|
|
|
ComponentsModule,
|
2020-10-12 17:24:08 +00:00
|
|
|
TreeModule,
|
2020-02-08 22:33:31 +00:00
|
|
|
AgGridModule.withComponents([]),
|
2020-02-09 08:07:31 +00:00
|
|
|
MonacoEditorModule.forRoot(),
|
2021-03-11 17:09:48 +00:00
|
|
|
HighlightModule,
|
|
|
|
MarkdownModule.forRoot({
|
|
|
|
markedOptions: {
|
|
|
|
provide: MarkedOptions,
|
|
|
|
useValue: {
|
|
|
|
highlight(code: string, lang: string, callback?: (error: any, code: string) => void): string {
|
|
|
|
const highlighted = hljs.highlight(lang, code, true);
|
|
|
|
|
|
|
|
if ( callback ) {
|
|
|
|
callback(null, highlighted.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
return highlighted.value;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}),
|
2020-10-21 18:54:18 +00:00
|
|
|
ConnectionServiceModule,
|
2020-10-21 18:55:34 +00:00
|
|
|
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
|
2020-11-10 15:40:10 +00:00
|
|
|
AngularResizedEventModule,
|
2020-11-16 15:37:45 +00:00
|
|
|
IonicSelectableModule,
|
2020-02-08 02:01:00 +00:00
|
|
|
],
|
|
|
|
providers: [
|
|
|
|
StatusBar,
|
|
|
|
SplashScreen,
|
2020-02-11 05:55:59 +00:00
|
|
|
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
|
|
|
|
{
|
|
|
|
provide: APP_BASE_HREF,
|
|
|
|
useFactory: getBaseHref,
|
|
|
|
deps: [PlatformLocation]
|
2021-03-11 17:09:48 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
provide: HIGHLIGHT_OPTIONS,
|
|
|
|
useValue: {
|
|
|
|
fullLibraryLoader: () => import('highlight.js'),
|
|
|
|
}
|
|
|
|
},
|
2020-02-08 02:01:00 +00:00
|
|
|
],
|
|
|
|
bootstrap: [AppComponent]
|
|
|
|
})
|
|
|
|
export class AppModule {}
|