├── .editorconfig ├── .github ├── CONTRIBUTING.md └── ISSUE_TEMPLATE.md ├── .gitignore ├── .jshintrc ├── .stylelintrc ├── .travis.yml ├── LICENSE ├── README.md ├── appveyor.yml ├── gulpfile.ts ├── karma.conf.js ├── package.json ├── protractor.conf.js ├── src └── client │ ├── app │ ├── about │ │ ├── about.component.css │ │ ├── about.component.e2e-spec.ts │ │ ├── about.component.html │ │ ├── about.component.spec.ts │ │ ├── about.component.ts │ │ ├── about.module.ts │ │ ├── about.routes.ts │ │ └── index.ts │ ├── app.component.e2e-spec.ts │ ├── app.component.html │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── app.routes.ts │ ├── charts │ │ ├── charts.component.html │ │ ├── charts.component.ts │ │ ├── charts.module.ts │ │ ├── charts.routes.ts │ │ └── index.ts │ ├── home │ │ ├── home.component.css │ │ ├── home.component.e2e-spec.ts │ │ ├── home.component.html │ │ ├── home.component.spec.ts │ │ ├── home.component.ts │ │ ├── home.module.ts │ │ ├── home.routes.ts │ │ └── index.ts │ ├── main-prod.ts │ ├── main.ts │ ├── shared │ │ ├── config │ │ │ └── env.config.ts │ │ ├── index.ts │ │ ├── name-list │ │ │ ├── index.ts │ │ │ ├── name-list.service.spec.ts │ │ │ └── name-list.service.ts │ │ ├── navbar │ │ │ ├── index.ts │ │ │ ├── navbar.component.css │ │ │ ├── navbar.component.html │ │ │ └── navbar.component.ts │ │ ├── shared.module.ts │ │ └── toolbar │ │ │ ├── index.ts │ │ │ ├── toolbar.component.css │ │ │ ├── toolbar.component.html │ │ │ └── toolbar.component.ts │ └── system-config.ts │ ├── assets │ ├── aapl-c.json │ ├── data.json │ ├── geojson.json │ └── svg │ │ └── more.svg │ ├── css │ └── main.css │ ├── index.html │ ├── tsconfig.json │ └── typings.d.ts ├── test-config.js ├── test-main.js ├── tools ├── .gitignore ├── README.md ├── config.ts ├── config │ ├── project.config.ts │ ├── seed.config.interfaces.ts │ └── seed.config.ts ├── debug.ts ├── env │ ├── base.ts │ ├── dev.ts │ ├── env-config.interface.ts │ └── prod.ts ├── manual_typings │ ├── project │ │ └── sample.package.d.ts │ └── seed │ │ ├── angular2-hot-loader.d.ts │ │ ├── autoprefixer.d.ts │ │ ├── clean.tmp │ │ ├── colorguard.d.ts │ │ ├── connect-livereload.d.ts │ │ ├── cssnano.d.ts │ │ ├── doiuse.d.ts │ │ ├── express-history-api-fallback.d.ts │ │ ├── istream.d.ts │ │ ├── karma.d.ts │ │ ├── merge-stream.d.ts │ │ ├── open.d.ts │ │ ├── postcss-reporter.d.ts │ │ ├── slash.d.ts │ │ ├── stylelint.d.ts │ │ ├── systemjs-builder.d.ts │ │ ├── tildify.d.ts │ │ ├── tiny-lr.d.ts │ │ └── walk.d.ts ├── tasks │ ├── project │ │ └── sample.task.ts │ └── seed │ │ ├── build.assets.dev.ts │ │ ├── build.assets.prod.ts │ │ ├── build.bundles.app.ts │ │ ├── build.bundles.ts │ │ ├── build.docs.ts │ │ ├── build.html_css.ts │ │ ├── build.index.dev.ts │ │ ├── build.index.prod.ts │ │ ├── build.js.dev.ts │ │ ├── build.js.e2e.ts │ │ ├── build.js.prod.ts │ │ ├── build.js.test.ts │ │ ├── build.js.tools.ts │ │ ├── check.versions.ts │ │ ├── clean.all.ts │ │ ├── clean.coverage.ts │ │ ├── clean.dev.ts │ │ ├── clean.prod.ts │ │ ├── clean.tools.ts │ │ ├── compile.ahead.prod.ts │ │ ├── copy.prod.ts │ │ ├── css-lint.ts │ │ ├── e2e.ts │ │ ├── generate.manifest.ts │ │ ├── karma.run.ts │ │ ├── karma.watch.ts │ │ ├── minify.bundles.ts │ │ ├── serve.coverage.ts │ │ ├── serve.docs.ts │ │ ├── server.prod.ts │ │ ├── server.start.ts │ │ ├── tslint.ts │ │ ├── watch.dev.ts │ │ ├── watch.e2e.ts │ │ ├── watch.test.ts │ │ └── webdriver.ts ├── utils.ts └── utils │ ├── project.utils.ts │ ├── project │ └── sample_util.ts │ ├── seed.utils.ts │ └── seed │ ├── clean.ts │ ├── code_change_tools.ts │ ├── karma.start.ts │ ├── server.ts │ ├── tasks_tools.ts │ ├── template_locals.ts │ ├── tsproject.ts │ └── watch.ts ├── tsconfig.json ├── tslint.json └── typings.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 2 9 | end_of_line = lf 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | insert_final_newline = false 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Submitting Pull Requests 2 | 3 | **Please follow these basic steps to simplify pull request reviews - if you don't you'll probably just be asked to anyway.** 4 | 5 | * Please rebase your branch against the current master 6 | * Run ```npm install``` to make sure your development dependencies are up-to-date 7 | * Please ensure that the test suite passes **and** that code is lint free before submitting a PR by running: 8 | * ```npm test``` 9 | * If you've added new functionality, **please** include tests which validate its behaviour 10 | * Make reference to possible [issues](https://github.com/mgechev/angular2-seed/issues) on PR comment 11 | 12 | ## Submitting bug reports 13 | 14 | * Please detail the affected browser(s) and operating system(s) 15 | * Please be sure to state which version of node **and** npm you're using 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **IMPORTANT**: This repository's issues are reserved for feature requests and bug reports. Do not submit support requests here. 2 | 3 | 4 | **Steps to reproduce and a minimal demo of the problem** 5 | 6 | _What steps should we try in your demo to see the problem?_ 7 | 8 | **Current behavior** 9 | 10 | 11 | **Expected/desired behavior** 12 | 13 | 14 | **Other information** 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # Compiled binary addons (http://nodejs.org/api/addons.html) 20 | build/Release 21 | 22 | # Dependency directory 23 | # Commenting this out is preferred by some people, see 24 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- 25 | /node_modules/ 26 | /typings/ 27 | 28 | # Users Environment Variables 29 | .lock-wscript 30 | .tsdrc 31 | .typingsrc 32 | 33 | #IDE configuration files 34 | .idea 35 | .vscode 36 | *.iml 37 | 38 | /tools/**/*.js 39 | dist 40 | dev 41 | docs 42 | lib 43 | test 44 | tmp 45 | 46 | gulpfile.js 47 | gulpfile.js.map 48 | 49 | # OS X trash files 50 | .DS_Store 51 | 52 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise": true, 3 | "camelcase": true, 4 | "curly": true, 5 | "eqeqeq": true, 6 | "es3": false, 7 | "forin": true, 8 | "freeze": true, 9 | "immed": true, 10 | "indent": 2, 11 | "latedef": "nofunc", 12 | "newcap": true, 13 | "noarg": true, 14 | "noempty": true, 15 | "nonbsp": true, 16 | "nonew": true, 17 | "plusplus": false, 18 | "quotmark": "single", 19 | "undef": true, 20 | "unused": false, 21 | "strict": false, 22 | "maxparams": 10, 23 | "maxdepth": 5, 24 | "maxstatements": 40, 25 | "maxcomplexity": 8, 26 | "maxlen": 140, 27 | 28 | "asi": false, 29 | "boss": false, 30 | "debug": false, 31 | "eqnull": true, 32 | "esnext": false, 33 | "evil": false, 34 | "expr": false, 35 | "funcscope": false, 36 | "globalstrict": false, 37 | "iterator": false, 38 | "lastsemic": false, 39 | "laxbreak": false, 40 | "laxcomma": false, 41 | "loopfunc": true, 42 | "maxerr": false, 43 | "moz": false, 44 | "multistr": false, 45 | "notypeof": false, 46 | "proto": false, 47 | "scripturl": false, 48 | "shadow": false, 49 | "sub": true, 50 | "supernew": false, 51 | "validthis": false, 52 | "noyield": false, 53 | 54 | "browser": true, 55 | "node": true, 56 | 57 | "globals": { 58 | "angular": false, 59 | "ng": false 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /.stylelintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "stylelint-config-standard", 3 | "rules": { 4 | "block-no-empty": null, 5 | "at-rule-empty-line-before": null, 6 | "rule-non-nested-empty-line-before": null, 7 | "selector-pseudo-class-no-unknown" : [ true, { 8 | "ignorePseudoClasses": [ 9 | "host" 10 | ] 11 | }] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 4 4 | - 5 5 | - stable 6 | 7 | sudo: false 8 | 9 | os: 10 | - linux 11 | - osx 12 | 13 | matrix: 14 | exclude: 15 | - os: osx 16 | node_js: 4 17 | - os: osx 18 | node_js: 5 19 | 20 | before_install: 21 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi 22 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated xctool || brew upgrade xctool; fi 23 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CHROME_BIN=chromium-browser; fi # Karma CI 24 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew cask install google-chrome; fi # Karma CI 25 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export DISPLAY=:99.0; fi 26 | 27 | before_script: 28 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sh -e /etc/init.d/xvfb start; fi 29 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then nohup bash -c "webdriver-manager start 2>&1 &"; fi # Protractor CI 30 | 31 | after_failure: 32 | - cat /home/travis/build/mgechev/angular2-seed/npm-debug.log 33 | 34 | branches: 35 | only: master 36 | 37 | notifications: 38 | email: true 39 | webhooks: 40 | urls: https://webhooks.gitter.im/e/565e4b2fed3b96c1b964 41 | on_success: change # options: [always|never|change] default: always 42 | on_failure: always # options: [always|never|change] default: always 43 | on_start: never # options: [always|never|change] default: always 44 | 45 | env: 46 | global: 47 | # https://github.com/DefinitelyTyped/tsd#tsdrc 48 | # Token has no scope (read-only access to public information) 49 | - TSD_GITHUB_TOKEN=9b18c72997769f3867ef2ec470e626d39661795d 50 | 51 | cache: 52 | directories: node_modules 53 | 54 | script: 55 | - npm run tests.all 56 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Minko Gechev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | An example of how to integrate [Highcharts](http://www.highcharts.com/) into an Angular 2 application by [Richard Natal - Bigous](https://github.com/Bigous) 4 | 5 | Project setup based [angular2-seed](https://github.com/mgechev/angular2-seed.git) 6 | 7 | # How to start 8 | 9 | **Note** that this seed project requires node v4.x.x or higher and npm 2.14.7. 10 | 11 | ```bash 12 | git clone https://github.com/AngularShowcase/angular2-seed-ng2-highcharts.git 13 | cd angular2-seed-ng2-highcharts 14 | npm install # or `npm run reinstall` if you get an error 15 | npm start # start with --env dev 16 | ``` 17 | 18 | # Contributing 19 | 20 | Please see the [CONTRIBUTING](https://github.com/mgechev/angular2-seed/blob/master/CONTRIBUTING.md) file for guidelines. 21 | 22 | # Examples 23 | 24 | Forks of this project demonstrate how to extend and integrate with other libraries: 25 | 26 | - https://github.com/justindujardin/angular2-seed - integration with [ng2-material](https://github.com/justindujardin/ng2-material) 27 | - https://github.com/AngularShowcase/angular2-sample-app - sample Angular 2 application 28 | - https://github.com/AngularShowcase/ng2-bootstrap-sbadmin - ng2-bootstrap-sbadmin 29 | - https://github.com/mgechev/switching-to-angular2 - code samples for the book ["Switching to Angular 2"](https://www.packtpub.com/web-development/switching-angular-2). 30 | - https://github.com/DeviantJS/angular2-seed-postcss - Extending PostCSS with precss / cssnext for Sass-like features. 31 | - https://github.com/DeviantJS/angular2-seed-material2 - integration with [Angular2-Material](https://github.com/angular/material2). 32 | - https://github.com/AngularShowcase/angular2-sample-app - sample Angular 2 application. 33 | - https://github.com/AngularShowcase/ng2-bootstrap-sbadmin - ng2-bootstrap-sbadmin. 34 | - https://github.com/AngularShowcase/angular2-seed-ng2-highcharts - Simple application including a [Highcharts](http://www.highcharts.com) graph. 35 | - https://github.com/tarlepp/angular-sailsjs-boilerplate-frontend-angular2 - Example application for [Sails.js](http://sailsjs.org/) integration. 36 | - https://github.com/ludohenin/ng2-wp-blog - Angular 2 application using Wordpress [JSON-API](http://v2.wp-api.org) backend.. 37 | - https://github.com/AngularShowcase/angular2-seed-example-mashup - Angular 2 application demonstrating the use of [Redux](http://redux.js.org/), [D3](https://github.com/mbostock/d3), [socket io](https://github.com/socketio), [Google Charts](https://developers.google.com/chart/), and [RxJs](https://github.com/Reactive-Extensions/RxJS). 38 | - https://github.com/tiagomapmarques/angular2-seed-phaser/tree/releases - integration with [Phaser](http://phaser.io/). 39 | - https://github.com/vyakymenko/angular2-seed-express - integration with [Express](https://expressjs.com/) full-stack development. 40 | - https://github.com/UIUXEngineering/angular2-jspm-typescript-seed - integration with [JSPM](http://jspm.io/). 41 | 42 | # More information 43 | 44 | More information on how to use Highcharts check the [highcharts website](http://www.highcharts.com). 45 | More information on how to use this project configurations and/or options of build, check the [seed project](https://github.com/mgechev/angular2-seed) 46 | 47 | # Change Log 48 | 49 | You can follow the [Angular 2 change log here](https://github.com/angular/angular/blob/master/CHANGELOG.md). 50 | You can follow the [Seed watching the seed project](https://github.com/mgechev/angular2-seed). 51 | 52 | # License 53 | 54 | MIT 55 | 56 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | # AppVeyor file 2 | # http://www.appveyor.com/docs/appveyor-yml 3 | # This file: cloned from https://github.com/gruntjs/grunt/blob/master/appveyor.yml 4 | 5 | # Build version format 6 | version: "{build}" 7 | 8 | # Test against this version of Node.js 9 | environment: 10 | nodejs_version: "Stable" 11 | # https://github.com/DefinitelyTyped/tsd#tsdrc 12 | # Token has no scope (read-only access to public information) 13 | TSD_GITHUB_TOKEN: "9b18c72997769f3867ef2ec470e626d39661795d" 14 | 15 | build: off 16 | 17 | clone_depth: 10 18 | 19 | # Fix line endings on Windows 20 | init: 21 | - git config --global core.autocrlf true 22 | 23 | install: 24 | - ps: Install-Product node $env:nodejs_version 25 | - npm install -g npm 26 | - ps: $env:path = $env:appdata + "\npm;" + $env:path 27 | - npm install && npm install karma-ie-launcher 28 | 29 | test_script: 30 | # Output useful info for debugging. 31 | - node --version && npm --version 32 | # We test multiple Windows shells because of prior stdout buffering issues 33 | # filed against Grunt. https://github.com/joyent/node/issues/3584 34 | - ps: "npm --version # PowerShell" # Pass comment to PS for easier debugging 35 | - npm run tests.all 36 | 37 | notifications: 38 | - provider: Webhook 39 | url: https://webhooks.gitter.im/e/cfd8ce5ddee6f3a0b0c9 40 | on_build_success: false 41 | on_build_failure: true 42 | on_build_status_changed: true 43 | 44 | cache: node_modules 45 | -------------------------------------------------------------------------------- /gulpfile.ts: -------------------------------------------------------------------------------- 1 | import * as gulp from 'gulp'; 2 | import * as util from 'gulp-util'; 3 | import * as runSequence from 'run-sequence'; 4 | 5 | import { PROJECT_TASKS_DIR, SEED_TASKS_DIR } from './tools/config'; 6 | import { loadTasks } from './tools/utils'; 7 | 8 | 9 | loadTasks(SEED_TASKS_DIR); 10 | loadTasks(PROJECT_TASKS_DIR); 11 | 12 | 13 | // -------------- 14 | // Build dev. 15 | gulp.task('build.dev', (done: any) => 16 | runSequence(//'clean.dev', 17 | // 'tslint', 18 | // 'css-lint', 19 | 'build.assets.dev', 20 | 'build.html_css', 21 | 'build.js.dev', 22 | 'build.index.dev', 23 | done)); 24 | 25 | // -------------- 26 | // Build dev watch. 27 | gulp.task('build.dev.watch', (done: any) => 28 | runSequence('build.dev', 29 | 'watch.dev', 30 | done)); 31 | 32 | // -------------- 33 | // Build e2e. 34 | gulp.task('build.e2e', (done: any) => 35 | runSequence('clean.dev', 36 | 'tslint', 37 | 'build.assets.dev', 38 | 'build.js.e2e', 39 | 'build.index.dev', 40 | done)); 41 | 42 | // -------------- 43 | // Build prod. 44 | gulp.task('build.prod', (done: any) => 45 | runSequence('clean.prod', 46 | 'tslint', 47 | 'css-lint', 48 | 'build.assets.prod', 49 | 'build.html_css', 50 | 'copy.prod', 51 | 'compile.ahead.prod', 52 | 'build.js.prod', 53 | 'build.bundles', 54 | 'build.bundles.app', 55 | 'minify.bundles', 56 | 'build.index.prod', 57 | done)); 58 | 59 | // -------------- 60 | // Build test. 61 | gulp.task('build.test', (done: any) => 62 | runSequence('clean.once', 63 | 'tslint', 64 | 'build.assets.dev', 65 | 'build.html_css', 66 | 'build.js.dev', 67 | 'build.js.test', 68 | 'build.index.dev', 69 | done)); 70 | 71 | // -------------- 72 | // Build test watch. 73 | gulp.task('test.watch', (done: any) => 74 | runSequence('build.test', 75 | 'watch.test', 76 | 'karma.watch', 77 | done)); 78 | 79 | // -------------- 80 | // Build tools. 81 | gulp.task('build.tools', (done: any) => 82 | runSequence('clean.tools', 83 | 'build.js.tools', 84 | done)); 85 | 86 | // -------------- 87 | // Docs 88 | // gulp.task('docs', (done: any) => 89 | // runSequence('build.docs', 90 | // 'serve.docs', 91 | // done)); 92 | 93 | // -------------- 94 | // Serve dev 95 | gulp.task('serve.dev', (done: any) => 96 | runSequence('build.dev', 97 | 'server.start', 98 | 'watch.dev', 99 | done)); 100 | 101 | // -------------- 102 | // Serve e2e 103 | gulp.task('serve.e2e', (done: any) => 104 | runSequence('build.e2e', 105 | 'server.start', 106 | 'watch.e2e', 107 | done)); 108 | 109 | 110 | // -------------- 111 | // Serve prod 112 | gulp.task('serve.prod', (done: any) => 113 | runSequence('build.prod', 114 | 'server.prod', 115 | done)); 116 | 117 | 118 | // -------------- 119 | // Test. 120 | gulp.task('test', (done: any) => 121 | runSequence('build.test', 122 | 'karma.run', 123 | done)); 124 | 125 | // -------------- 126 | // Clean dev/coverage that will only run once 127 | // this prevents karma watchers from being broken when directories are deleted 128 | let firstRun = true; 129 | gulp.task('clean.once', (done: any) => { 130 | if (firstRun) { 131 | firstRun = false; 132 | runSequence('clean.dev', 'clean.coverage', done); 133 | } else { 134 | util.log('Skipping clean on rebuild'); 135 | done(); 136 | } 137 | }) 138 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration 2 | // Generated on Wed Jul 15 2015 09:44:02 GMT+0200 (Romance Daylight Time) 3 | 'use strict'; 4 | 5 | var argv = require('yargs').argv; 6 | 7 | module.exports = function (config) { 8 | config.set({ 9 | 10 | // base path that will be used to resolve all patterns (eg. files, exclude) 11 | basePath: './', 12 | 13 | 14 | // frameworks to use 15 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter 16 | frameworks: ['jasmine'], 17 | 18 | 19 | // list of files / patterns to load in the browser 20 | files: [ 21 | // Polyfills. 22 | 'node_modules/core-js/client/shim.min.js', 23 | 24 | 'node_modules/traceur/bin/traceur.js', 25 | 26 | // System.js for module loading 27 | 'node_modules/systemjs/dist/system.src.js', 28 | 29 | // Zone.js dependencies 30 | 'node_modules/zone.js/dist/zone.js', 31 | 'node_modules/zone.js/dist/long-stack-trace-zone.js', 32 | 'node_modules/zone.js/dist/async-test.js', 33 | 'node_modules/zone.js/dist/fake-async-test.js', 34 | 'node_modules/zone.js/dist/sync-test.js', 35 | 'node_modules/zone.js/dist/proxy.js', 36 | 'node_modules/zone.js/dist/jasmine-patch.js', 37 | 38 | // RxJs. 39 | { pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false }, 40 | { pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false }, 41 | 42 | // paths loaded via module imports 43 | // Angular itself 44 | { pattern: 'node_modules/@angular/**/*.js', included: false, watched: true }, 45 | { pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false }, 46 | 47 | { pattern: 'dist/dev/**/*.js', included: false, watched: true }, 48 | { pattern: 'dist/dev/**/*.html', included: false, watched: true, served: true }, 49 | { pattern: 'dist/dev/**/*.css', included: false, watched: true, served: true }, 50 | { pattern: 'node_modules/systemjs/dist/system-polyfills.js', included: false, watched: false }, // PhantomJS2 (and possibly others) might require it 51 | 52 | // suppress annoying 404 warnings for resources, images, etc. 53 | { pattern: 'dist/dev/assets/**/*', watched: false, included: false, served: true }, 54 | 55 | 'test-config.js', 56 | 'dist/dev/app/system-config.js', 57 | 'test-main.js' 58 | ], 59 | 60 | // must go along with above, suppress annoying 404 warnings. 61 | proxies: { 62 | '/assets/': '/base/dist/dev/assets/' 63 | }, 64 | 65 | // list of files to exclude 66 | exclude: [ 67 | 'node_modules/**/*spec.js' 68 | ], 69 | 70 | 71 | // preprocess matching files before serving them to the browser 72 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 73 | 74 | // test results reporter to use 75 | // possible values: 'dots', 'progress' 76 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter 77 | reporters: ['mocha'], 78 | 79 | 80 | // web server port 81 | port: 9876, 82 | 83 | 84 | // enable / disable colors in the output (reporters and logs) 85 | colors: true, 86 | 87 | 88 | // level of logging 89 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 90 | logLevel: config.LOG_INFO, 91 | 92 | 93 | // enable / disable watching file and executing tests whenever any file changes 94 | autoWatch: true, 95 | 96 | 97 | // start these browsers 98 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 99 | browsers: [ 100 | 'Chrome' 101 | ], 102 | 103 | 104 | customLaunchers: { 105 | Chrome_travis_ci: { 106 | base: 'Chrome', 107 | flags: ['--no-sandbox'] 108 | } 109 | }, 110 | 111 | // Continuous Integration mode 112 | // if true, Karma captures browsers, runs the tests and exits 113 | singleRun: false, 114 | 115 | // Passing command line arguments to tests 116 | client: { 117 | files: argv.files 118 | } 119 | }); 120 | 121 | if (process.env.APPVEYOR) { 122 | config.browsers = ['IE']; 123 | config.singleRun = true; 124 | config.browserNoActivityTimeout = 90000; // Note: default value (10000) is not enough 125 | } 126 | 127 | if (process.env.TRAVIS || process.env.CIRCLECI) { 128 | config.browsers = ['Chrome_travis_ci']; 129 | config.singleRun = true; 130 | config.browserNoActivityTimeout = 90000; 131 | } 132 | }; 133 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular2-seed", 3 | "version": "0.0.0", 4 | "description": "Modular seed project for Angular 2 apps with fast, statically typed build", 5 | "repository": { 6 | "url": "https://github.com/mgechev/angular2-seed" 7 | }, 8 | "scripts": { 9 | "build.dev": "gulp build.dev --color --config-env dev", 10 | "build.dev.watch": "gulp build.dev.watch --color", 11 | "build.e2e": "gulp build.e2e --color", 12 | "build.prod": "gulp build.prod --color --config-env prod", 13 | "build.test": "gulp build.test --color", 14 | "test.watch": "gulp test.watch --color", 15 | "generate.manifest": "gulp generate.manifest --color", 16 | "e2e": "protractor", 17 | "e2e.live": "protractor --elementExplorer", 18 | "gulp": "gulp", 19 | "karma": "karma", 20 | "karma.start": "karma start", 21 | "postinstall": "typings install && gulp check.versions && npm prune && gulp webdriver", 22 | "reinstall": "npm cache clean && npm install", 23 | "serve.coverage": "remap-istanbul -b src/ -i coverage/coverage-final.json -o coverage -t html && npm run gulp -- serve.coverage --color", 24 | "serve.dev": "gulp serve.dev --color --config-env dev", 25 | "serve.e2e": "gulp serve.e2e --color", 26 | "serve.prod": "gulp serve.prod --color --config-env prod", 27 | "start": "gulp serve.dev --color", 28 | "tasks.list": "gulp --tasks-simple --color", 29 | "test": "gulp test --color", 30 | "e2e.ci": "gulp build.prod --color && gulp build.js.e2e --color && gulp e2e --color", 31 | "tests.all": "npm test && npm run e2e.ci", 32 | "webdriver-start": "webdriver-manager start", 33 | "webdriver-update": "webdriver-manager update" 34 | }, 35 | "author": "Minko Gechev ", 36 | "license": "MIT", 37 | "devDependencies": { 38 | "@angular/compiler-cli": "^0.6.0", 39 | "@angular/platform-server": "^2.0.0-rc.6", 40 | "@angular/tsc-wrapped": "^0.3.0", 41 | "async": "^2.0.0", 42 | "autoprefixer": "^6.3.7", 43 | "browser-sync": "^2.13.0", 44 | "codelyzer": "0.0.25", 45 | "colorguard": "^1.2.0", 46 | "compression": "^1.6.2", 47 | "connect": "^3.4.1", 48 | "connect-history-api-fallback": "^1.2.0", 49 | "connect-livereload": "^0.5.4", 50 | "cssnano": "^3.7.3", 51 | "deep-extend": "^0.4.1", 52 | "doiuse": "^2.4.1", 53 | "event-stream": "^3.3.3", 54 | "express": "~4.14.0", 55 | "express-history-api-fallback": "^2.0.0", 56 | "extend": "^3.0.0", 57 | "gulp": "^3.9.1", 58 | "gulp-cached": "^1.1.0", 59 | "gulp-clean-css": "^2.0.11", 60 | "gulp-concat": "^2.6.0", 61 | "gulp-concat-css": "^2.3.0", 62 | "gulp-filter": "^4.0.0", 63 | "gulp-inject": "^4.1.0", 64 | "gulp-load-plugins": "^1.2.4", 65 | "gulp-plumber": "~1.1.0", 66 | "gulp-postcss": "^6.1.1", 67 | "gulp-progeny": "^0.3.1", 68 | "gulp-protractor": "^2.4.0", 69 | "gulp-replace": "^0.5.4", 70 | "gulp-sass": "^2.3.2", 71 | "gulp-sass-lint": "^1.2.0", 72 | "gulp-sourcemaps": "2.0.0-alpha", 73 | "gulp-template": "^4.0.0", 74 | "gulp-tslint": "^6.0.1", 75 | "gulp-typescript": "^2.13.6", 76 | "gulp-uglify": "^2.0.0", 77 | "gulp-util": "^3.0.7", 78 | "gulp-watch": "^4.3.8", 79 | "is-ci": "^1.0.9", 80 | "isstream": "^0.1.2", 81 | "jasmine-core": "~2.4.1", 82 | "jasmine-spec-reporter": "^2.5.0", 83 | "karma": "~0.13.22", 84 | "karma-chrome-launcher": "~1.0.1", 85 | "karma-coverage": "^1.1.0", 86 | "karma-jasmine": "~1.0.2", 87 | "karma-mocha-reporter": "^2.0.4", 88 | "merge-stream": "^1.0.0", 89 | "open": "0.0.5", 90 | "postcss-reporter": "^1.4.1", 91 | "protractor": "^3.3.0", 92 | "remap-istanbul": "^0.6.4", 93 | "rimraf": "^2.5.3", 94 | "run-sequence": "^1.2.2", 95 | "semver": "^5.3.0", 96 | "serve-static": "^1.11.1", 97 | "slash": "~1.0.0", 98 | "stream-series": "^0.1.1", 99 | "stylelint": "^7.0.2", 100 | "stylelint-config-standard": "^11.0.0", 101 | "systemjs-builder": "0.15.14", 102 | "tildify": "^1.2.0", 103 | "tiny-lr": "^0.2.1", 104 | "traceur": "^0.0.111", 105 | "ts-node": "^1.0.0", 106 | "tslint": "^3.13.0", 107 | "tslint-stylish": "2.1.0-beta", 108 | "typescript": "^2.0.2", 109 | "typings": "^1.3.1", 110 | "vinyl-buffer": "^1.0.0", 111 | "vinyl-source-stream": "^1.1.0", 112 | "walk": "^2.3.9", 113 | "yargs": "^4.8.0" 114 | }, 115 | "dependencies": { 116 | "@angular/common": "2.0.0-rc.6", 117 | "@angular/compiler": "2.0.0-rc.6", 118 | "@angular/core": "2.0.0-rc.6", 119 | "@angular/forms": "2.0.0-rc.6", 120 | "@angular/http": "2.0.0-rc.6", 121 | "@angular/platform-browser": "2.0.0-rc.6", 122 | "@angular/platform-browser-dynamic": "2.0.0-rc.6", 123 | "@angular/router": "3.0.0-rc.2", 124 | "core-js": "^2.4.0", 125 | "es6-module-loader": "^0.17.8", 126 | "highcharts": "^4.2.3", 127 | "ng2-highcharts": "^0.4.0", 128 | "reflect-metadata": "^0.1.8", 129 | "rxjs": "5.0.0-beta.11", 130 | "systemjs": "0.19.27", 131 | "zone.js": "0.6.17" 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /protractor.conf.js: -------------------------------------------------------------------------------- 1 | const config = { 2 | baseUrl: 'http://localhost:5555/', 3 | 4 | specs: [ 5 | './dist/dev/**/*.e2e-spec.js' 6 | ], 7 | 8 | exclude: [], 9 | 10 | // 'jasmine' by default will use the latest jasmine framework 11 | framework: 'jasmine', 12 | 13 | // allScriptsTimeout: 110000, 14 | 15 | jasmineNodeOpts: { 16 | // showTiming: true, 17 | showColors: true, 18 | isVerbose: false, 19 | includeStackTrace: false, 20 | // defaultTimeoutInterval: 400000 21 | }, 22 | 23 | directConnect: true, 24 | 25 | capabilities: { 26 | browserName: 'chrome' 27 | }, 28 | 29 | onPrepare: function() { 30 | const SpecReporter = require('jasmine-spec-reporter'); 31 | // add jasmine spec reporter 32 | jasmine.getEnv().addReporter(new SpecReporter({ displayStacktrace: true })); 33 | 34 | browser.ignoreSynchronization = false; 35 | }, 36 | 37 | 38 | /** 39 | * Angular 2 configuration 40 | * 41 | * useAllAngular2AppRoots: tells Protractor to wait for any angular2 apps on the page instead of just the one matching 42 | * `rootEl` 43 | */ 44 | useAllAngular2AppRoots: true 45 | }; 46 | 47 | if (process.env.TRAVIS) { 48 | config.capabilities = { 49 | browserName: 'firefox' 50 | }; 51 | } 52 | 53 | exports.config = config; 54 | -------------------------------------------------------------------------------- /src/client/app/about/about.component.css: -------------------------------------------------------------------------------- 1 | :host { 2 | display: block; 3 | padding: 0 16px; 4 | } 5 | 6 | h2 { 7 | font-size: 20px; 8 | font-weight: 500; 9 | letter-spacing: 0.005em; 10 | margin-bottom: 0; 11 | margin-top: 0.83em; 12 | } 13 | -------------------------------------------------------------------------------- /src/client/app/about/about.component.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | describe('About', () => { 2 | 3 | beforeEach( () => { 4 | browser.get('/about'); 5 | }); 6 | 7 | it('should have correct feature heading', () => { 8 | expect(element(by.css('sd-about h2')).getText()).toEqual('Features'); 9 | }); 10 | 11 | }); 12 | -------------------------------------------------------------------------------- /src/client/app/about/about.component.html: -------------------------------------------------------------------------------- 1 |

