├── src ├── assets │ ├── css │ │ └── .gitkeep │ ├── robots.txt │ ├── service-worker.js │ ├── icon │ │ ├── favicon.ico │ │ ├── apple-icon.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-96x96.png │ │ ├── ms-icon-144x144.png │ │ ├── ms-icon-150x150.png │ │ ├── ms-icon-310x310.png │ │ ├── ms-icon-70x70.png │ │ ├── apple-icon-57x57.png │ │ ├── apple-icon-60x60.png │ │ ├── apple-icon-72x72.png │ │ ├── apple-icon-76x76.png │ │ ├── android-icon-144x144.png │ │ ├── android-icon-192x192.png │ │ ├── android-icon-36x36.png │ │ ├── android-icon-48x48.png │ │ ├── android-icon-72x72.png │ │ ├── android-icon-96x96.png │ │ ├── apple-icon-114x114.png │ │ ├── apple-icon-120x120.png │ │ ├── apple-icon-144x144.png │ │ ├── apple-icon-152x152.png │ │ ├── apple-icon-180x180.png │ │ ├── apple-icon-precomposed.png │ │ └── browserconfig.xml │ ├── img │ │ ├── angular-logo.png │ │ └── angularclass-logo.png │ ├── humans.txt │ └── manifest.json ├── app │ ├── Home.ts │ ├── Users.ts │ ├── UserFollowers.ts │ ├── UserDetail.ts │ └── app.ts ├── main.ts ├── vendor.ts └── index.html ├── test ├── sanity-test.spec.ts ├── injector.spec.ts └── app │ └── app.e2e.js ├── .editorconfig ├── typedoc.json ├── tsconfig.json ├── protractor.conf.js ├── .gitignore ├── typings.json ├── LICENSE ├── tslint.json ├── README.md ├── spec-bundle.js ├── karma.conf.js ├── webpack.test.config.js ├── webpack.config.js ├── package.json └── webpack.prod.config.js /src/assets/css/.gitkeep: -------------------------------------------------------------------------------- 1 | @AngularClass 2 | -------------------------------------------------------------------------------- /src/assets/robots.txt: -------------------------------------------------------------------------------- 1 | # robotstxt.org 2 | 3 | User-agent: * 4 | -------------------------------------------------------------------------------- /src/assets/service-worker.js: -------------------------------------------------------------------------------- 1 | // This file is intentionally without code. 2 | -------------------------------------------------------------------------------- /src/assets/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/favicon.ico -------------------------------------------------------------------------------- /src/assets/icon/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/apple-icon.png -------------------------------------------------------------------------------- /src/assets/img/angular-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/img/angular-logo.png -------------------------------------------------------------------------------- /src/assets/icon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/favicon-16x16.png -------------------------------------------------------------------------------- /src/assets/icon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/favicon-32x32.png -------------------------------------------------------------------------------- /src/assets/icon/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/favicon-96x96.png -------------------------------------------------------------------------------- /src/assets/icon/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/ms-icon-144x144.png -------------------------------------------------------------------------------- /src/assets/icon/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/ms-icon-150x150.png -------------------------------------------------------------------------------- /src/assets/icon/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/ms-icon-310x310.png -------------------------------------------------------------------------------- /src/assets/icon/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/ms-icon-70x70.png -------------------------------------------------------------------------------- /src/assets/icon/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/apple-icon-57x57.png -------------------------------------------------------------------------------- /src/assets/icon/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/apple-icon-60x60.png -------------------------------------------------------------------------------- /src/assets/icon/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/apple-icon-72x72.png -------------------------------------------------------------------------------- /src/assets/icon/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/apple-icon-76x76.png -------------------------------------------------------------------------------- /src/assets/img/angularclass-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/img/angularclass-logo.png -------------------------------------------------------------------------------- /src/assets/icon/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/android-icon-144x144.png -------------------------------------------------------------------------------- /src/assets/icon/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/android-icon-192x192.png -------------------------------------------------------------------------------- /src/assets/icon/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/android-icon-36x36.png -------------------------------------------------------------------------------- /src/assets/icon/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/android-icon-48x48.png -------------------------------------------------------------------------------- /src/assets/icon/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/android-icon-72x72.png -------------------------------------------------------------------------------- /src/assets/icon/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/android-icon-96x96.png -------------------------------------------------------------------------------- /src/assets/icon/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/apple-icon-114x114.png -------------------------------------------------------------------------------- /src/assets/icon/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/apple-icon-120x120.png -------------------------------------------------------------------------------- /src/assets/icon/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/apple-icon-144x144.png -------------------------------------------------------------------------------- /src/assets/icon/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/apple-icon-152x152.png -------------------------------------------------------------------------------- /src/assets/icon/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/apple-icon-180x180.png -------------------------------------------------------------------------------- /src/assets/icon/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/auth0-blog/angular2-routing/HEAD/src/assets/icon/apple-icon-precomposed.png -------------------------------------------------------------------------------- /src/app/Home.ts: -------------------------------------------------------------------------------- 1 | import {Component} from 'angular2/core'; 2 | 3 | @Component({ 4 | template: `

