*ngIf hide some content on mobile screen, Angular 4

后端 未结 9 2189
盖世英雄少女心
盖世英雄少女心 2020-12-13 04:47

I have:

showHide: false;

Content
9条回答
  •  北荒
    北荒 (楼主)
    2020-12-13 04:53

    Thought I would add this to the question as I found in this particular situation @angular/flex-layout to be very helpful. https://github.com/angular/flex-layout.

    In particular you might be interested in the fxHide feature: https://github.com/angular/flex-layout/wiki/fxHide-API but this package makes working with a responsive application much easier in my opinion.

    You can show or hide content like so.

    Doesnt show when 'small' or greater than 'medium' resolutions:

    Only hides when at medium resolution

    The breakpoints can be custom but they have default ones already set.

提交回复
热议问题