Е
if(role1) addSomethingToDom;
if(role2) addSomethingToDom;
if(role2) addSomethingToDom;
верно?
Size: a a a
Е
if(role1) addSomethingToDom;
if(role2) addSomethingToDom;
if(role2) addSomethingToDom;
OS
if (this.currentUser.roles instanceof Array) {
this.currentUser.roles.map(v => {
if (this.appCanAccess.indexOf(v['name']) != -1) {
this.viewContainer.createEmbeddedView(this.templateRef);
}
})
}
D
D
DT
C
OS
D
OS
[value]="objservable$ | async"
G
DT
OS
S
if (this.appCanAccess.isAllowed(this.currentUser.roles)) {
this.viewContainer.createEmbeddedView(this.templateRef)
}
D
S
OS
G
OS
let needRenderBlock1 = false;
let needRenderBlock2 = false;
roles.forEach(role => {
if (#логика#) {
needRenderBlock1 = true;
}
if (#логика#) {
needRenderBlock2 = true;
}
});
if (needRenderBlock1) {
}
OS