Search for a Github user and view their profile

` 5 | }) 6 | 7 | export class Home {} 8 | -------------------------------------------------------------------------------- /src/assets/icon/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | #ffffff -------------------------------------------------------------------------------- /test/sanity-test.spec.ts: -------------------------------------------------------------------------------- 1 | import { 2 | it, 3 | inject, 4 | injectAsync, 5 | beforeEachProviders, 6 | TestComponentBuilder 7 | } from 'angular2/testing'; 8 | 9 | describe('sanity checks', () => { 10 | it('should also be able to test', () => { 11 | expect(true).toBe(true); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /src/assets/humans.txt: -------------------------------------------------------------------------------- 1 | # humanstxt.org/ 2 | # The humans responsible & technology colophon 3 | 4 | # TEAM 5 | 6 | -- -- 7 | 8 | # THANKS 9 | 10 | 11 | PatrickJS -- @gdi2290 12 | AngularClass -- @AngularClass 13 | 14 | # TECHNOLOGY COLOPHON 15 | 16 | HTML5, CSS3 17 | Angular2, TypeScript, Webpack 18 | -------------------------------------------------------------------------------- /test/injector.spec.ts: -------------------------------------------------------------------------------- 1 | import { 2 | it, 3 | inject, 4 | injectAsync, 5 | beforeEachProviders, 6 | TestComponentBuilder 7 | } from 'angular2/testing'; 8 | import {APP_ID} from 'angular2/core'; 9 | 10 | 11 | describe('default test injector', () => { 12 | it('should provide default id', inject([APP_ID], (id) => { 13 | expect(id).toBe('a'); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # @AngularClass 2 | # http://editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | indent_style = space 9 | indent_size = 2 10 | end_of_line = lf 11 | insert_final_newline = true 12 | trim_trailing_whitespace = true 13 | 14 | [*.md] 15 | insert_final_newline = false 16 | trim_trailing_whitespace = false 17 | 18 | [*.json] 19 | insert_final_newline = false 20 | trim_trailing_whitespace = false 21 | -------------------------------------------------------------------------------- /typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "mode": "modules", 3 | "out": "doc", 4 | "theme": "default", 5 | "ignoreCompilerErrors": "true", 6 | "experimentalDecorators": "true", 7 | "emitDecoratorMetadata": "true", 8 | "target": "ES5", 9 | "moduleResolution": "node", 10 | "preserveConstEnums": "true", 11 | "stripInternal": "true", 12 | "suppressExcessPropertyErrors": "true", 13 | "suppressImplicitAnyIndexErrors": "true", 14 | "module": "commonjs" 15 | } 16 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "removeComments": true, 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "noEmitHelpers": false, 9 | "sourceMap": true 10 | }, 11 | "files": [ 12 | "typings/main.d.ts", 13 | "test/injector.spec.ts", 14 | "test/sanity-test.spec.ts", 15 | "src/main.ts", 16 | "src/vendor.ts" 17 | ], 18 | "filesGlob": [ 19 | "./src/**/*.ts", 20 | "./test/**/*.ts", 21 | "!./node_modules/**/*.ts" 22 | ], 23 | "compileOnSave": false, 24 | "buildOnSave": false, 25 | "atom": { "rewriteTsconfig": true } 26 | } 27 | -------------------------------------------------------------------------------- /src/app/Users.ts: -------------------------------------------------------------------------------- 1 | import {Component} from 'angular2/core'; 2 | import {Http} from 'angular2/http'; 3 | import {ROUTER_DIRECTIVES, RouteParams, RouteConfig} from 'angular2/router'; 4 | import {UserDetail} from './UserDetail'; 5 | import {UserFollowers} from './UserFollowers'; 6 | 7 | @Component({ 8 | template: ` 9 |
10 |
11 |

