我需要使用CSS在文本上实现透明的strikethrought,因此我不必用<h1>标记替换<img>标记.我已经设法用CSS在文本上实现了直通,但我不能让它透明.
期望的效果:

是)我有的 :
body{
background: url(http://lorempixel.com/output/people-q-c-640-480-1.jpg);
background-size:cover;
}
h1{
font-family:arial;
position:relative;
display:inline-block;
}
h1:after{
content:'';
position:absolute;
width:100%;
height:2px;
left:0; top:17px;
background:#fff;
}Run Code Online (Sandbox Code Playgroud)
<h1>EXAMPLE</h1>Run Code Online (Sandbox Code Playgroud)
我如何实现透明的strikethrought,它可以挤出我的文本并允许背景出现在这一行中.
我想要一个 MatDialog 组件中的路由系统,它可以在我的应用程序的任何地方打开。
解释
所以我在/tata,我打开选项卡 2 上的对话框。所以我想要一个特定的 URL。当我复制/过去它时,对话框在选项卡 2 上打开,背景为背景/tata
尝试
在 app.component.html 中,添加一个 <router-outlet name="dialog"></router-outlet>
在我的路线声明中:
const routes: Routes = [
{ path: 'mainDialog',
outlet: 'dialog',
component: DialogOpenerComponent,
data: { dialog: MainDialogComponent },
children: [
{
path: 'dialogSubTab',
component: MainDialogSubTabComponent,
outlet: 'dialog-sub-tab' }
]}
];
Run Code Online (Sandbox Code Playgroud)
DialogOpenerComponent使用MainDialogComponentas 组件进行打开对话框调用。
当我调用this.router.navigate([{outlets: { 'dialog': 'mainDialog' }}]);主对话框时打开。
但是打开后MainDialogComponent,如何路由到其他子路由?
我有一个名为MyPageModule导入多个模块的复杂模块,它为 Service 提供以下注释@Injectable( { providedIn: 'root' } )。
这个模块是通过延迟加载导入的,如下所示:
// AppRoutingModule
...
{
path: 'my-page',
loadChildren: './lazy-loader-modules/lazy-loader-mypage/lazy-loader-mypage.module#LazyLoaderMyPageModule'
}
...
Run Code Online (Sandbox Code Playgroud)
// LazyLoaderMyPageModule
@NgModule({
declarations: [],
imports: [
CommonModule,
MyPageModule
]
})
export class LazyLoaderMyPageModule { }
Run Code Online (Sandbox Code Playgroud)
我想要的行为(实际情况并非如此): 当 url 与 /my-page/* 不同时,我希望 MyPageModule 导入的所有服务都被销毁。
我怎样才能做到这一点 ?