小编Md.*_*yed的帖子

如何在角度4中显示最佳条件模板

目前,我练习角度4. 当普通用户查看此时显示公共内容当注册用户进入网页然后显示编辑或某些内容.如何最佳实践显示有条件的模板或一些Html内容示例:

<div *ngIf="isUser">
    some Content  here......
</div>
<div *ngIf="!isUser">
    some Content here .....
</div>
Run Code Online (Sandbox Code Playgroud)

实际上,我想知道如何做到最好.

angular-template angular

9
推荐指数
2
解决办法
2万
查看次数

如何从父路由器或父路由器检查活动子路由器?

如何可能检查子路由器是否活动,在 angular 4 中显示状态真或假,
现在我使用:/* @angular/cli: 1.4.4 node: 8.6.0 typescript: 2.3.4 @angular/路由器:4.4.4 */

我的父母路线是:

const routes:Routes=[
    {
        path: '', component: SummaryOfFindingsComponent,
        children:[
            {
                path:'data-time-frame', component: DataTimeFrameComponent
            },
            {
                path:'email-address', component: EmailAddressesComponent
            },
            {
                path:'repair-orders', component: RepairOrdersComponent
            },
            {
                path:'total-records', component:TotalRecordsComponent
            },
            {
                path:'unique-households', component: UniqueHouseholdsComponent
            },
            {
                path:'unique-vins', component: UniqueVinsComponent
            }
        ]
    }
]
Run Code Online (Sandbox Code Playgroud)

父组件是:

export class SummaryOfFindingsComponent implements OnInit {
    isUserSelected;
    constructor() { this.isUserSelected=false; }
    ngOnInit() { }
    isUserItemSelect(){
        this.isUserSelected=true;
    }
}
Run Code Online (Sandbox Code Playgroud)

router if-statement conditional-statements angular-routing angular

5
推荐指数
2
解决办法
5677
查看次数

SVG路径未显示相同的不同浏览器

我正在尝试创建带有形状箭头的SVG按钮,我在此处使用路径我的代码,有人建议我解决此问题

<svg height="100" width="300">
  <a href="#"><path id="lineAB" d="M0 1 l 280 0 l50 50 l-50 50 l-280 0 z" stroke="gray" stroke-width="2" fill="red" /></a>
</svg>
Run Code Online (Sandbox Code Playgroud)

这是我的截图: 在此处输入图片说明

html css user-interface frontend svg

2
推荐指数
1
解决办法
57
查看次数