Editing and Building - 2haloes/Angular-Weather-Display GitHub Wiki

This was developed using Visual Studio Code so this page may use instructions specifically for VS Code

Setting up

  1. Download and install Node.js (https://nodejs.org/en/)
  2. Download and install an editor/IDE (Visual Studio code used with Angular extensions recommended - https://code.visualstudio.com/ )
  3. Install Angular command line using the terminal command -> npm install -g @angular/cli
  4. Clone the repository using the terminal command -> https://github.com/2haloes/Angular-Weather-Display.git
  5. Open the folder where the repository has been cloned to

Editing

  • Most of the web app is within the 'src/app/home' folder, it contains the html page, css stylesheet and ts typescript file.
  • Within the 'src/app/default' is the page that displays if the url isn't given the right parameters, instructing the end user how to setup the page
  • The 'src/app/weather-service.service.ts' file is called from the home component, it calls the proxy that pulls the data from the DarkSky API
  • The 'src/darkskyproxy.[php/aspx]' files are used to pull the data from the DarkSky API, this is used as directly calling the DarkSky API isn't allowed
  • The 'src/assets/images' folder contains the images used within the web app, changing these will change the imaged used when the web app is built

Building

  • To build for PHP, use the command -> ng build --configuration=php
  • To build for ASP.NET, use the command -> ng build --configuration=asp
  • When building for ASP.NET, the aspx proxy must be manually copied over from the src folder, this is because of an issue with how configurations change files
  • If you are exclusively building for ASP.NET then in 'angular.json' you can change the asset file from "darkskyproxy.php" to "darkskyproxy.aspx" which will put in the correct file