summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/admin/admin.module.ts
blob: ab443337a312fa2937d98250fafa5d07501550fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import { CommonModule } from '@angular/common';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from '../app-routing.module';

import { UpgradeModule, downgradeComponent} from '@angular/upgrade/static';
import { HttpClientModule } from '@angular/common/http';
import { RouterModule, UrlHandlingStrategy } from '@angular/router';
import { APP_BASE_HREF } from '@angular/common';

export class CustomHandlingStrategy implements UrlHandlingStrategy {
  shouldProcessUrl(url) {
   console.log('url --->>> ' + url.toString());
    var str = "ng6";
    if (url.toString().search(str) == -1 ) 
       return false;
    else
        return true;
  }
  
  extract(url) { return url; }
  merge(url, whole) { return url; }
}


//declare var angular: any;

/*
declare var angular: angular.IAngularStatic;

angular.module('abs')
  .directive(
    'appusage',
    downgradeComponent({component: UsageComponent}) as angular.IDirectiveFactory
);

angular.module('abs')
  .directive(
    'app-hello',
    downgradeComponent({component: HelloComponent}) as angular.IDirectiveFactory
);
*/

@NgModule({
  declarations: [
  ],
  imports: [
    CommonModule,
    BrowserModule,
    AppRoutingModule,
    UpgradeModule,
    HttpClientModule,
    RouterModule,
    /*
    RouterModule.forRoot([
      {
        path: 'ng6/usage_list',
        component: UsageComponent
      }
    ],
    {
      useHash: true,
      enableTracing: true
    }
    )*/
  ],
  
  entryComponents: [
  ],
  providers: [ 
              { provide: UrlHandlingStrategy, useClass: CustomHandlingStrategy },
              { provide: APP_BASE_HREF,       useValue: '/' + (window.location.pathname.split('/')[1] || '') }
  ]
})

export class AdminModule { }