代码小经验

1. const  id=this.resetForm.controls["profset"].value.split('_');
    const prfname=id.slice(2).join('_');   // 将数组从index为2的项连接起来
2. entity.match(newRegExp(/\/ctp\/eols-\d+/))  //正则表达式可以直接写, / 是定界符,内容中使用要转义

3. Angular 兄弟控件间通信,在父控件注入service, 在子组件不用注入,直接使用

AAARouterComponent(AAAService)------> AAAOverviewComponent 

                                                               ------> AAAControlsComponent

4. //对已有enum进行扩展

Export enum IpInterfaceExtEnum{
    bfdConfigParams='bfdcprm'
}

Export const IpInterfaceExtNickNames = {...IpInterfaceNickNames,...IpInterfaceExtEnum};

猜你喜欢

转载自blog.csdn.net/yizheng_zeng/article/details/132218925
今日推荐