Coder Social home page Coder Social logo

ericlease / angular2aspnetcorestarter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wickdninja/angular2aspnetcorestarter

0.0 1.0 0.0 585 KB

starter kit for angular2 with cli support & asp.net core

License: MIT License

C# 36.04% JavaScript 24.13% TypeScript 27.84% HTML 8.15% CSS 3.84%

angular2aspnetcorestarter's Introduction

Angular 2 via ASP.NET Core

Angular 2 Client

This project was generated with angular-cli. To learn more about Angular2 or the angular cli please reference the docs.

ASP.NET Core Server

This project was scaffolded using Yoeman using the aspnetcore-angular2 generator

Development

Requirements

Recommended tools

  • Angular-cli: install globally using npm install -g angular-cli

Editors / IDE

Restoring Dependencies

  • Visual Studio 2015 will attempt to restore both nuget and npm packages automatically.
    • If this fails or if Visual Studio is just being difficult you can manually trigger this.
      • Nuget: via the nuget package manager
      • Node modules: via the Task Runner Explorer via the "Install" task.
  • VSCode / CLI
    • Open a command line interface
    • Execute dotnet restore for nuget packages
    • Execute npm install for node modules
      • If you installed yarn execute yarn

Build It! (Client & Server)

  • Visual Studio: Normal build procedure.
    • There are bindings in the package.json file that instruct Visual Studio to trigger the cient build prior to buiding the C# code.
  • VSCode / CLI
    • Execute npm run build
      • There are script definitions in the package.json file that will trigger both .net and JS builds.

Run It! (Client & Server)

  • Visual Studio: Normal run / debug procedure.
  • VSCode also has a nice integrated debugging experience.
    • Click on the debug tab and click run at the top.
      • Make sure ".Net Core Launch (web)" profile is selected.

Angular2 Development tips

Angular 2 and it's CLI have some nice features to help speed up development.

Development server

Run npm start for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive/pipe/service/class.

Build

Run ng build to build the project. The build artifacts will be stored in the wwwroot/ directory. Use the -prod flag for a production build.

Running unit tests

Run npm test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor. Before running the tests make sure you are serving the app via ng serve.

Deploying to Github Pages

Run ng github-pages:deploy to deploy to Github Pages.

Further help

To get more help on the angular-cli use ng --help or go check out the Angular-CLI README.

Note: While running the server you can still make changes to the client without having to "rerun".
Simply execute ng build to rebuild client code then refresh your browser to see the changes.

CI via TeamCity

Build Agent Requirements

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.