当我点击撰写按钮打开电子邮件模板时(例如,在点击撰写邮件时在gmail中给出),在单页中使用辅助路由获取多个模板。
问题是:当点击十字按钮时,如何删除或取消激活此辅助路线。
app.ts
public class ContactModel
{
[Required(ErrorMessage="Please enter the subject.")]
[Display(Name="Subject")]
public string Subject { get; set; }
}
app.html
@RouteConfig([
{
path: '/',
name: 'OpportunityList',
component: OpportunityComponent,
useAsDefault: true
},
{
path: '/detail',
name: 'Detail',
component: DetailComponent
},
{
aux: '/mailer',
name: 'Mailer',
component: MailerComponent
}
])
mailer.component.ts
<a [routerLink]="['/', ['Mailer'] ]" >Compose</a>
mailer.component.html
export class MailComponent implements OnInit{
closeEmail(){
console.log("please suggest me to Deactivate this template")
}
}
答案 0 :(得分:1)
this.router.navigate([{ outlets: { aux: null } }]);