SitePoint
  • Premium
  • Library
  • Community
  • Jobs
  • Blog
LoginStart Free Trial
Building Reusable Components in Angular 2
Introduction to the App
Creating the Weather Component
Creating the Weather Component Template
Styling the Weather Component
Creating the Weather Component (Services)
An Introduction to Dependency Injection
Getting the User's Geographical Location
Signing Up for Forecast.io (Weather Data Web API)
Introduction to Observables (ReactiveX (RXJS) Library)
Introduction to JSONP Get Requests (HTTP/JSONP)
Getting the Weather Data (HTTP/JSONP)
Converting the Location Method to an Observable
Creating the Weather Model Class
Introduction to the Component Lifecycle
Subscribing to the Weather Data Observable (ngOnInit)
Displaying the Weather Data in the Template
Formatting the Weather Data on the Template (Pipes)
Converting the Wind Value (Custom Pipes)
Converting the Temperature Value (Custom Pipes)
Getting a Google Maps API Key
Getting the Location Name Using Reverse Geocoding (Google Maps API)
Displaying the Location on the Component
Allowing the Changing of the Data Units
Adding the Javascript Icon Library (Skycons)
Adding the Animated Weather Icons
Configuring the Weather Based Colors
Changing the Component Colors Based on the Weather (ngStyle)
Hiding the Component Content Until the Data is Available
Adding a Loading Indicator
Final Tweaks
Reusing the Component in Another App
Exercise Challenge