2 | Angular 2 Seed is a starter project that implements best practices in 3 | coding, building and testing Angular 2 apps. 4 |

5 | 6 |

Features

7 | 16 | -------------------------------------------------------------------------------- /src/client/app/about/about.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { 3 | async, 4 | TestBed 5 | } from '@angular/core/testing'; 6 | 7 | import { AboutModule } from './about.module'; 8 | 9 | export function main() { 10 | describe('About component', () => { 11 | // Setting module for testing 12 | // Disable old forms 13 | 14 | beforeEach(() => { 15 | TestBed.configureTestingModule({ 16 | declarations: [TestComponent], 17 | imports: [AboutModule] 18 | }); 19 | }); 20 | 21 | it('should work', 22 | async(() => { 23 | TestBed 24 | .compileComponents() 25 | .then(() => { 26 | let fixture = TestBed.createComponent(TestComponent); 27 | let aboutDOMEl = fixture.debugElement.children[0].nativeElement; 28 | 29 | expect(aboutDOMEl.querySelectorAll('h2')[0].textContent).toEqual('Features'); 30 | }); 31 | })); 32 | }); 33 | } 34 | 35 | @Component({ 36 | selector: 'test-cmp', 37 | template: '' 38 | }) 39 | class TestComponent {} 40 | -------------------------------------------------------------------------------- /src/client/app/about/about.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | /** 4 | * This class represents the lazy loaded AboutComponent. 5 | */ 6 | @Component({ 7 | moduleId: module.id, 8 | selector: 'sd-about', 9 | templateUrl: 'about.component.html', 10 | styleUrls: ['about.component.css'] 11 | }) 12 | export class AboutComponent { } 13 | -------------------------------------------------------------------------------- /src/client/app/about/about.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { AboutComponent } from './about.component'; 4 | 5 | @NgModule({ 6 | imports: [CommonModule], 7 | declarations: [AboutComponent], 8 | exports: [AboutComponent] 9 | }) 10 | 11 | export class AboutModule { } 12 | -------------------------------------------------------------------------------- /src/client/app/about/about.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | import { AboutComponent } from './index'; 3 | 4 | export const AboutRoutes: Route[] = [ 5 | { 6 | path: 'about', 7 | component: AboutComponent 8 | } 9 | ]; 10 | -------------------------------------------------------------------------------- /src/client/app/about/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This barrel file provides the export for the lazy loaded AboutComponent. 3 | */ 4 | export * from './about.component'; 5 | export * from './about.routes'; 6 | -------------------------------------------------------------------------------- /src/client/app/app.component.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | describe('App', () => { 2 | 3 | beforeEach( () => { 4 | browser.get('/'); 5 | }); 6 | 7 | it('should have a title', () => { 8 | expect(browser.getTitle()).toEqual('Welcome to angular2-seed!'); 9 | }); 10 | 11 | it('should have