Angular 6从IIS提取站点名称

时间:2018-08-28 14:13:10

标签: javascript angular angular6

我正在寻找是否有一种方法可以从托管Angular Application的IIS中提取站点名称。

enter image description here

看上面的示例,我想知道是否可以使用Angular获得“应用程序1”和“应用程序2”。

我已经浏览了DOCUMENT和PlatformLocation,但是无法获取应用程序名称。我可以获得主机名,端口,位置来源等。

有什么想法或建议吗?

import {Component, Inject} from '@angular/core';
import {PlatformLocation } from '@angular/common';
import {DOCUMENT} from '@angular/platform-browser';

 constructor( platformLocation: PlatformLocation, @Inject(DOCUMENT) private document) {
    console.log((platformLocation as any).location.origin);
    console.log(document.location.protocol);
    console.log(document.location.hostname);
  }

谢谢。

0 个答案:

没有答案