考虑以下情形(Angular v7):
第二点是这里的关键,看起来像这样:
@NgModule({
imports: [
...
OAuthModule.forRoot({
resourceServer: {
allowedUrls: [API_SERVER_URL], // <== we need to set the value that we loaded from the external endpoint (JSON) here
sendAccessToken: true
}
}),
...
],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule { }
Run Code Online (Sandbox Code Playgroud)
我已经尝试了以下内容:
OAuthModule.forRoot()会在APP_INITIALIZER下载外部配置JSON 之前触发。main.ts进入角环境变量,然后引导中的AppModule。由于中的import { AppModule } from './app/app.module';语句也无法正常工作main.ts,这会导致AppModule在加载OAuthModule.forRoot()外部配置之前加载并启动(此注释确认了此行为)。main.ts …我一直在尝试使用 Flexbox 创建一个 3 列布局,其中块的高度相同。在下面的第一张图片中,显示了预期的行为(具有讽刺意味的是,它仅适用于 IE11)。在 Microsoft Edge、Chrome 和 Firefox 中,输出如第二张图所示,这不是我想要完成的。
环顾 Stackoverflow 和 Google 后,我似乎找不到解决问题的方法。如果有人能够帮助我解决这个问题,那将不胜感激!
JSFiddle:http : //jsfiddle.net/uyvhrjjb/1/
CSS:
#threeblocks {
width: 100%;
overflow: hidden;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-align-content: stretch;
-ms-flex-line-pack: stretch;
align-content: stretch;
-webkit-align-items: stretch;
-ms-flex-align: stretch;
align-items: stretch;
}
#threeblocks .block {
-webkit-order: 0;
-ms-flex-order: 0;
order: 0;
-webkit-flex: 0 1 auto;
-ms-flex: 0 1 …Run Code Online (Sandbox Code Playgroud)