Ngx Responsive Versions Save

Superset of RESPONSIVE DIRECTIVES to show or hide items according to the size of the device screen and another features in Angular 9

v8.2.0

4 years ago

7.0.1

5 years ago

V7.0.1

  • Update docs

V7.0.0

Bug fixes

  • fix responsive-window #122
  • in responsive directive make min and max optional

Features

  • upgrade to Angular v7
  • responsive-window improvements
    • Add ability to use container reference directly #123
    • add manual refresh action to force refresh when non media event occurs #124

v6.0.0

6 years ago

v5.0.3

6 years ago

Breacking Changes in V5.0.3

  • New method to set the custom config:

    • v4.0.1
     import { NgModule } from '@angular/core'
     import { ResponsiveModule, ResponsiveConfig } from 'ngx-responsive'
     ...
     let config = {
        breakPoints: {
            xs: {max: 600},
            sm: {min: 601, max: 959},
            md: {min: 960, max: 1279},
            lg: {min: 1280, max: 1919},
            xl: {min: 1920}
        },
        debounceTime: 100 // allow to debounce checking timer
      };
    
      export function ResponsiveDefinition(){ 
              return new ResponsiveConfig(config);
      };
     ...
    @NgModule({
        imports: [
          ResponsiveModule
        ],
        declarations: [
          AppComponent
        ],
        providers:[{
         provide: ResponsiveConfig, 
         useFactory: ResponsiveDefinition }]
    })
    export class AppModule { }
    
    • v5.0.3
     import { NgModule } from '@angular/core'
     import { ResponsiveModule } from 'ngx-responsive'
     ...
     const config = {
        breakPoints: {
            xs: {max: 600},
            sm: {min: 601, max: 959},
            md: {min: 960, max: 1279},
            lg: {min: 1280, max: 1919},
            xl: {min: 1920}
        },
        debounceTime: 100
      };
     ...
    @NgModule({
        imports: [
          BrowserModule,
          ResponsiveModule.forRoot(config)
        ],
        declarations: [
          AppComponent
        ],
        providers:[]
    })
    export class AppModule { }
    

New Features in V5.0.3:

  • Reactive services that expose changes through observables:

    • BrowserInfoRx
    • IeInfoRx
    • DeviceInfoRx
    • DeviceStandardInfoRx
    • OrientationInfoRx
    • ResponsiveSizeInfoRx
    • UserAgentInfoRx

    Example: We initialize the service and we subscribe to the event changes:

    1. Inject the service in the constructor:
        constructor(
            public browserInfoRx: BrowserInfoRx
        ) {}
    
    
    1. Connet to the reactive service:
        ngOnInit(): void {
            this.browserInfoRx.connect();
        }
    
    
    1. And subscribe to the events service:
      this.browserInfoRx.getBrowser.subscribe((data) => {
        console.log('this.browserInfoRx.getBrowser ===>', data);
      }, (err) => {
        console.log('Error', err);
      });
    
    

    or :

    ngOnInit(): void {
        this.browserInfoRx.connect().subscribe((data) => {
        console.log('this.browserInfoRx.getBrowser ===>', data);
      }, (err) => {
        console.log('Error', err);
      });
    }
    
    
    1. And remove yours subscriptions:
    ngOnDestroy(): void {
        this.browserInfoRx.disconnect();
    }
    

Methods to subscribe to the observables for each of the reactive services:

  • BrowserInfoRx -> getBrowser -> BrowserInfoRx.getBrowser

  • IeInfoRx -> getIE -> IeInfoRx.getIE

  • DeviceInfoRx -> getDevice -> DeviceInfoRx.getDevice

  • DeviceStandardInfoRx -> getStandardDevice -> DeviceStandardInfoRx.getStandardDevice

  • OrientationInfoRx -> getOrientation -> OrientationInfoRx.getOrientation

  • ResponsiveSizeInfoRx -> getResponsiveSize -> ResponsiveSizeInfoRx.getResponsiveSize

  • UserAgentInfoRx -> getUserAgent -> UserAgentInfoRx.getUserAgent

3.1.7

6 years ago

3.1.1

6 years ago

v0.8.4

7 years ago

v0.8.3

7 years ago

v0.4.6

7 years ago

v0.4.5

7 years ago