Skip to content
This repository has been archived by the owner on Mar 6, 2018. It is now read-only.
/ ng2-ts-boilerplate Public archive

AngularJS 2.x + TypeScript + Karma + Webpack

License

Notifications You must be signed in to change notification settings

w3tecch/ng2-ts-boilerplate

Repository files navigation

Build Status Dependency Status devDependency Status StackShare

Getting Started

Prerequisites

  1. Install Node.js

  2. Install these NPM packages globally

npm install -g webpack typescript typings karma

Dependencies

  1. Navigate to your project folder to install all dependencies
npm install

Commands

Running the server

npm start

Generate docs and start the docs server

npm run docs

Run test

npm test

Build the app

npm run build

Build the app

You can pass configurations to the app like this:

npm start --env prod

This can be passed to start and build command.

App Structure

projectRoot/
   |
   +-- config/ (configurations)
   +-- dist/ (minified app version will placed by gulp here with the task 'gulp dist')
   +-- docs/ (has the generated docs from typedoc)
   |
   +-- src/
   |   |
   |   +-- app/
   |   |   |
   |   |   + components/
   |   |   + models/
   |   |   + services/
   |   |   + utils/
   |   |   + modules/
   |   |   |   |
   |   |   |   + <moduleName>/
   |   |   |       |
   |   |   |       + components/
   |   |   |       |   |
   |   |   |       |   + <componentName>.ts
   |   |   |       |   + <componentName>.html
   |   |   |       |
   |   |   |       + filters/
   |   |   |       |   |
   |   |   |       |   + <filterName>.filter.js
   |   |   |       |
   |   |   |       + services/
   |   |   |           |
   |   |   |           + <serviceName>.service.js
   |   |   |
   |   |   + app.config.ts (represents the project configuration)
   |   |   + <appName>.ts (the app component)
   |   |   + <appName>.html (the app view)
   |   |   + <appName>.scss (the app styles)
   |   |
   |   +-- assets/
   |   |   |
   |   |   +-- fonts/
   |   |   +-- i18n/
   |   |   +-- images/
   |   |
   |   +-- index.html ("MAIN" - This is the start page of your single-page-application and has some gulp vars)
   |   +-- boot.ts
   |   +-- vendor.ts
   +-- typings-custom/ (custom type definition)

#Supporter

License

MIT