Git Product home page Git Product logo

angular-typescript's Introduction

AngularJS 1 with TypeScript sample application

There are two branches on this repo:

  • main : No module loader is used. Bower is used as package manager
  • jspm : jspm is used as package manager and module loader

Please check the README.md file of each branch for specific instructions for each version

Quick start

Make sure node.js and git are installed

main branch

  • Clone this repository
  • npm install
  • ./gulp.sh restore
  • ./gulp.sh serve. A HTTP server will be started on port 8080
  • Navigate to http://localhost:8080

jspm branch

  • Clone this repository
  • git checkout jspm
  • npm install
  • ./jspm.sh install
  • ./gulp.sh restore
  • ./gulp.sh serve. A HTTP server will be started on port 8080
  • Navigate to http://localhost:8080

Main gulp tasks

  • ./gulp.sh restore : Fetches all 3rd-party dependencies from package manager (bower or jspm), fetches type definition files (tsd) and transpiles all typescript code
  • ./gulp.sh serve : Starts HTTP server with server root set to app directory
  • ./gulp.sh serve --dist : Starts HTTP server with server root set to dist directory (bundled version)
  • ./gulp.sh serve --external : Starts HTTP server and accepts external connections
  • ./gulp.sh transpile : Transpiles all typescript files
  • ./gulp.sh test : Runs all unit tests using Karma
  • ./gulp.sh coverage : Runs all unit tests and build a code coverage report at /test-results/coverage-report
  • ./gulp.sh bundle: Creates the bundled version for distribution on dist directory
  • ./gulp.sh package : Creates a ZIP files containing the bundled version

Directory structure

project
│   README.md [This file]
│   gulpfile.js
│   karma.conf.js [Karma configuration file]
│   tsconfig.json [TypeScript compiler configuration]
│   tsd.json [Definetly typed files]
│   bower.json [Bower packages]
│   bower.sh / gulp.sh / tsd.sh (shell scripts for Bower, Gulp and TSD)
│    
├───src [TypeScript source files]
│   ├───test [Unit tests]
│   ├───lib [Typescript source files provided by bower packages. They are copied from app/bower_dependencies by a gulp task]
│   └───ts [Application code]
|
├───app-typings [TypeScript definition files (.d.ts) written for the application]
├───typings [TypeScript definition files (d.ts) for third-party javascript libraries. Retrieved using tsd]
├───app [Resource files (html, css, images, fonts). Only folder that needs to be served. Includes typescript files from bower components though]
│   ├───transpiled [Output folder for TypeScript transpilation]
│   └───bower_dependencies [Main files of bower packages]
├───dist [Bundled version for distribution. See `gulp bundle`]
├───bower_components [Raw bower packages]
└───test-results [JUnit reporter compatible output of unit tests]
    ├───coverage-report [Code coverage report in HTML format]
    └───<test-suite> [Code coverage report in JSON and XML (Cobertura) format]

Unit tests

Unit tests can be executed via command line using ./gulp.sh test. To run Karma without gulp use the following commands:

./node_modules/karma/bin/karma start karma.conf.js --single-run ./node_modules/karma/bin/karma start karma.conf.js --single-run --log-level debug (with debug info)

It is possible to use QUnit test runner using the following URL:

http://localhost:<port>/test-runner.html

IDE information

Atom

The [https://atom.io/packages/atom-typescript](Atom typescript) package supports a filesGlob property on tsconfig.json that is not supported by TypeScript transpiler. It automatically derives the file names of files property based on filesGlob

Useful links

TODO

angular-typescript's People

Contributors

daniel-a-melo avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

abner brcosta

angular-typescript's Issues

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.