<commit_before>This is a project to learn how to use Angular2 with ASP.NET Core and angular-cli using VSCode and Visual Studio 2017. 

Angular part is based on the official Angular's [Tour of Heroes](https://angular.io/docs/ts/latest/tutorial/) tutorial but using Angular-Cli instead of SystemJS.

This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.26.

# Preconditions

* Install `Node.js` and `npm` 
    * Verify that you are running at least node **v5.x.x** and npm **3.x.x** by running `node -v` and `npm -v`
* `> npm install -g npm`
* `> npm install -g typescript`
* `> npm install -g angular-cli` [angular-cli](https://github.com/angular/angular-cli)

### Optional packages:
* `> npm install -g typings`
* `> npm install -g gulp`
* `> npm install -g bower`
* `> npm install -g yo`
* `> npm install -g grunt-cli`
* __...OR SHORTLY: `> npm install -g npm typescript angular-cli gulp bower typings grunt-cli yo`__

# Development
## Steps during development
* `cd .\src\Frontend` __`> npm start`__ which starts __`ng serve`__
* `cd .\src\Backend` __`> dotnet watch run`__ or `> dotnet run`
* Navigate to [http://localhost:4200/](http://localhost:4200/) - this is the _Frontend_ URL created by __`ng serve`__ 
which is configured in `proxy.conf.json` to pass all the API requests to the running ASP.NET Core application on port __:5002__.
The `ng serve` does not create any files on disk and everything is served from memory.
* __`ng build`__ command will transpile and bundle all needed files and copy everything, including static files, to `wwwroot` folder of the _Backend_ application

## EntityFramework
* Drop database before enabling EF migrations: `dotnet ef database drop -c ApplicationDbContext`
* Enable and create EF migration: `dotnet ef migrations add InitialCreate -c ApplicationDbContext`
* Remove EF migrations: `dotnet ef migrations remove`
* __Apply the migration to the database: `dotnet ef database update -c ApplicationDbContext`__
* Add new migration after code changes: 

    ```
    dotnet ef migrations add HeroDescription -c ApplicationDbContext
    dotnet ef database update -c ApplicationDbContext
    ```

# Frontend development (src\Frontend)

In terminal got to **Frontend** directory: `cd src\Frontend`

## Development server 
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
this is the _Frontend_ URL created by __`ng serve`__ 
which is configured in `proxy.conf.json` to pass all the API requests to the running ASP.NET Core application on port :5002.<commit_msg>readme updated - .NET Core 1.1<commit_after>This is a project to learn how to use Angular2 with ASP.NET Core and angular-cli using VSCode and Visual Studio 2017. 

Angular part is based on the official Angular's [Tour of Heroes](https://angular.io/docs/ts/latest/tutorial/) tutorial but using Angular-Cli instead of SystemJS.

This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.26.

# Preconditions

* Install `Node.js` and `npm` 
    * Verify that you are running at least node **v5.x.x** and npm **3.x.x** by running `node -v` and `npm -v`
* `> npm install -g npm`
* `> npm install -g typescript`
* `> npm install -g angular-cli` [angular-cli](https://github.com/angular/angular-cli)
* Install [.NET Core 1.1 runtime/SDK](https://www.microsoft.com/net/download/core/#/runtime/current)

### Optional packages:
* `> npm install -g typings`
* `> npm install -g gulp`
* `> npm install -g bower`
* `> npm install -g yo`
* `> npm install -g grunt-cli`
* __...OR SHORTLY: `> npm install -g npm typescript angular-cli gulp bower typings grunt-cli yo`__

# Development
## Steps during development
* `cd .\src\Frontend` __`> npm start`__ which starts __`ng serve`__
* `cd .\src\Backend` run command `> dotnet restore` only first time after clone
* `cd .\src\Backend` __`> dotnet watch run`__ or `> dotnet run`
* Navigate to [http://localhost:4200/](http://localhost:4200/) - this is the _Frontend_ URL created by __`ng serve`__ 
which is configured in `proxy.conf.json` to pass all the API requests to the running ASP.NET Core application on port __:5002__.
The `ng serve` does not create any files on disk and everything is served from memory.
* __`ng build`__ command will transpile and bundle all needed files and copy everything, including static files, to `wwwroot` folder of the _Backend_ application

## EntityFramework
* Drop database before enabling EF migrations: `dotnet ef database drop -c ApplicationDbContext`
* Enable and create EF migration: `dotnet ef migrations add InitialCreate -c ApplicationDbContext`
* Remove EF migrations: `dotnet ef migrations remove`
* __Apply the migration to the database: `dotnet ef database update -c ApplicationDbContext`__
* Add new migration after code changes: 

    ```
    dotnet ef migrations add HeroDescription -c ApplicationDbContext
    dotnet ef database update -c ApplicationDbContext
    ```

# Frontend development (src\Frontend)

In terminal got to **Frontend** directory: `cd src\Frontend`

## Development server 
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
this is the _Frontend_ URL created by __`ng serve`__ 
which is configured in `proxy.conf.json` to pass all the API requests to the running ASP.NET Core application on port :5002.
{'fraction_non_alphanumeric': 0.10083727702948671, 'fraction_numerical': 0.012377138696760102, 'mean_word_length': 4.203598484848484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 28, 'https://': 7, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1130976', 'n_tokens_mistral': 1703, 'n_tokens_neox': 1592, 'n_words': 695}