типа:
                  
                  
                  
                  
                  
                  centered = true;
                  
                  
                  
                  
                  
                  @HostBinding('style.margin')
                  
                  
                  get margin(): string | null {
                  
                  
                    return this.centered ? '0 auto' : null;
                  
                  
                  }
                  
                  
                  Или да, через класс:
                  
                  
                  
                  
                  
                  @HostBinding('class._centered')
                  
                  
                  centered = true;
                  
                  
                
@HostBinding('class.centered') public centered: boolean; ngOnInit() { this.centered = props.type === MapType.REPORT; } .centered { margin: 0 auto; } На ДОМ элементе вижу класс - но стили не применились
Обсуждают сегодня