{{userLogin}}

12 |
13 |
14 | 15 |
16 |
17 | `, 18 | directives: [ROUTER_DIRECTIVES] 19 | }) 20 | @RouteConfig([ 21 | { path: '/detail/...', component: UserDetail, name: 'UserDetail', useAsDefault: true } 22 | ]) 23 | export class Users { 24 | userLogin: Object; 25 | 26 | constructor(params: RouteParams) { 27 | this.userLogin = params.get('userLogin'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/assets/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "App", 3 | "icons": [ 4 | { 5 | "src": "/assets/icon/android-icon-36x36.png", 6 | "sizes": "36x36", 7 | "type": "image/png", 8 | "density": 0.75 9 | }, 10 | { 11 | "src": "/assets/icon/android-icon-48x48.png", 12 | "sizes": "48x48", 13 | "type": "image/png", 14 | "density": 1.0 15 | }, 16 | { 17 | "src": "/assets/icon/android-icon-72x72.png", 18 | "sizes": "72x72", 19 | "type": "image/png", 20 | "density": 1.5 21 | }, 22 | { 23 | "src": "/assets/icon/android-icon-96x96.png", 24 | "sizes": "96x96", 25 | "type": "image/png", 26 | "density": 2.0 27 | }, 28 | { 29 | "src": "/assets/icon/android-icon-144x144.png", 30 | "sizes": "144x144", 31 | "type": "image/png", 32 | "density": 3.0 33 | }, 34 | { 35 | "src": "/assets/icon/android-icon-192x192.png", 36 | "sizes": "192x192", 37 | "type": "image/png", 38 | "density": 4.0 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Providers provided by Angular 3 | */ 4 | import {provide} from 'angular2/core'; 5 | import {bootstrap, ELEMENT_PROBE_PROVIDERS} from 'angular2/platform/browser'; 6 | import {ROUTER_PROVIDERS, LocationStrategy, PathLocationStrategy} from 'angular2/router'; 7 | import {HTTP_PROVIDERS} from 'angular2/http'; 8 | 9 | /* 10 | * App Component 11 | * our top level component that holds all of our components 12 | */ 13 | import {App} from './app/app'; 14 | /* 15 | * Bootstrap our Angular app with a top level component `App` and inject 16 | * our Services and Providers into Angular's dependency injection 17 | */ 18 | document.addEventListener('DOMContentLoaded', function main() { 19 | bootstrap(App, [ 20 | ...('production' === process.env.ENV ? [] : ELEMENT_PROBE_PROVIDERS), 21 | ...HTTP_PROVIDERS, 22 | ...ROUTER_PROVIDERS, 23 | provide(LocationStrategy, { useClass: PathLocationStrategy }) 24 | ]) 25 | .catch(err => console.error(err)); 26 | }); 27 | -------------------------------------------------------------------------------- /protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @AngularClass 2 | 3 | exports.config = { 4 | baseUrl: 'http://localhost:3000/', 5 | 6 | specs: [ 7 | 'test/**/*.e2e.js' 8 | ], 9 | exclude: [], 10 | 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 | directConnect: true, 23 | 24 | capabilities: { 25 | 'browserName': 'chrome', 26 | 'chromeOptions': { 27 | 'args': ['show-fps-counter=true'] 28 | } 29 | }, 30 | 31 | onPrepare: function() { 32 | browser.ignoreSynchronization = true; 33 | }, 34 | 35 | 36 | /** 37 | * Angular 2 configuration 38 | * 39 | * useAllAngular2AppRoots: tells Protractor to wait for any angular2 apps on the page instead of just the one matching 40 | * `rootEl` 41 | * 42 | */ 43 | useAllAngular2AppRoots: true 44 | }; 45 | -------------------------------------------------------------------------------- /src/vendor.ts: -------------------------------------------------------------------------------- 1 | // Polyfills 2 | import 'es6-shim'; 3 | // (these modules are what are in 'angular2/bundles/angular2-polyfills' so don't use that here) 4 | import 'es6-promise'; 5 | import 'zone.js/lib/browser/zone-microtask'; 6 | 7 | if ('production' !== process.env.ENV) { 8 | // Reflect Polyfill 9 | require('es7-reflect-metadata/dist/browser'); 10 | Error['stackTraceLimit'] = Infinity; 11 | Zone['longStackTraceZone'] = require('zone.js/lib/zones/long-stack-trace.js'); 12 | } 13 | 14 | if ('production' === process.env.ENV) { 15 | // Reflect with es7-reflect-metadata/reflect-metadata is added 16 | // by webpack.prod.config ProvidePlugin 17 | let ngCore = require('angular2/core'); 18 | ngCore.enableProdMode(); 19 | } 20 | // Angular 2 21 | import 'angular2/platform/browser'; 22 | import 'angular2/platform/common_dom'; 23 | import 'angular2/router'; 24 | import 'angular2/http'; 25 | import 'angular2/core'; 26 | 27 | // RxJS 28 | import 'rxjs'; 29 | 30 | // Other vendors for example jQuery, Lodash, angular2-jwt 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # @AngularClass 2 | 3 | # Logs 4 | logs 5 | *.log 6 | 7 | # Runtime data 8 | pids 9 | *.pid 10 | *.seed 11 | 12 | # Directory for instrumented libs generated by jscoverage/JSCover 13 | lib-cov 14 | 15 | # Coverage directory used by tools like istanbul 16 | coverage 17 | 18 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 19 | .grunt 20 | 21 | # Compiled binary addons (http://nodejs.org/api/addons.html) 22 | build/Release 23 | 24 | # Users Environment Variables 25 | .lock-wscript 26 | 27 | # OS generated files # 28 | .DS_Store 29 | ehthumbs.db 30 | Icon? 31 | Thumbs.db 32 | 33 | # Node Files # 34 | /node_modules 35 | /bower_components 36 | 37 | # Coverage # 38 | /coverage/ 39 | 40 | # Typing # 41 | /src/typings/tsd/ 42 | /typings/ 43 | /tsd_typings/ 44 | 45 | # Dist # 46 | /dist 47 | /public/__build__/ 48 | /src/*/__build__/ 49 | /__build__/** 50 | /public/dist/ 51 | /src/*/dist/ 52 | /dist/** 53 | .webpack.json 54 | 55 | # Doc # 56 | /doc/ 57 | 58 | # IDE # 59 | .idea/ 60 | *.swp 61 | -------------------------------------------------------------------------------- /test/app/app.e2e.js: -------------------------------------------------------------------------------- 1 | /* 2 | * TODO: ES5 for now until I make a webpack plugin for protractor 3 | */ 4 | describe('App', function() { 5 | 6 | beforeEach(function() { 7 | browser.get('/'); 8 | }); 9 | 10 | 11 | it('should have a title', function() { 12 | var subject = browser.getTitle(); 13 | var result = 'Angular2 Webpack Starter by @gdi2990 from @AngularClass'; 14 | expect(subject).toEqual(result); 15 | }); 16 | 17 | it('should have
', function() { 18 | var subject = element(by.deepCss('app /deep/ header')).isPresent(); 19 | var result = true; 20 | expect(subject).toEqual(result); 21 | }); 22 | 23 | it('should have
', function() { 24 | var subject = element(by.deepCss('app /deep/ main')).isPresent(); 25 | var result = true; 26 | expect(subject).toEqual(result); 27 | }); 28 | 29 | it('should have