/WeatherProject

Primary LanguageHTMLMIT LicenseMIT

Description

This is a mini project about weather on Earth with a given API (https://openweathermap.org) and it helps me to understand better angularjs. There is a home page where the weather for the current location can be found. There is also a second page where the weather from two different city can be compared.

Install Dependencies

We have preconfigured npm to automatically run bower so we can simply do:

npm install

Run the Application

We have preconfigured the project with a simple development web server. The simplest way to start this server is:

npm start

Now browse to the app at [localhost:8000/index.html][local-app-url].

Running Unit Tests

The easiest way to run the unit tests is to use the supplied npm script:

npm test

You can also ask Karma to do a single run of the tests and then exit. This is useful if you want to check that a particular version of the code is operating as expected. The project contains a predefined script to do this:

npm run test-single-run

Before starting Protractor, open a separate terminal window and run:

npm start

In addition, since Protractor is built upon WebDriver, we need to ensure that it is installed and up-to-date. The angular-seed project is configured to do this automatically before running the end-to-end tests, so you don't need to worry about it. If you want to manually update the WebDriver, you can run:

npm run update-webdriver

Once you have ensured that the development web server hosting our application is up and running, you can run the end-to-end tests using the supplied npm script:

npm run protractor

This script will execute the end-to-end tests against the application being hosted on the development server.

Updating Angular

Since the Angular framework library code and tools are acquired through package managers (npm and bower) you can use these tools to easily update the dependencies. Simply run the preconfigured script:

npm run update-deps

Loading Angular Asynchronously

The angular-seed project supports loading the framework and application scripts asynchronously. The special index-async.html is designed to support this style of loading. For it to work you must inject a piece of Angular JavaScript into the HTML page. The project has a predefined script to help do this:

npm run update-index-async