1.6.0 • Published 6 years ago

restomax-weather v1.6.0

Weekly downloads
29
License
-
Repository
-
Last release
6 years ago

REQUIRENT

This library use wunderground api to get weather. U must to have an API Key to access on this API.

Sign Up to www.wunderground.com and get the API Key to https://www.wunderground.com/api in "Key Settings" Tab.

INSTALL

Run npm i --save restomax-weather

USE RESTOMAX-WEATHER

Import Module to your project

import { RMXWeatherModule } from 'restomax-weather';

@NgModule({
  imports: [
    ...
    RMXWeatherModule,
    ...
  ],
  ...
})
export class AppModule {}

Use Module

import { OnInit } from '@angular/core';
import { RMXWeatherProvider } from 'restomax-weather';

@Component({
    selector:         'app-component',
    templateUrl:      'app-component.html',
    styleUrls:        ['app-component.scss']
})
export class AppComponent implements OnInit  {
    constructor(
        ...
        private pWeather:       RMXWeatherProvider,
        ...
    )

    ngOnInit() {
        this.pWeather.intialize({'yourWeatherApiKey', State: 'Your State', City: 'Your City'});
        this.pWeather.weatherSubject.subscribe(
            weather => {
                // ... weather;
            },
            error   => console.warn(error)
        );
        this.pWeather.predictSubject.subscribe(
            predict => {
                // ... predict;
            },
            error   => console.warn(JSON.stringify(error))
        );
    }
}
1.6.0

6 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago