@addapptables/responsive 中文文档教程
ADDAPPTABLES Reponsive
响应式资源管理器的实用程序。
Getting Started
首先,让我们通过 npm 安装软件包:
选择与您的 Angular 版本相对应的版本:
Angular | @addapptables/responsive |
---|---|
8 | 2.x |
7 | 1.x |
npm i @addapptables/responsive --S
安装对等依赖
npm i
@addapptables/ngrx-actions
@ngrx/store --S
How to use
项 Addapptables 响应依赖于 ngrx
import { selectAllScreen } from '@addapptables/responsive';
export class MyService {
constructor(private readonly _store: Store<any>) {}
screen(){
this._store.pipe(
select(selectAllScreen),
map(x => x.xs || x.sm) // mobile,
distinctUntilChanged(),
shareReplay()
).subscribe(isMobile => console.log(isMobile));
}
}
ADDAPPTABLES Reponsive
Utility for reponsive explorer.
Getting Started
To get started, lets install the package thru npm:
Choose the version corresponding to your Angular version:
Angular | @addapptables/responsive |
---|---|
8 | 2.x |
7 | 1.x |
npm i @addapptables/responsive --S
Install peer dependencies
npm i
@addapptables/ngrx-actions
@ngrx/store --S
How to use
Addapptables reponsive depends on ngrx
import { selectAllScreen } from '@addapptables/responsive';
export class MyService {
constructor(private readonly _store: Store<any>) {}
screen(){
this._store.pipe(
select(selectAllScreen),
map(x => x.xs || x.sm) // mobile,
distinctUntilChanged(),
shareReplay()
).subscribe(isMobile => console.log(isMobile));
}
}