├── .gitignore ├── README.md ├── gulpfile.js ├── package.json ├── public ├── dist │ ├── angular2.js │ └── angular2.js.map ├── es6-module-loader@0.16.6.js ├── index.html ├── system.js └── traceur-runtime.js ├── scripts └── src │ ├── angular2.temp.d.ts │ ├── bootstrap.ts │ ├── components │ ├── about │ │ └── about.ts │ ├── app │ │ ├── app.html │ │ └── app.ts │ ├── home │ │ └── home.ts │ └── sidebar │ │ ├── sidebar.html │ │ └── sidebar.ts │ ├── directives │ └── tooltip.ts │ ├── services │ └── dummyService.ts │ └── settings.ts ├── server.js ├── tsconfig.json └── tsd.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | typings 3 | scripts/build 4 | scripts/maps 5 | public/scripts/ 6 | public/jspm_packages/ 7 | *.log 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Angular2 Starter [![Join the chat at https://gitter.im/EladRK/angular-starter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/EladRK/angular-starter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 2 | 3 | A starter template for Angular2 applications. 4 | 5 | > This starter uses [gulp.js](http://gulpjs.com/) for a build workflow. 6 | 7 | ## Dependencies 8 | 9 | All you need to run this starter is [node.js](https://nodejs.org/) installed. And you should also have following NPM packages installed globally: 10 | 11 | - gulp (npm install -g gulp) 12 | - tsd (npm install -g tsd) 13 | 14 | ## Installation 15 | * Clone this repository 16 | 17 | * `$ tsd install` 18 | * `$ npm start` 19 | 20 | ## Creators 21 | 22 | **Elad Katz** 23 | 24 | - 25 | - 26 | 27 | **Dima Kuzmich** 28 | 29 | - 30 | - 31 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var ts = require('gulp-typescript'); 3 | var typescript = require('typescript'); 4 | var del = require('del'); 5 | var runSequence = require('run-sequence'); 6 | var sourcemaps = require('gulp-sourcemaps'); 7 | var connect = require('gulp-connect'); 8 | var open = require('gulp-open'); 9 | var express = require('gulp-express'); 10 | 11 | var serverOptions = { 12 | root: 'public', 13 | port: 8000, 14 | livereload: true, 15 | }; 16 | 17 | var tasks = { 18 | 'default': 'default', 19 | cleanAll : 'Clean-All', 20 | typeScript: 'TypeScript-Compile', 21 | html: 'Copy-HTML', 22 | copy: 'Copy-Compiled-JS', 23 | cleanSrc: 'Clean-Source', 24 | cleanPublic: 'Clean-Public', 25 | startWebServer: 'Start-WebServer', 26 | openBrowser: 'Open-Browser', 27 | watch: 'Watch', 28 | watcherRebuild: 'Watcher-Rebuild' 29 | }; 30 | 31 | // Main task 32 | gulp.task(tasks.default, function () { 33 | runSequence(tasks.cleanAll, 34 | tasks.typeScript, 35 | tasks.html, 36 | tasks.copy, 37 | tasks.cleanSrc, 38 | tasks.startWebServer, 39 | tasks.openBrowser, 40 | tasks.watch); 41 | }); 42 | 43 | // default task starts watcher. in order not to start it each change 44 | // watcher will run the task bellow 45 | gulp.task(tasks.watcherRebuild, function (callback) { 46 | runSequence( 47 | tasks.cleanPublic, 48 | tasks.typeScript, 49 | tasks.html, 50 | tasks.copy, 51 | tasks.cleanSrc); 52 | callback(); 53 | }); 54 | 55 | // compiles *.ts files by tsconfig.json file and creates sourcemap filse 56 | gulp.task(tasks.typeScript, function () { 57 | var tsProject = ts.createProject('tsconfig.json', { 58 | typescript: typescript 59 | }); 60 | 61 | return gulp.src(['typings/**/**.ts', 'scripts/src/**/**.ts']) 62 | .pipe(sourcemaps.init()) 63 | .pipe(ts(tsProject)) 64 | .pipe(sourcemaps.write('../maps', { includeContent: false, sourceRoot: '/scripts/src' })) 65 | .pipe(gulp.dest('scripts/build')); 66 | }); 67 | 68 | // copy *.html files (templates of components) 69 | // to apropriate directory under public/scripts 70 | gulp.task(tasks.html, function () { 71 | return gulp.src(['scripts/src/**/**.html']) 72 | .pipe(gulp.dest('scripts/build')); 73 | }); 74 | 75 | // copy generated/compiled files 76 | // from scripts/ directory to public/scripts directory 77 | gulp.task(tasks.copy, function () { 78 | return gulp.src(['scripts/**/*.*'], { base: "." }) 79 | .pipe(gulp.dest('public')) 80 | .pipe(connect.reload()); 81 | }); 82 | 83 | // clean all generated/compiled files 84 | // in both scripts/ and public/scripts/ directories 85 | gulp.task(tasks.cleanAll, function () { 86 | return runSequence(tasks.cleanSrc, tasks.cleanPublic); 87 | }); 88 | 89 | // clean all generated/compiled files 90 | // only in public/scripts/ directory 91 | gulp.task(tasks.cleanPublic, function () { 92 | return del(['public/scripts']); 93 | }); 94 | 95 | // clean all generated/compiled files 96 | // only in both scripts/ directory 97 | gulp.task(tasks.cleanSrc, function () { 98 | return del(['scripts/build', 'scripts/maps']); 99 | }); 100 | 101 | // watcher 102 | gulp.task(tasks.watch, function () { 103 | gulp.watch(['scripts/src/**/**.ts', 'scripts/src/**/**.html'], [tasks.watcherRebuild]); 104 | }); 105 | 106 | // starts web server 107 | gulp.task(tasks.startWebServer, function () { 108 | //connect.server(serverOptions); 109 | return express.run([ 110 | 'server.js' 111 | ]); 112 | }); 113 | 114 | gulp.task(tasks.openBrowser, function () { 115 | gulp.src('public/index.html') 116 | .pipe(open('', { url: 'http://localhost:' + serverOptions.port })); 117 | }); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-starter", 3 | "version": "1.0.0", 4 | "description": "angular 2 quick start", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "npm install && gulp" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/EladRK/angular-starter.git" 13 | }, 14 | "author": "Elad Katz", 15 | "license": "ISC", 16 | "bugs": { 17 | "url": "https://github.com/EladRK/angular-starter/issues" 18 | }, 19 | "homepage": "https://github.com/EladRK/angular-starter", 20 | "dependencies": { 21 | "bootstrap": "^3.3.4" 22 | }, 23 | "devDependencies": { 24 | "body-parser": "^1.10.1", 25 | "connect-livereload": "^0.5.3", 26 | "del": "^1.2.0", 27 | "express": "^4.10.6", 28 | "gulp": "^3.9.0", 29 | "gulp-connect": "^2.2.0", 30 | "gulp-express": "^0.1.4", 31 | "gulp-open": "^0.3.2", 32 | "gulp-sourcemaps": "^1.5.2", 33 | "gulp-typescript": "^2.7.6", 34 | "run-sequence": "^1.1.0", 35 | "typescript": "^1.5.0-beta", 36 | "underscore": "^1.8.3" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /public/es6-module-loader@0.16.6.js: -------------------------------------------------------------------------------- 1 | !function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.Promise=e():"undefined"!=typeof global?global.Promise=e():"undefined"!=typeof self&&(self.Promise=e())}(function(){var e;return function t(e,n,o){function r(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);throw new Error("Cannot find module '"+a+"'")}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return r(n?n:t)},l,l.exports,t,e,n,o)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a=0&&(p.splice(t,1),d("Handled previous rejection ["+e.id+"] "+r.formatObject(e.value)))}function s(e,t){f.push(e,t),null===h&&(h=o(u,0))}function u(){for(h=null;f.length>0;)f.shift()(f.shift())}var l,c=n,d=n;"undefined"!=typeof console&&(l=console,c="undefined"!=typeof l.error?function(e){l.error(e)}:function(e){l.log(e)},d="undefined"!=typeof l.info?function(e){l.info(e)}:function(e){l.log(e)}),e.onPotentiallyUnhandledRejection=function(e){s(i,e)},e.onPotentiallyUnhandledRejectionHandled=function(e){s(a,e)},e.onFatalRejection=function(e){s(t,e.value)};var f=[],p=[],h=null;return e}})}("function"==typeof e&&e.amd?e:function(e){n.exports=e(t)})},{"../env":5,"../format":6}],5:[function(t,n){!function(e){"use strict";e(function(e){function t(){return"undefined"!=typeof process&&null!==process&&"function"==typeof process.nextTick}function n(){return"function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver}function o(e){function t(){var e=n;n=void 0,e()}var n,o=document.createTextNode(""),r=new e(t);r.observe(o,{characterData:!0});var i=0;return function(e){n=e,o.data=i^=1}}var r,i="undefined"!=typeof setTimeout&&setTimeout,a=function(e,t){return setTimeout(e,t)},s=function(e){return clearTimeout(e)},u=function(e){return i(e,0)};if(t())u=function(e){return process.nextTick(e)};else if(r=n())u=o(r);else if(!i){var l=e,c=l("vertx");a=function(e,t){return c.setTimer(t,e)},s=c.cancelTimer,u=c.runOnLoop||c.runOnContext}return{setTimer:a,clearTimer:s,asap:u}})}("function"==typeof e&&e.amd?e:function(e){n.exports=e(t)})},{}],6:[function(t,n){!function(e){"use strict";e(function(){function e(e){var n="object"==typeof e&&null!==e&&e.stack?e.stack:t(e);return e instanceof Error?n:n+" (WARNING: non-Error used)"}function t(e){var t=String(e);return"[object Object]"===t&&"undefined"!=typeof JSON&&(t=n(e,t)),t}function n(e,t){try{return JSON.stringify(e)}catch(n){return t}}return{formatError:e,formatObject:t,tryStringify:n}})}("function"==typeof e&&e.amd?e:function(e){n.exports=e()})},{}],7:[function(t,n){!function(e){"use strict";e(function(){return function(e){function t(e,t){this._handler=e===g?t:n(e)}function n(e){function t(e){r.resolve(e)}function n(e){r.reject(e)}function o(e){r.notify(e)}var r=new w;try{e(t,n,o)}catch(i){n(i)}return r}function o(e){return M(e)?e:new t(g,new j(v(e)))}function r(e){return new t(g,new j(new E(e)))}function i(){return Z}function a(){return new t(g,new w)}function s(e,t){var n=new w(e.receiver,e.join().context);return new t(g,n)}function u(e){return c(F,null,e)}function l(e,t){return c(A,e,t)}function c(e,n,o){function r(t,r,a){a.resolved||d(o,i,t,e(n,r,t),a)}function i(e,t,n){c[e]=t,0===--l&&n.become(new O(c))}for(var a,s="function"==typeof n?r:i,u=new w,l=o.length>>>0,c=new Array(l),f=0;f0?t(n,i.value,r):(r.become(i),f(e,n+1,i))}else t(n,o,r)}function f(e,t,n){for(var o=t;on&&e._unreport()}}function h(e){return"object"!=typeof e||null===e?r(new TypeError("non-iterable passed to race()")):0===e.length?i():1===e.length?o(e[0]):m(e)}function m(e){var n,o,r,i=new w;for(n=0;n0||"function"!=typeof t&&0>r)return new this.constructor(g,o);var i=this._beget(),a=i._handler;return o.chain(a,o.receiver,e,t,n),i},t.prototype["catch"]=function(e){return this.then(void 0,e)},t.prototype._beget=function(){return s(this._handler,this.constructor)},t.all=u,t.race=h,t._traverse=l,t._visitRemaining=f,g.prototype.when=g.prototype.become=g.prototype.notify=g.prototype.fail=g.prototype._unreport=g.prototype._report=X,g.prototype._state=0,g.prototype.state=function(){return this._state},g.prototype.join=function(){for(var e=this;void 0!==e.handler;)e=e.handler;return e},g.prototype.chain=function(e,t,n,o,r){this.when({resolver:e,receiver:t,fulfilled:n,rejected:o,progress:r})},g.prototype.visit=function(e,t,n,o){this.chain(K,e,t,n,o)},g.prototype.fold=function(e,t,n,o){this.when(new q(e,t,n,o))},z(g,b),b.prototype.become=function(e){e.fail()};var K=new b;z(g,w),w.prototype._state=0,w.prototype.resolve=function(e){this.become(v(e))},w.prototype.reject=function(e){this.resolved||this.become(new E(e))},w.prototype.join=function(){if(!this.resolved)return this;for(var e=this;void 0!==e.handler;)if(e=e.handler,e===this)return this.handler=R();return e},w.prototype.run=function(){var e=this.consumers,t=this.handler;this.handler=this.handler.join(),this.consumers=void 0;for(var n=0;ni;i++)if(r=t.loads[i],r.name==n)return console.assert("loading"==r.status||"loaded"==r.status,"loading or loaded"),r;return r=e(n),t.loads.push(r),o(t,r),r})}function o(e,t){r(e,t,P.resolve().then(function(){return e.loaderObj.locate({name:t.name,metadata:t.metadata})}))}function r(e,t,n){i(e,t,n.then(function(n){return"loading"==t.status?(t.address=n,e.loaderObj.fetch({name:t.name,metadata:t.metadata,address:n})):void 0}))}function i(e,t,o){o.then(function(o){return"loading"==t.status?P.resolve(e.loaderObj.translate({name:t.name,metadata:t.metadata,address:t.address,source:o})).then(function(n){return t.source=n,e.loaderObj.instantiate({name:t.name,metadata:t.metadata,address:t.address,source:n})}).then(function(n){if(void 0===n)return t.address=t.address||"",t.isDeclarative=!0,e.loaderObj.transpile(t).then(function(e){var n=__global.System,o=n.register;n.register=function(e,n,o){"string"!=typeof e&&(o=n,n=e),t.declare=o,t.depsList=n},__eval(e,__global,t),n.register=o});if("object"!=typeof n)throw TypeError("Invalid instantiate return value");t.depsList=n.deps||[],t.execute=n.execute,t.isDeclarative=!1}).then(function(){t.dependencies=[];for(var o=t.depsList,r=[],i=0,a=o.length;a>i;i++)(function(o,i){r.push(n(e,o,t.name,t.address).then(function(e){if(t.dependencies[i]={key:o,value:e.name},"linked"!=e.status)for(var n=t.linkSets.concat([]),r=0,a=n.length;a>r;r++)u(n[r],e)}))})(o[i],i);return P.all(r)}).then(function(){console.assert("loading"==t.status,"is loading"),t.status="loaded";for(var e=t.linkSets.concat([]),n=0,o=e.length;o>n;n++)c(e[n],t)}):void 0})["catch"](function(e){t.status="failed",t.exception=e;for(var n=t.linkSets.concat([]),o=0,r=n.length;r>o;o++)d(n[o],t,e);console.assert(0==t.linkSets.length,"linkSets not removed")})}function a(t){return function(n){var a=t.loader,u=t.moduleName,l=t.step;if(a.modules[u])throw new TypeError('"'+u+'" already exists in the module table');for(var c,d=0,f=a.loads.length;f>d;d++)if(a.loads[d].name==u)return c=a.loads[d],"translate"!=l||c.source||(c.address=t.moduleAddress,i(a,c,P.resolve(t.moduleSource))),c.linkSets[0].done.then(function(){n(c)});var p=e(u);p.metadata=t.moduleMetadata;var h=s(a,p);a.loads.push(p),n(h.done),"locate"==l?o(a,p):"fetch"==l?r(a,p,P.resolve(t.moduleAddress)):(console.assert("translate"==l,"translate step"),p.address=t.moduleAddress,i(a,p,P.resolve(t.moduleSource)))}}function s(e,t){var n={loader:e,loads:[],startingLoad:t,loadingCount:0};return n.done=new P(function(e,t){n.resolve=e,n.reject=t}),u(n,t),n}function u(e,t){console.assert("loading"==t.status||"loaded"==t.status,"loading or loaded on link set");for(var n=0,o=e.loads.length;o>n;n++)if(e.loads[n]==t)return;e.loads.push(t),t.linkSets.push(e),"loaded"!=t.status&&e.loadingCount++;for(var r=e.loader,n=0,o=t.dependencies.length;o>n;n++){var i=t.dependencies[n].value;if(!r.modules[i])for(var a=0,s=r.loads.length;s>a;a++)if(r.loads[a].name==i){u(e,r.loads[a]);break}}}function l(e){var t=!1;try{m(e,function(n,o){d(e,n,o),t=!0})}catch(n){d(e,null,n),t=!0}return t}function c(e,t){if(console.assert("loaded"==t.status||"linked"==t.status,"loaded or linked"),e.loadingCount--,!(e.loadingCount>0)){var n=e.startingLoad;if(e.loader.loaderObj.execute===!1){for(var o=[].concat(e.loads),r=0,i=o.length;i>r;r++){var t=o[r];t.module=t.isDeclarative?{name:t.name,module:T({}),evaluated:!0}:{module:T({})},t.status="linked",f(e.loader,t)}return e.resolve(n)}var a=l(e);a||(console.assert(0==e.loads.length,"loads cleared"),e.resolve(n))}}function d(e,t,n){var o=e.loader;t&&e.loads[0].name!=t.name&&(n=j(n,'Error loading "'+t.name+'" from "'+e.loads[0].name+'" at '+(e.loads[0].address||"")+"\n")),t&&(n=j(n,'Error loading "'+t.name+'" at '+(t.address||"")+"\n"));for(var r=e.loads.concat([]),i=0,a=r.length;a>i;i++){var t=r[i];o.loaderObj.failed=o.loaderObj.failed||[],-1==k.call(o.loaderObj.failed,t)&&o.loaderObj.failed.push(t);var s=k.call(t.linkSets,e);if(console.assert(-1!=s,"link not present"),t.linkSets.splice(s,1),0==t.linkSets.length){var u=k.call(e.loader.loads,t);-1!=u&&e.loader.loads.splice(u,1)}}e.reject(n)}function f(e,t){if(e.loaderObj.trace){e.loaderObj.loads||(e.loaderObj.loads={});var n={};t.dependencies.forEach(function(e){n[e.key]=e.value}),e.loaderObj.loads[t.name]={name:t.name,deps:t.dependencies.map(function(e){return e.key}),depMap:n,address:t.address,metadata:t.metadata,source:t.source,kind:t.isDeclarative?"declarative":"dynamic"}}t.name&&(console.assert(!e.modules[t.name],"load not in module table"),e.modules[t.name]=t.module);var o=k.call(e.loads,t);-1!=o&&e.loads.splice(o,1);for(var r=0,i=t.linkSets.length;i>r;r++)o=k.call(t.linkSets[r].loads,t),-1!=o&&t.linkSets[r].loads.splice(o,1);t.linkSets.splice(0,t.linkSets.length)}function p(e,t,n){if(n[e.groupIndex]=n[e.groupIndex]||[],-1==k.call(n[e.groupIndex],e)){n[e.groupIndex].push(e);for(var o=0,r=t.length;r>o;o++)for(var i=t[o],a=0;a=0;a--){for(var s=o[a],u=0;un;n++){var a=o.importers[n];if(!a.locked){var s=k.call(a.dependencies,o);a.setters[s](r)}}return o.locked=!1,t});o.setters=i.setters,o.execute=i.execute;for(var a=0,s=e.dependencies.length;s>a;a++){var u=e.dependencies[a].value,l=n.modules[u];if(!l)for(var c=0;ci;i++){var s=r[i];if(s&&-1==k.call(t,s)&&(o=w(s,t,n)))return o=j(o,"Error evaluating "+s.name+"\n")}if(e.failed)return new Error("Module failed execution.");if(!e.evaluated)return e.evaluated=!0,o=g(e),o?e.failed=!0:Object.preventExtensions&&Object.preventExtensions(e.module),e.execute=void 0,o}}function j(e,t){return e instanceof Error?e.message=t+e.message:e=t+e,e}function x(e){if("object"!=typeof e)throw new TypeError("Options must be an object");e.normalize&&(this.normalize=e.normalize),e.locate&&(this.locate=e.locate),e.fetch&&(this.fetch=e.fetch),e.translate&&(this.translate=e.translate),e.instantiate&&(this.instantiate=e.instantiate),this._loader={loaderObj:this,loads:[],modules:{},importPromises:{},moduleRecords:{}},R(this,"global",{get:function(){return __global}})}function O(){}function E(e,t,n){var o=e._loader.importPromises;return o[t]=n.then(function(e){return o[t]=void 0,e},function(e){throw o[t]=void 0,e})}var P=__global.Promise||require("when/es6-shim/Promise");__global.console&&(console.assert=console.assert||function(){});var k=Array.prototype.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},R=$__Object$defineProperty,L=0;x.prototype={constructor:x,define:function(e,t,n){if(this._loader.importPromises[e])throw new TypeError("Module is already loading.");return E(this,e,new P(a({step:"translate",loader:this._loader,moduleName:e,moduleMetadata:n&&n.metadata||{},moduleSource:t,moduleAddress:n&&n.address})))},"delete":function(e){var t=this._loader;return delete t.importPromises[e],delete t.moduleRecords[e],t.modules[e]?delete t.modules[e]:!1},get:function(e){return this._loader.modules[e]?(b(this._loader.modules[e],[],this),this._loader.modules[e].module):void 0},has:function(e){return!!this._loader.modules[e]},"import":function(e,n){var o=this;return P.resolve(o.normalize(e,n&&n.name,n&&n.address)).then(function(e){var r=o._loader;return r.modules[e]?(b(r.modules[e],[],r._loader),r.modules[e].module):r.importPromises[e]||E(o,e,t(r,e,n||{}).then(function(t){return delete r.importPromises[e],_(r,t)}))})},load:function(e){return this._loader.modules[e]?(b(this._loader.modules[e],[],this._loader),P.resolve(this._loader.modules[e].module)):this._loader.importPromises[e]||E(this,e,t(this._loader,e,{}))},module:function(t,n){var o=e();o.address=n&&n.address;var r=s(this._loader,o),a=P.resolve(t),u=this._loader,l=r.done.then(function(){return _(u,o)});return i(u,o,a),l},newModule:function(e){if("object"!=typeof e)throw new TypeError("Expected object");var t,n=new O;if(Object.getOwnPropertyNames&&null!=e)t=Object.getOwnPropertyNames(e);else{t=[];for(var o in e)t.push(o)}for(var r=0;r2)throw new TypeError("Only one wildcard in a path is permitted");if(1==s.length){if(o==i&&i.length>r.length){r=i;break}}else o.substr(0,s[0].length)==s[0]&&o.substr(o.length-s[1].length)==s[1]&&(r=i,t=o.substr(s[0].length,o.length-s[1].length-s[0].length))}var u=this.paths[r];return t&&(u=u.replace("*",t)),a&&(u=u.replace(/#/g,"%23")),n(this.baseURL,u)},enumerable:!1,writable:!0}),$__Object$defineProperty(t.prototype,"fetch",{value:function(e){var t=this;return new u(function(o,r){i(n(t.baseURL,e.address),function(e){o(e)},r)})},enumerable:!1,writable:!0}),t}(__global.LoaderPolyfill),d=new c;if("object"==typeof exports&&(module.exports=d),__global.System=d,a&&document.getElementsByTagName){var f=document.getElementsByTagName("script");f=f[f.length-1],"complete"===document.readyState?setTimeout(r):document.addEventListener&&(document.addEventListener("DOMContentLoaded",o,!1),window.addEventListener("load",o,!1)),f.getAttribute("data-init")&&window[f.getAttribute("data-init")]()}}()}("undefined"!=typeof window?window:"undefined"!=typeof global?global:self); 2 | //# sourceMappingURL=es6-module-loader@0.16.6.js.map -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |

angular starter

12 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /public/system.js: -------------------------------------------------------------------------------- 1 | /* 2 | * SystemJS 0.16.11 3 | * Served for jspm from https://jspm.io/system@0.16.11.js 4 | */ 5 | !function($__global,$__globalName){$__global.upgradeSystemLoader=function(){function e(e){var t=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@\/?#]*(?::[^:@\/?#]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return t?{href:t[0]||"",protocol:t[1]||"",authority:t[2]||"",host:t[3]||"",hostname:t[4]||"",port:t[5]||"",pathname:t[6]||"",search:t[7]||"",hash:t[8]||""}:null}function t(t,a){function r(e){var t=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?t.pop():t.push(e)}),t.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}return g&&(a=a.replace(/\\/g,"/")),a=e(a||""),t=e(t||""),a&&t?(a.protocol||t.protocol)+(a.protocol||a.authority?a.authority:t.authority)+r(a.protocol||a.authority||"/"===a.pathname.charAt(0)?a.pathname:a.pathname?(t.authority&&!t.pathname?"/":"")+t.pathname.slice(0,t.pathname.lastIndexOf("/")+1)+a.pathname:t.pathname)+(a.protocol||a.authority||a.pathname?a.search:a.search||t.search)+a.hash:null}function a(e){function r(e,t){t._extensions=[];for(var a=0,r=e.length;r>a;a++)e[a](t)}var n=e["import"];e["import"]=function(e,t){return n.call(this,e,t).then(function(e){return e.__useDefault?e["default"]:e})},e.set("@empty",e.newModule({})),"undefined"!=typeof require&&(e._nodeRequire=require),e.config=function(e){for(var t in e){var a=e[t];if("object"!=typeof a||a instanceof Array)this[t]=a;else{this[t]=this[t]||{};for(var r in a)this[t][r]=a[r]}}};var o;if("undefined"==typeof window&&"undefined"==typeof WorkerGlobalScope&&"undefined"!=typeof process)o="file:"+process.cwd()+"/",g&&(o=o.replace(/\\/g,"/"));else if("undefined"==typeof window)o=location.href;else if(o=document.baseURI,!o){var i=document.getElementsByTagName("base");o=i[0]&&i[0].href||window.location.href}var s,l=e.locate;e.locate=function(e){return this.baseURL!=s&&(s=t(o,this.baseURL),"/"!=s.substr(s.length-1,1)&&(s+="/"),this.baseURL=s),Promise.resolve(l.call(this,e))},e._extensions=e._extensions||[],e._extensions.push(a),e.clone=function(){var e=this,t=new LoaderPolyfill(v);return t.baseURL=e.baseURL,t.paths={"*":"*.js"},r(e._extensions,t),t}}function r(e){function t(e,t){var a=e.meta&&e.meta[t.name];if(a)for(var r in a)t.metadata[r]=t.metadata[r]||a[r]}var a=/^(\s*\/\*.*\*\/|\s*\/\/[^\n]*|\s*"[^"]+"\s*;?|\s*'[^']+'\s*;?)+/,n=/\/\*.*\*\/|\/\/[^\n]*|"[^"]+"\s*;?|'[^']+'\s*;?/g;e.meta={},e._extensions=e._extensions||[],e._extensions.push(r);var o=e.locate;e.locate=function(e){return t(this,e),o.call(this,e)};var i=e.translate;e.translate=function(e){var r=e.source.match(a);if(r)for(var o=r[0].match(n),s=0;sa;a++)-1==h.call(t,e[a])&&t.push(e[a]);return t}function o(t,a,r,n){"string"!=typeof t&&(n=r,r=a,a=t,t=null),v=!0;var o;if(o="boolean"==typeof r?{declarative:!1,deps:a,execute:n,executingRequire:r}:{declarative:!0,deps:a,declare:r},t)o.name=t,t in e.defined||(e.defined[t]=o);else if(o.declarative){if(g)throw new TypeError("Multiple anonymous System.register calls in the same module file.");g=o}}function i(e){if(!e.register){e.register=o,e.defined||(e.defined={});var t=e.onScriptLoad;e.onScriptLoad=function(e){t(e),g&&(e.metadata.entry=g),v&&(e.metadata.format=e.metadata.format||"register",e.metadata.registered=!0)}}}function s(e,t,a){if(a[e.groupIndex]=a[e.groupIndex]||[],-1==h.call(a[e.groupIndex],e)){a[e.groupIndex].push(e);for(var r=0,n=e.normalizedDeps.length;n>r;r++){var o=e.normalizedDeps[r],i=t.defined[o];if(i&&!i.evaluated){var l=e.groupIndex+(i.declarative!=e.declarative);if(void 0===i.groupIndex||i.groupIndex=0;o--){for(var i=r[o],l=0;ln;n++){var i=a.importers[n];if(!i.locked){var s=h.call(i.dependencies,a);i.setters[s](r)}}return a.locked=!1,t});if(a.setters=n.setters,a.execute=n.execute,!a.setters||!a.execute)throw new TypeError("Invalid System.register form for "+e.name);for(var o=0,i=e.normalizedDeps.length;i>o;o++){var s,l=e.normalizedDeps[o],c=t.defined[l],f=b[l];f?s=f.exports:c&&!c.declarative?s=c.module.exports&&c.module.exports.__esModule?c.module.exports:{"default":c.module.exports,__useDefault:!0}:c?(d(c,t),f=c.module,s=f.exports):s=t.get(l),f&&f.importers?(f.importers.push(a),a.dependencies.push(f)):a.dependencies.push(null),a.setters[o]&&a.setters[o](s)}}}function c(e,t){var a,r=t.defined[e];if(r)r.declarative?m(e,[],t):r.evaluated||f(r,t),a=r.module.exports;else if(a=t.get(e),!a)throw new Error("Unable to load dependency "+e+".");return(!r||r.declarative)&&a&&a.__useDefault?a["default"]:a}function f(e,t){if(!e.module){var a={},r=e.module={exports:a,id:e.name};if(!e.executingRequire)for(var n=0,o=e.normalizedDeps.length;o>n;n++){var i=e.normalizedDeps[n],s=t.defined[i];s&&f(s,t)}e.evaluated=!0;var l=e.execute.call(t.global,function(a){for(var r=0,n=e.deps.length;n>r;r++)if(e.deps[r]==a)return c(e.normalizedDeps[r],t);throw new TypeError("Module "+a+" not declared as a dependency.")},a,r);l&&(r.exports=l)}}function m(e,t,a){var r=a.defined[e];if(r&&!r.evaluated&&r.declarative){t.push(e);for(var n=0,o=r.normalizedDeps.length;o>n;n++){var i=r.normalizedDeps[n];-1==h.call(t,i)&&(a.defined[i]?m(i,t,a):a.get(i))}r.evaluated||(r.evaluated=!0,r.module.execute.call(a.global))}}"undefined"==typeof h&&(h=Array.prototype.indexOf),("undefined"==typeof __eval||"undefined"!=typeof document&&!document.addEventListener)&&(__eval=0||eval),e._extensions=e._extensions||[],e._extensions.push(n);e.__exec=a;var g,v;i(e);var b={},y=e["delete"];e["delete"]=function(e){return delete b[e],y.call(this,e)};var x=/System\.register/,_=e.fetch;e.fetch=function(e){var t=this;return i(t),t.defined[e.name]?(e.metadata.format="defined",""):(g=null,v=!1,_.call(t,e))};var w=e.translate;e.translate=function(e){return this.register=o,this.__exec=a,e.metadata.deps=e.metadata.deps||[],Promise.resolve(w.call(this,e)).then(function(t){return(e.metadata.init||e.metadata.exports)&&(e.metadata.format=e.metadata.format||"global"),("register"==e.metadata.format||!e.metadata.format&&e.source.match(x))&&(e.metadata.format="register"),t})};var S=e.instantiate;e.instantiate=function(e){var t,a=this;if(a.defined[e.name])t=a.defined[e.name],t.deps=t.deps.concat(e.metadata.deps);else if(e.metadata.entry)t=e.metadata.entry;else if(e.metadata.execute)t={declarative:!1,deps:e.metadata.deps||[],execute:e.metadata.execute,executingRequire:e.metadata.executingRequire};else if("register"==e.metadata.format){g=null,v=!1;var n=a.global.System;if(a.global.System=a,a.__exec(e),a.global.System=n,g?t=g:e.metadata.bundle=!0,!t&&p.defined[e.name]&&(t=p.defined[e.name]),!v&&!e.metadata.registered)throw new TypeError(e.name+" detected as System.register but didn't execute.")}if(!t&&"es6"!=e.metadata.format)return{deps:e.metadata.deps,execute:function(){return a.newModule({})}};if(!t)return S.call(this,e);a.defined[e.name]=t,t.deps=r(t.deps),t.name=e.name;for(var o=[],i=0,s=t.deps.length;s>i;i++)o.push(Promise.resolve(a.normalize(t.deps[i],e.name)));return Promise.all(o).then(function(r){return t.normalizedDeps=r,{deps:t.deps,execute:function(){l(e.name,a),m(e.name,[],a),a.defined[e.name]=void 0;var r=t.module.exports;return(!r||!t.declarative&&r.__esModule!==!0)&&(r={"default":r,__useDefault:!0}),a.newModule(r)}}})}}function o(e){function t(e,t,r,n){e.meta=e.meta||{};var o=e.meta[t]=e.meta[t]||{};if(o.format=o.format||"global",!e.paths[t]){var i=a(r,n);i&&(e.paths[t]=i)}}function a(e,t){if(d){var a=t?"/package.json":"";try{var r=d(e+a);return"file:"+r.substr(0,r.length-a.length)+(t?"/*.js":"")}catch(n){}}}e._extensions.push(o);var r,n,i=/(^\s*|[}\);\n]\s*)(import\s+(['"]|(\*\s+as\s+)?[^"'\(\)\n;]+\s+from\s+['"]|\{)|export\s+\*\s+from\s+["']|export\s+(\{|default|function|class|var|const|let|async\s+function))/,s=/\$traceurRuntime\s*\./,l=/babelHelpers\s*\./,u=!0,d="undefined"!=typeof process&&"undefined"!=typeof require&&require.resolve,c=e.locate;e.locate=function(e){var a=this;return u&&("traceur"==a.transpiler?(t(a,"traceur","traceur/bin/traceur.js"),a.meta.traceur.exports="traceur",t(a,"traceur-runtime","traceur/bin/traceur-runtime.js")):"babel"==a.transpiler&&(t(a,"babel","babel-core/browser.js"),t(a,"babel/external-helpers","babel-core/external-helpers.js"),t(a,"babel-runtime/*","babel-runtime",!0)),u=!1),c.call(a,e)};var f=e.translate;e.translate=function(e){var t=this;return f.call(t,e).then(function(a){if("es6"==e.metadata.format||!e.metadata.format&&a.match(i))return e.metadata.format="es6",a;if("register"==e.metadata.format){if(!t.global.$traceurRuntime&&e.source.match(s))return t["import"]("traceur-runtime").then(function(){return a});if(!t.global.babelHelpers&&e.source.match(l))return t["import"]("babel/external-helpers").then(function(){return a})}return"traceur"==t.transpiler?Promise.all([r||(r=t.normalize(t.transpiler)),n||(n=t.normalize(t.transpiler+"-runtime"))]).then(function(t){return e.name==t[0]||e.name==t[1]?"(function() { var curSystem = System; "+a+"\nSystem = curSystem; })();":a}):a})}}function i(e){function t(e,t){for(var a=e.split(".");a.length;)t=t[a.shift()];return t}function a(t){if(Object.keys)Object.keys(e.global).forEach(t);else for(var a in e.global)s.call(e.global,a)&&t(a)}function r(t){a(function(a){if(-1==h.call(o,a)){try{var r=e.global[a]}catch(n){o.push(a)}t(a,r)}})}function n(e){if(!e.has("@@global-helpers")){var a,n={};e.set("@@global-helpers",e.newModule({prepareGlobal:function(t,o){for(var i=0;ia;a++)"/"===e[a]&&t++;return t}function r(e,t,a){return a+e.substr(t)}function n(e,n,o){var i,s,l,u,d=0,c=0;if(n)for(var f in o.map){var m=o.map[f];if("object"==typeof m&&t(n,f)&&(l=a(f),!(c>=l)))for(var p in m)t(e,p)&&(u=a(p),d>=u||(i=p,d=u,s=f,c=l))}if(i)return r(e,i.length,o.map[s][i]);for(var f in o.map){var m=o.map[f];if("string"==typeof m&&t(e,f)){var u=a(f);d>=u||(i=f,d=u)}}return i?r(e,i.length,o.map[i]):e}e.map=e.map||{},e._extensions.push(u);var o=e.normalize;e.normalize=function(e,t,a){var r=this;r.map||(r.map={});var i=!1;return"/"==e.substr(e.length-1,1)&&(i=!0,e+="#"),Promise.resolve(o.call(r,e,t,a)).then(function(e){if(e=n(e,t,r),i){var a=e.split("/");a.pop();var o=a.pop();a.push(o),a.push(o),e=a.join("/")}return e})}}function d(e){"undefined"==typeof h&&(h=Array.prototype.indexOf),e._extensions.push(d);var t=e.normalize;e.normalize=function(e,a,r){var n,o=this;return a&&-1!=(n=a.indexOf("!"))&&(a=a.substr(0,n)),Promise.resolve(t.call(o,e,a,r)).then(function(e){var t=e.lastIndexOf("!");if(-1!=t){var n=e.substr(0,t),i=e.substr(t+1)||n.substr(n.lastIndexOf(".")+1);return new Promise(function(e){e(o.normalize(i,a,r))}).then(function(e){return i=e,o.normalize(n,a,r)}).then(function(e){return e+"!"+i})}return e})};var a=e.locate;e.locate=function(e){var t=this,r=e.name;if(this.defined&&this.defined[r])return a.call(this,e);var n=r.lastIndexOf("!");if(-1!=n){var o=r.substr(n+1);e.name=r.substr(0,n);var i=t.pluginLoader||t;return i["import"](o).then(function(){var a=i.get(o);return a=a["default"]||a,a.build===!1&&t.pluginLoader&&(e.metadata.build=!1),e.metadata.plugin=a,e.metadata.pluginName=o,e.metadata.pluginArgument=e.name,a.locate?a.locate.call(t,e):Promise.resolve(t.locate(e)).then(function(e){return e.replace(/\.js$/,"")})})}return a.call(this,e)};var r=e.fetch;e.fetch=function(e){var t=this;return e.metadata.build===!1&&t.pluginLoader?"":e.metadata.plugin&&e.metadata.plugin.fetch&&!e.metadata.pluginFetchCalled?(e.metadata.pluginFetchCalled=!0,e.metadata.plugin.fetch.call(t,e,r)):r.call(t,e)};var n=e.translate;e.translate=function(e){var t=this;return e.metadata.plugin&&e.metadata.plugin.translate?Promise.resolve(e.metadata.plugin.translate.call(t,e)).then(function(a){return"string"==typeof a&&(e.source=a),n.call(t,e)}):n.call(t,e)};var o=e.instantiate;e.instantiate=function(e){var t=this;return e.metadata.plugin&&e.metadata.plugin.instantiate?Promise.resolve(e.metadata.plugin.instantiate.call(t,e)).then(function(a){return e.metadata.format="defined",e.metadata.execute=function(){return a},o.call(t,e)}):e.metadata.plugin&&e.metadata.plugin.build===!1?(e.metadata.format="defined",e.metadata.deps.push(e.metadata.pluginName),e.metadata.execute=function(){return t.newModule({})},o.call(t,e)):o.call(t,e)}}function c(e){function t(e,t){return Promise.resolve(e.normalize(t)).then(function(r){return-1==h.call(a,r)&&(a.push(r),e.bundles[r]=e.bundles[r]||e.bundles[t],e.meta=e.meta||{},e.meta[r]=e.meta[r]||{},e.meta[r].bundle=!0),e.load(r)}).then(function(){return""})}"undefined"==typeof h&&(h=Array.prototype.indexOf),e._extensions.push(c),e.bundles=e.bundles||{};var a=[],r=e.fetch;e.fetch=function(e){var n=this;if(n.trace)return r.call(this,e);n.bundles||(n.bundles={});for(var o=0;oi?1:-1}if(!e.pre&&!a.pre)return 0;if(!e.pre)return 1;if(!a.pre)return-1;for(var r=0,s=Math.min(e.pre.length,a.pre.length);s>r;r++)if(e.pre[r]!=a.pre[r]){var d=e.pre[r].match(l),c=a.pre[r].match(l);return d&&!c?-1:c&&!d?1:d&&c?t(e.pre[r])>t(a.pre[r])?1:-1:e.pre[r]>a.pre[r]?1:-1}return e.pre.length==a.pre.length?0:e.pre.length>a.pre.length?1:-1}function n(e,t){var a=e.version;return a.tag?a.tag==t.tag:1==r(a,t)?!1:isNaN(t.minor)||isNaN(t.patch)?!1:t.pre?a.major!=t.major||a.minor!=t.minor||a.patch!=t.patch?!1:e.semver||e.fuzzy||a.pre.join(".")==t.pre.join("."):e.semver?0==a.major&&isNaN(a.minor)?t.major<1:a.major>=1?a.major==t.major:a.minor>=1?a.minor==t.minor:(a.patch||0)==t.patch:e.fuzzy?t.major==a.major&&t.minor<(a.minor||0)+1:!a.pre&&a.major==t.major&&a.minor==t.minor&&a.patch==t.patch}function o(e){var t={};((t.semver="^"==e.substr(0,1))||(t.fuzzy="~"==e.substr(0,1)))&&(e=e.substr(1));var r=t.version=a(e);return r.tag?t:(t.fuzzy||t.semver||!isNaN(r.minor)&&!isNaN(r.patch)||(t.fuzzy=!0),t.fuzzy&&isNaN(r.minor)&&(t.semver=!0,t.fuzzy=!1),t.semver&&!isNaN(r.minor)&&isNaN(r.patch)&&(t.semver=!1,t.fuzzy=!0),t)}function i(e,t){return r(a(e),a(t))}"undefined"==typeof h&&(h=Array.prototype.indexOf),e._extensions.push(f);var s=/^(\d+)(?:\.(\d+)(?:\.(\d+)(?:-([\da-z-]+(?:\.[\da-z-]+)*)(?:\+([\da-z-]+(?:\.[\da-z-]+)*))?)?)?)?$/i,l=/^\d+$/,u=["major","minor","patch"];e.versions=e.versions||{};var d=e.normalize;e.normalize=function(e,t,r){this.versions||(this.versions={});var s,l,u=this.versions,c=-1!=e.indexOf("!")?0:e.lastIndexOf("@");if(c>0){var f=e.substr(c+1,e.length-c-1).split("/");s=f[0],l=f.length,e=e.substr(0,c)+e.substr(c+s.length+1,e.length-c-s.length-1)}return Promise.resolve(d.call(this,e,t,r)).then(function(e){var t=-1!=e.indexOf("!")?0:e.indexOf("@");if(s&&(-1==t||0==t)){var r=e.split("/");r[r.length-l]+="@"+s,e=r.join("/"),t=e.indexOf("@")}var d,c;if(-1==t||0==t){for(var f in u)if(c=u[f],e.substr(0,f.length)==f&&(d=e.substr(f.length,1),!d||"/"==d))return f+"@"+("string"==typeof c?c:c[c.length-1])+e.substr(f.length);return e}var m=e.substr(0,t),p=e.substr(t+1).split("/")[0],h=p.length,g=o(e.substr(t+1).split("/")[0]);c=u[e.substr(0,t)]||[],"string"==typeof c&&(c=[c]);for(var v=c.length-1;v>=0;v--)if(n(g,a(c[v])))return m+"@"+c[v]+e.substr(t+h+1);var b;return g.semver?b=0!=g.version.major||isNaN(g.version.minor)?g.version.major:"0."+g.version.minor:g.fuzzy?b=g.version.major+"."+g.version.minor:(b=p,c.push(p),c.sort(i),u[m]=1==c.length?c[0]:c),m+"@"+b+e.substr(t+h+1)})}}function m(e){e.depCache=e.depCache||{},e._extensions.push(m);var t=e.locate;e.locate=function(e){var a=this;a.depCache||(a.depCache={});var r=a.depCache[e.name];if(r)for(var n=0;nt;t++)if(this[t]===e)return t;return-1},g="undefined"!=typeof process&&!!process.platform.match(/^win/);!function(){var e=$__global.System;p=$__global.System=new LoaderPolyfill(e),p.baseURL=e.baseURL,p.paths={"*":"*.js"},p.originalSystem=e}(),p.noConflict=function(){$__global.SystemJS=p,$__global.System=p.originalSystem};var v=$__global.System.originalSystem;a(p),r(p),n(p),o(p),i(p),s(p),l(p),u(p),d(p),c(p),f(p),m(p)};var $__curScript,__eval;!function(){var doEval;if(__eval=function(e,t,a){e+="\n//# sourceURL="+t+(a?"\n//# sourceMappingURL="+a:"");try{doEval(e)}catch(r){var n="Error evaluating "+t+"\n";throw r instanceof Error?r.message=n+r.message:r=n+r,r}},"undefined"!=typeof document){var head,scripts=document.getElementsByTagName("script");if($__curScript=scripts[scripts.length-1],doEval=function(e){head||(head=document.head||document.body||document.documentElement);var t=document.createElement("script");t.text=e;var a,r=window.onerror;if(window.onerror=function(e){a=e},head.appendChild(t),head.removeChild(t),window.onerror=r,a)throw a},$__global.System&&$__global.LoaderPolyfill)$__global.upgradeSystemLoader();else{var curPath=$__curScript.src,basePath=curPath.substr(0,curPath.lastIndexOf("/")+1);document.write('')}}else if("undefined"!=typeof importScripts)if(doEval=function(source){try{eval(source)}catch(e){throw e}},$__global.System&&$__global.LoaderPolyfill)$__global.upgradeSystemLoader();else{var basePath="";try{throw new Error("Get worker base path via error stack")}catch(e){e.stack.replace(/(?:at|@).*(http.+):[\d]+:[\d]+/,function(e,t){basePath=t.replace(/\/[^\/]*$/,"/")})}importScripts(basePath+"es6-module-loader@0.16.6.js"),$__global.upgradeSystemLoader()}else{var es6ModuleLoader=require("es6-module-loader");$__global.System=es6ModuleLoader.System,$__global.Loader=es6ModuleLoader.Loader,$__global.upgradeSystemLoader(),module.exports=$__global.System;var vm=require("vm");doEval=function(e){vm.runInThisContext(e)}}}()}("undefined"!=typeof window?window:"undefined"!=typeof global?global:self,"undefined"!=typeof window?"window":"undefined"!=typeof global?"global":"self"),function(e){var t=e.upgradeSystemLoader;e.upgradeSystemLoader=function(){t&&t(),System.config({paths:{"*":"https://registry.jspm.io/*.js","~/*":"*.js","npm:*":"https://npm.jspm.io/*.js","github:*":"https://github.jspm.io/*.js"},map:{traceur:"github:jmcriffey/bower-traceur@0.0.87","traceur-runtime":"github:jmcriffey/bower-traceur-runtime@0.0.87",babel:"npm:babel-core@5"}}),e.upgradeSystemLoader=void 0},t||e.upgradeSystemLoader()}("undefined"!=typeof window?window:global); 6 | //# sourceMappingURL=system@0.16.11.js.map -------------------------------------------------------------------------------- /public/traceur-runtime.js: -------------------------------------------------------------------------------- 1 | /* */ 2 | "format global";"exports $traceurRuntime";!function(t){"use strict";function e(t,e,r){for(var n=[e],i=0;i0;)i.unshift("..");0===i.length&&i.push(".")}return e+i.join("/")+r}function n(e){var n=e[a.PATH]||"";return n=r(n),e[a.PATH]=n,t(e[a.SCHEME],e[a.USER_INFO],e[a.DOMAIN],e[a.PORT],e[a.PATH],e[a.QUERY_DATA],e[a.FRAGMENT])}function i(t){var r=e(t);return n(r)}function o(t,r){var i=e(r),o=e(t);if(i[a.SCHEME])return n(i);i[a.SCHEME]=o[a.SCHEME];for(var u=a.SCHEME;u<=a.PORT;u++)i[u]||(i[u]=o[u]);if("/"==i[a.PATH][0])return n(i);var c=o[a.PATH],s=c.lastIndexOf("/");return c=c.slice(0,s+1)+i[a.PATH],i[a.PATH]=c,n(i)}function u(t){if(!t)return!1;if("/"===t[0])return!0;var r=e(t);return r[a.SCHEME]?!0:!1}var c=new RegExp("^"+"(?:"+"([^:/?#.]+)"+":)?"+"(?://"+"(?:([^/?#]*)@)?"+"([\\w\\d\\-\\u0100-\\uffff.%]*)"+"(?::([0-9]+))?"+")?"+"([^?#]+)?"+"(?:\\?([^#]*))?"+"(?:#(.*))?"+"$"),a={SCHEME:1,USER_INFO:2,DOMAIN:3,PORT:4,PATH:5,QUERY_DATA:6,FRAGMENT:7};$traceurRuntime.canonicalizeUrl=i,$traceurRuntime.isAbsolute=u,$traceurRuntime.removeDotSegments=r,$traceurRuntime.resolveUrl=o}(),function(t){"use strict";function e(t,e){this.url=t,this.value_=e}function r(t,e){this.message=this.constructor.name+": "+this.stripCause(e)+" in "+t,this.stack=e instanceof r||!e.stack?"":this.stripStack(e.stack)}function n(t,e){var r=[],n=e-3;0>n&&(n=0);for(var i=n;e>i;i++)r.push(t[i]);return r}function i(t,e){var r=e+1;r>t.length-1&&(r=t.length-1);for(var n=[],i=e;r>=i;i++)n.push(t[i]);return n}function o(t){for(var e="",r=0;t-1>r;r++)e+="-";return e}function u(t,r){e.call(this,t,null),this.func=r}function c(t){if(t){var e=v.normalize(t);return p[e]}}function a(t){var e=arguments[1],r=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(n){var i,o;if(e===y){var u=Object.getOwnPropertyDescriptor(t,n);u.get&&(i=u.get)}i||(o=t[n],i=function(){return o}),Object.defineProperty(r,n,{get:i,enumerable:!0})}),Object.preventExtensions(r),r}var s,l=$traceurRuntime,f=l.canonicalizeUrl,h=l.resolveUrl,m=l.isAbsolute,p=Object.create(null);s=t.location&&t.location.href?h(t.location.href,"./"):"",r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.stripError=function(t){return t.replace(/.*Error:/,this.constructor.name+":")},r.prototype.stripCause=function(t){return t?t.message?this.stripError(t.message):t+"":""},r.prototype.loadedBy=function(t){this.stack+="\n loaded by "+t},r.prototype.stripStack=function(t){var e=[];return t.split("\n").some(function(t){return/UncoatedModuleInstantiator/.test(t)?!0:void e.push(t)}),e[0]=this.stripError(e[0]),e.join("\n")},u.prototype=Object.create(e.prototype),u.prototype.getUncoatedModule=function(){if(this.value_)return this.value_;try{var e;return void 0!==typeof $traceurRuntime&&$traceurRuntime.require&&(e=$traceurRuntime.require.bind(null,this.url)),this.value_=this.func.call(t,e)}catch(u){if(u instanceof r)throw u.loadedBy(this.url),u;if(u.stack){var c=this.func.toString().split("\n"),a=[];u.stack.split("\n").some(function(t){if(t.indexOf("UncoatedModuleInstantiator.getUncoatedModule")>0)return!0;var e=/(at\s[^\s]*\s).*>:(\d*):(\d*)\)/.exec(t);if(e){var r=parseInt(e[2],10);a=a.concat(n(c,r)),a.push(o(e[3])+"^"),a=a.concat(i(c,r)),a.push("= = = = = = = = =")}else a.push(t)}),u.stack=a.join("\n")}throw new r(this.url,u)}};var b=Object.create(null),y={},v={normalize:function(t,e){if("string"!=typeof t)throw new TypeError("module name must be a string, not "+typeof t);if(m(t))return f(t);if(/[^\.]\/\.\.\//.test(t))throw new Error("module name embeds /../: "+t);return"."===t[0]&&e?h(e,t):f(t)},get:function(t){var e=c(t);if(!e)return void 0;var r=b[e.url];return r?r:(r=a(e.getUncoatedModule(),y),b[e.url]=r)},set:function(t,e){t=String(t),p[t]=new u(t,function(){return e}),b[t]=e},get baseURL(){return s},set baseURL(t){s=String(t)},registerModule:function(t,e,r){var n=v.normalize(t);if(p[n])throw new Error("duplicate module named "+n);p[n]=new u(n,r)},bundleStore:Object.create(null),register:function(t,e,r){e&&(e.length||r.length)?this.bundleStore[t]={deps:e,execute:function(){var t=arguments,n={};e.forEach(function(e,r){return n[e]=t[r]});var i=r.call(this,n);return i.execute.call(this),i.exports}}:this.registerModule(t,e,r)},getAnonymousModule:function(e){return new a(e.call(t),y)},getForTesting:function(t){var e=this;return this.testingPrefix_||Object.keys(b).some(function(t){var r=/(traceur@[^\/]*\/)/.exec(t);return r?(e.testingPrefix_=r[1],!0):void 0}),this.get(this.testingPrefix_+t)}},g=new a({ModuleStore:v});v.set("@traceur/src/runtime/ModuleStore",g),v.set("@traceur/src/runtime/ModuleStore.js",g);var d=$traceurRuntime.setupGlobals;$traceurRuntime.setupGlobals=function(t){d(t)},$traceurRuntime.ModuleStore=v,t.System={register:v.register.bind(v),registerModule:v.registerModule.bind(v),get:v.get,set:v.set,normalize:v.normalize},$traceurRuntime.getModuleImpl=function(t){var e=c(t);return e&&e.getUncoatedModule()}}("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this),System.registerModule("traceur-runtime@0.0.87/src/runtime/async.js",[],function(){"use strict";function t(){}function e(){}function r(t){return t.prototype=s(e.prototype),t.__proto__=e,t}function n(t,e){for(var r=[],n=2;n3?("function"==typeof n&&(t.__proto__=n),t.prototype=s(u(n),i(e))):t.prototype=e,f(t,"prototype",{configurable:!1,writable:!1}),l(t,i(r))}function u(t){if("function"==typeof t){var e=t.prototype;if(c(e)===e||null===e)return t.prototype;throw new a("super prototype must be an Object or null")}if(null===t)return null;throw new a("Super expression must either be null or a function, not "+typeof t+".")}var c=Object,a=TypeError,s=c.create,l=$traceurRuntime.defineProperties,f=$traceurRuntime.defineProperty,h=$traceurRuntime.getOwnPropertyDescriptor,m=($traceurRuntime.getOwnPropertyNames,Object.getPrototypeOf),p=Object,b=p.getOwnPropertyNames,y=p.getOwnPropertySymbols;return $traceurRuntime.createClass=o,$traceurRuntime.superConstructor=e,$traceurRuntime.superGet=r,$traceurRuntime.superSet=n,{}}),System.registerModule("traceur-runtime@0.0.87/src/runtime/destructuring.js",[],function(){"use strict";function t(t){for(var e,r=[],n=0;!(e=t.next()).done;)r[n++]=e.value;return r}return $traceurRuntime.iteratorToArray=t,{}}),System.registerModule("traceur-runtime@0.0.87/src/runtime/generators.js",[],function(){"use strict";function t(t){return{configurable:!0,enumerable:!1,value:t,writable:!0}}function e(t){return new Error("Traceur compiler bug: invalid state in state machine: "+t)}function r(){this.state=0,this.GState=v,this.storedException=void 0,this.finallyFallThrough=void 0,this.sent_=void 0,this.returnValue=void 0,this.oldReturnValue=void 0,this.tryStack_=[]}function n(t,e,r,n){switch(t.GState){case g:throw new Error('"'+r+'" on executing generator');case j:if("next"==r)return{value:void 0,done:!0};if(n===S)return{value:t.returnValue,done:!0};throw n;case v:if("throw"===r){if(t.GState=j,n===S)return{value:t.returnValue,done:!0};throw n}if(void 0!==n)throw y("Sent value to newborn generator");case d:t.GState=g,t.action=r,t.sent=n;var i;try{i=e(t)}catch(o){if(o!==S)throw o;i=t}var u=i===t;return u&&(i=t.returnValue),t.GState=u?j:d,{value:i,done:u}}}function i(){}function o(){}function u(t,e,n){var i=l(t,n),o=new r,u=b(e.prototype);return u[R]=o,u[_]=i,u}function c(t){return t.prototype=b(o.prototype),t.__proto__=o,t}function a(){r.call(this),this.err=void 0;var t=this;t.result=new Promise(function(e,r){t.resolve=e,t.reject=r})}function s(t,e){var r=l(t,e),n=new a;return n.createCallback=function(t){return function(e){n.state=t,n.value=e,r(n)}},n.errback=function(t){f(n,t),r(n)},r(n),n.result}function l(t,e){return function(r){for(;!0;)try{return t.call(e,r)}catch(n){f(r,n)}}}function f(t,e){t.storedException=e;var r=t.tryStack_[t.tryStack_.length-1];return r?(t.state=void 0!==r["catch"]?r["catch"]:r["finally"],void(void 0!==r.finallyFallThrough&&(t.finallyFallThrough=r.finallyFallThrough))):void t.handleException(e)}if("object"!=typeof $traceurRuntime)throw new Error("traceur runtime not found.");var h=$traceurRuntime.createPrivateName,m=$traceurRuntime.defineProperties,p=$traceurRuntime.defineProperty,b=Object.create,y=TypeError,v=0,g=1,d=2,j=3,w=-2,O=-3,S={};r.prototype={pushTry:function(t,e){if(null!==e){for(var r=null,n=this.tryStack_.length-1;n>=0;n--)if(void 0!==this.tryStack_[n]["catch"]){r=this.tryStack_[n]["catch"];break}null===r&&(r=O),this.tryStack_.push({"finally":e,finallyFallThrough:r})}null!==t&&this.tryStack_.push({"catch":t})},popTry:function(){this.tryStack_.pop()},maybeUncatchable:function(){if(this.storedException===S)throw S},get sent(){return this.maybeThrow(),this.sent_},set sent(t){this.sent_=t},get sentIgnoreThrow(){return this.sent_},maybeThrow:function(){if("throw"===this.action)throw this.action="next",this.sent_},end:function(){switch(this.state){case w:return this;case O:throw this.storedException;default:throw e(this.state)}},handleException:function(t){throw this.GState=j,this.state=w,t},wrapYieldStar:function(t){var e=this;return{next:function(e){return t.next(e)},"throw":function(r){var n;if(r===S){if(t["return"]){if(n=t["return"](e.returnValue),!n.done)return e.returnValue=e.oldReturnValue,n;e.returnValue=n.value}throw r}if(t["throw"])return t["throw"](r);throw t["return"]&&t["return"](),y("Inner iterator does not have a throw method")}}}};var R=h(),_=h();return i.prototype=o,p(o,"constructor",t(i)),o.prototype={constructor:o,next:function(t){return n(this[R],this[_],"next",t)},"throw":function(t){return n(this[R],this[_],"throw",t)},"return":function(t){return this[R].oldReturnValue=this[R].returnValue,this[R].returnValue=t,n(this[R],this[_],"throw",S)}},m(o.prototype,{constructor:{enumerable:!1},next:{enumerable:!1},"throw":{enumerable:!1},"return":{enumerable:!1}}),Object.defineProperty(o.prototype,Symbol.iterator,t(function(){return this})),a.prototype=b(r.prototype),a.prototype.end=function(){switch(this.state){case w:this.resolve(this.returnValue);break;case O:this.reject(this.storedException);break;default:this.reject(e(this.state))}},a.prototype.handleException=function(){this.state=O},$traceurRuntime.asyncWrap=s,$traceurRuntime.initGeneratorFunction=c,$traceurRuntime.createGeneratorInstance=u,{}}),System.registerModule("traceur-runtime@0.0.87/src/runtime/relativeRequire.js",[],function(){"use strict";function t(t,r){function n(t){return"/"===t.slice(-1)}function i(t){return"/"===t[0]}function o(t){return"."===t[0]}return e=e||"undefined"!=typeof require&&require("path"),n(r)||i(r)?void 0:require(o(r)?e.resolve(e.dirname(t),r):r)}var e;return $traceurRuntime.require=t,{}}),System.registerModule("traceur-runtime@0.0.87/src/runtime/spread.js",[],function(){"use strict";function t(){for(var t,e=[],r=0,n=0;n>>0}function e(t){return t&&("object"==typeof t||"function"==typeof t)}function r(t){return"function"==typeof t}function n(t){return"number"==typeof t}function i(t){return t=+t,j(t)?0:0!==t&&d(t)?t>0?g(t):v(t):t}function o(t){var e=i(t);return 0>e?0:O(e,R)}function u(t){return e(t)?t[Symbol.iterator]:void 0}function c(t){return r(t)}function a(t,e){return{value:t,done:e}}function s(t,e,r){e in t||Object.defineProperty(t,e,r)}function l(t,e,r){s(t,e,{value:r,configurable:!0,enumerable:!1,writable:!0})}function f(t,e,r){s(t,e,{value:r,configurable:!1,enumerable:!1,writable:!1})}function h(t,e){for(var r=0;rt;t+=2){var e=h[t],r=h[t+1];e(r),h[t]=void 0,h[t+1]=void 0}c=0}var u,c=0,a=t,s="undefined"!=typeof window?window:{},l=s.MutationObserver||s.WebKitMutationObserver,f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,h=new Array(1e3);return u="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)?e():l?r():f?n():i(),{get default(){return a}}}),System.registerModule("traceur-runtime@0.0.87/src/runtime/polyfills/Promise.js",[],function(){"use strict";function t(t){return t&&"object"==typeof t&&void 0!==t.status_}function e(t){return t}function r(t){throw t}function n(t){var n=arguments[1]!==void 0?arguments[1]:e,o=arguments[2]!==void 0?arguments[2]:r,u=i(t.constructor);switch(t.status_){case void 0:throw TypeError;case 0:t.onResolve_.push(n,u),t.onReject_.push(o,u);break;case+1:l(t.value_,[n,u]);break;case-1:l(t.value_,[o,u])}return u.promise}function i(t){if(this===d){var e=u(new d(v));return{promise:e,resolve:function(t){c(e,t)},reject:function(t){a(e,t)}}}var r={};return r.promise=new t(function(t,e){r.resolve=t,r.reject=e}),r}function o(t,e,r,n,i){return t.status_=e,t.value_=r,t.onResolve_=n,t.onReject_=i,t}function u(t){return o(t,0,void 0,[],[])}function c(t,e){s(t,+1,e,t.onResolve_)}function a(t,e){s(t,-1,e,t.onReject_)}function s(t,e,r,n){0===t.status_&&(l(r,n),o(t,e,r))}function l(t,e){b(function(){for(var r=0;r=s)return t[o(c)]=void 0,n(void 0,!0);var l,f=e.charCodeAt(r);if(55296>f||f>56319||r+1===s)l=String.fromCharCode(f);else{var h=e.charCodeAt(r+1);l=56320>h||h>57343?String.fromCharCode(f):String.fromCharCode(f)+String.fromCharCode(h)}return t[o(a)]=r+l.length,n(l,!1)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(e,Symbol.iterator,{value:function(){return this},configurable:!0,enumerable:!0,writable:!0}),e),{}),{get createStringIterator(){return t}}}),System.registerModule("traceur-runtime@0.0.87/src/runtime/polyfills/String.js",[],function(){"use strict";function t(t){var e=String(this);if(null==this||"[object RegExp]"==p.call(t))throw TypeError();var r=e.length,n=String(t),i=(n.length,arguments.length>1?arguments[1]:void 0),o=i?Number(i):0;isNaN(o)&&(o=0);var u=Math.min(Math.max(o,0),r);return b.call(e,n,o)==u}function e(t){var e=String(this);if(null==this||"[object RegExp]"==p.call(t))throw TypeError();var r=e.length,n=String(t),i=n.length,o=r;if(arguments.length>1){var u=arguments[1];void 0!==u&&(o=u?Number(u):0,isNaN(o)&&(o=0))}var c=Math.min(Math.max(o,0),r),a=c-i;return 0>a?!1:y.call(e,n,a)==a}function r(t){if(null==this)throw TypeError();var e=String(this);if(t&&"[object RegExp]"==p.call(t))throw TypeError();var r=e.length,n=String(t),i=n.length,o=arguments.length>1?arguments[1]:void 0,u=o?Number(o):0;u!=u&&(u=0);var c=Math.min(Math.max(u,0),r);return i+c>r?!1:b.call(e,n,u)!=-1}function n(t){if(null==this)throw TypeError();var e=String(this),r=t?Number(t):0;if(isNaN(r)&&(r=0),0>r||r==1/0)throw RangeError();if(0==r)return"";for(var n="";r--;)n+=e;return n}function i(t){if(null==this)throw TypeError();var e=String(this),r=e.length,n=t?Number(t):0;if(isNaN(n)&&(n=0),0>n||n>=r)return void 0;var i,o=e.charCodeAt(n);return o>=55296&&56319>=o&&r>n+1&&(i=e.charCodeAt(n+1),i>=56320&&57343>=i)?1024*(o-55296)+i-56320+65536:o}function o(t){var e=t.raw,r=e.length>>>0;if(0===r)return"";for(var n="",i=0;!0;){if(n+=e[i],i+1===r)return n;n+=arguments[++i]}}function u(){var t,e,r=[],n=Math.floor,i=-1,o=arguments.length;if(!o)return"";for(;++iu||u>1114111||n(u)!=u)throw RangeError("Invalid code point: "+u);65535>=u?r.push(u):(u-=65536,t=(u>>10)+55296,e=u%1024+56320,r.push(t,e))}return String.fromCharCode.apply(null,r)}function c(){var t=$traceurRuntime.checkObjectCoercible(this),e=String(t);return s(e)}function a(a){var s=a.String;f(s.prototype,["codePointAt",i,"endsWith",e,"includes",r,"repeat",n,"startsWith",t]),f(s,["fromCodePoint",u,"raw",o]),h(s.prototype,c,Symbol)}var s=System.get("traceur-runtime@0.0.87/src/runtime/polyfills/StringIterator.js").createStringIterator,l=System.get("traceur-runtime@0.0.87/src/runtime/polyfills/utils.js"),f=l.maybeAddFunctions,h=l.maybeAddIterator,m=l.registerPolyfill,p=Object.prototype.toString,b=String.prototype.indexOf,y=String.prototype.lastIndexOf;return m(a),{get startsWith(){return t},get endsWith(){return e},get includes(){return r},get repeat(){return n},get codePointAt(){return i},get raw(){return o},get fromCodePoint(){return u},get stringPrototypeIterator(){return c},get polyfillString(){return a}}}),System.get("traceur-runtime@0.0.87/src/runtime/polyfills/String.js"+""),System.registerModule("traceur-runtime@0.0.87/src/runtime/polyfills/ArrayIterator.js",[],function(){"use strict";function t(t,e){var r=u(t),n=new h;return n.iteratorObject_=r,n.arrayIteratorNextIndex_=0,n.arrayIterationKind_=e,n}function e(){return t(this,f)}function r(){return t(this,s)}function n(){return t(this,l)}var i,o=System.get("traceur-runtime@0.0.87/src/runtime/polyfills/utils.js"),u=o.toObject,c=o.toUint32,a=o.createIteratorResultObject,s=1,l=2,f=3,h=function(){};return $traceurRuntime.createClass(h,(i={},Object.defineProperty(i,"next",{value:function(){var t=u(this),e=t.iteratorObject_;if(!e)throw new TypeError("Object is not an ArrayIterator");var r=t.arrayIteratorNextIndex_,n=t.arrayIterationKind_,i=c(e.length);return r>=i?(t.arrayIteratorNextIndex_=1/0,a(void 0,!0)):(t.arrayIteratorNextIndex_=r+1,n==l?a(e[r],!1):n==f?a([r,e[r]],!1):a(r,!1))},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,Symbol.iterator,{value:function(){return this},configurable:!0,enumerable:!0,writable:!0}),i),{}),{get entries(){return e},get keys(){return r},get values(){return n}}}),System.registerModule("traceur-runtime@0.0.87/src/runtime/polyfills/Array.js",[],function(){"use strict";function t(t){var e,r,n=arguments[1],i=arguments[2],o=this,u=j(t),c=void 0!==n,a=0;if(c&&!m(n))throw TypeError();if(h(u)){e=p(o)?new o:[];var s=!0,l=!1,f=void 0;try{for(var b=void 0,y=u[$traceurRuntime.toProperty(Symbol.iterator)]();!(s=(b=y.next()).done);s=!0){var v=b.value;e[a]=c?n.call(i,v,a):v,a++}}catch(g){l=!0,f=g}finally{try{s||null==y["return"]||y["return"]()}finally{if(l)throw f}}return e.length=a,e}for(r=d(u.length),e=p(o)?new o(r):new Array(r);r>a;a++)e[a]=c?"undefined"==typeof i?n(u[a],a):n.call(i,u[a],a):u[a];return e.length=r,e}function e(){for(var t=[],e=0;eo;o++)i[o]=t[o];return i.length=n,i}function r(t){var e=arguments[1]!==void 0?arguments[1]:0,r=arguments[2],n=j(this),i=d(n.length),o=g(e),u=void 0!==r?g(r):i;for(o=0>o?Math.max(i+o,0):Math.min(o,i),u=0>u?Math.max(i+u,0):Math.min(u,i);u>o;)n[o]=t,o++;return n}function n(t){var e=arguments[1];return o(this,t,e)}function i(t){var e=arguments[1];return o(this,t,e,!0)}function o(t,e){var r=arguments[2],n=arguments[3]!==void 0?arguments[3]:!1,i=j(t),o=d(i.length);if(!m(e))throw TypeError();for(var u=0;o>u;u++){var c=i[u];if(e.call(r,c,u,i))return n?u:c}return n?-1:void 0}function u(o){var u=o,c=u.Array,f=u.Object,h=u.Symbol,m=l;h&&h.iterator&&c.prototype[h.iterator]&&(m=c.prototype[h.iterator]),b(c.prototype,["entries",a,"keys",s,"values",m,"fill",r,"find",n,"findIndex",i]),b(c,["from",t,"of",e]),y(c.prototype,m,h),y(f.getPrototypeOf([].values()),function(){return this},h)}var c=System.get("traceur-runtime@0.0.87/src/runtime/polyfills/ArrayIterator.js"),a=c.entries,s=c.keys,l=c.values,f=System.get("traceur-runtime@0.0.87/src/runtime/polyfills/utils.js"),h=f.checkIterable,m=f.isCallable,p=f.isConstructor,b=f.maybeAddFunctions,y=f.maybeAddIterator,v=f.registerPolyfill,g=f.toInteger,d=f.toLength,j=f.toObject;return v(u),{get from(){return t},get of(){return e},get fill(){return r},get find(){return n},get findIndex(){return i},get polyfillArray(){return u}}}),System.get("traceur-runtime@0.0.87/src/runtime/polyfills/Array.js"+""),System.registerModule("traceur-runtime@0.0.87/src/runtime/polyfills/Object.js",[],function(){"use strict";function t(t,e){return t===e?0!==t||1/t===1/e:t!==t&&e!==e}function e(t){for(var e=1;ei;i++){var u=n[i];f(u)||(t[u]=r[u])}}return t}function r(t,e){var r,n,i=l(e),o=i.length;for(r=0;o>r;r++){var u=i[r];f(u)||(n=s(e,i[r]),a(t,i[r],n))}return t}function n(n){var i=n.Object;o(i,["assign",e,"is",t,"mixin",r])}var i=System.get("traceur-runtime@0.0.87/src/runtime/polyfills/utils.js"),o=i.maybeAddFunctions,u=i.registerPolyfill,c=$traceurRuntime,a=c.defineProperty,s=c.getOwnPropertyDescriptor,l=c.getOwnPropertyNames,f=c.isPrivateName,h=c.keys;return u(n),{get is(){return t},get assign(){return e},get mixin(){return r},get polyfillObject(){return n}}}),System.get("traceur-runtime@0.0.87/src/runtime/polyfills/Object.js"+""),System.registerModule("traceur-runtime@0.0.87/src/runtime/polyfills/Number.js",[],function(){"use strict";function t(t){return u(t)&&h(t)}function e(e){return t(e)&&l(e)===e}function r(t){return u(t)&&m(t)}function n(e){if(t(e)){var r=l(e);if(r===e)return f(r)<=p}return!1}function i(i){var o=i.Number;c(o,["MAX_SAFE_INTEGER",p,"MIN_SAFE_INTEGER",b,"EPSILON",y]),a(o,["isFinite",t,"isInteger",e,"isNaN",r,"isSafeInteger",n])}var o=System.get("traceur-runtime@0.0.87/src/runtime/polyfills/utils.js"),u=o.isNumber,c=o.maybeAddConsts,a=o.maybeAddFunctions,s=o.registerPolyfill,l=o.toInteger,f=Math.abs,h=isFinite,m=isNaN,p=Math.pow(2,53)-1,b=-Math.pow(2,53)+1,y=Math.pow(2,-52);return s(i),{get MAX_SAFE_INTEGER(){return p},get MIN_SAFE_INTEGER(){return b},get EPSILON(){return y},get isFinite(){return t},get isInteger(){return e},get isNaN(){return r},get isSafeInteger(){return n},get polyfillNumber(){return i}}}),System.get("traceur-runtime@0.0.87/src/runtime/polyfills/Number.js"+""),System.registerModule("traceur-runtime@0.0.87/src/runtime/polyfills/fround.js",[],function(){"use strict";function t(t,e,r){function n(t){var e=l(t),r=t-e;return.5>r?e:r>.5?e+1:e%2?e+1:e}var i,o,u,c,p,b,y,v=(1<t?1:0):0===t?(o=0,u=0,i=1/t===-(1/0)?1:0):(i=0>t,t=s(t),t>=m(2,1-v)?(o=h(l(f(t)/a),1023),u=n(t/m(2,o)*m(2,r)),u/m(2,r)>=2&&(o+=1,u=1),o>v?(o=(1<>=1;return f.reverse(),u=f.join(""),c=(1<0?a*m(2,s-c)*(1+l/m(2,r)):0!==l?a*m(2,-(c-1))*(l/m(2,r)):0>a?-0:0}function r(t){return e(t,8,23)}function n(e){return t(e,8,23)}function i(t){return 0===t||!o(t)||u(t)?t:r(n(Number(t)))}var o=isFinite,u=isNaN,c=Math,a=c.LN2,s=c.abs,l=c.floor,f=c.log,h=c.min,m=c.pow;return{get fround(){return i}}}),System.registerModule("traceur-runtime@0.0.87/src/runtime/polyfills/Math.js",[],function(){"use strict";function t(t){if(t=S(+t),0==t)return 32;var e=0;return 0===(4294901760&t)&&(t<<=16,e+=16),0===(4278190080&t)&&(t<<=8,e+=8),0===(4026531840&t)&&(t<<=4,e+=4),0===(3221225472&t)&&(t<<=2,e+=2),0===(2147483648&t)&&(t<<=1,e+=1),e}function e(t,e){t=S(+t),e=S(+e);var r=t>>>16&65535,n=65535&t,i=e>>>16&65535,o=65535&e;return n*o+(r*o+n*i<<16>>>0)|0}function r(t){return t=+t,t>0?1:0>t?-1:t}function n(t){return.4342944819032518*k(t)}function i(t){return 1.4426950408889634*k(t)}function o(t){if(t=+t,-1>t||_(t))return 0/0;if(0===t||t===1/0)return t;if(t===-1)return-(1/0);var e=0,r=50;if(0>t||t>1)return k(1+t);for(var n=1;r>n;n++)n%2===0?e-=I(t,n)/n:e+=I(t,n)/n;return e}function u(t){return t=+t,t===-(1/0)?-1:R(t)&&0!==t?$(t)-1:t}function c(t){return t=+t,0===t?1:_(t)?0/0:R(t)?(0>t&&(t=-t),t>21?$(t)/2:($(t)+$(-t))/2):1/0}function a(t){return t=+t,R(t)&&0!==t?($(t)-$(-t))/2:t}function s(t){if(t=+t,0===t)return t;if(!R(t))return r(t);var e=$(t),n=$(-t);return(e-n)/(e+n)}function l(t){return t=+t,1>t?0/0:R(t)?k(t+T(t+1)*T(t-1)):t}function f(t){return t=+t,0!==t&&R(t)?t>0?k(t+T(t*t+1)):-k(-t+T(t*t+1)):t}function h(t){return t=+t,t===-1?-(1/0):1===t?1/0:0===t?t:_(t)||-1>t||t>1?0/0:.5*k((1+t)/(1-t))}function m(){for(var t=arguments.length,e=new Array(t),r=0,n=0;t>n;n++){var i=arguments[n];if(i=+i,i===1/0||i===-(1/0))return 1/0;i=P(i),i>r&&(r=i),e[n]=i}0===r&&(r=1);for(var o=0,u=0,n=0;t>n;n++){var i=e[n]/r,c=i*i-u,a=o+c;u=a-o-c,o=a}return T(o)*r}function p(t){return t=+t,t>0?E(t):0>t?M(t):t}function b(t){if(t=+t,0===t)return t;var e=0>t;e&&(t=-t);var r=I(t,1/3);return e?-r:r}function y(y){var g=y.Math;w(g,["acosh",l,"asinh",f,"atanh",h,"cbrt",b,"clz32",t,"cosh",c,"expm1",u,"fround",v,"hypot",m,"imul",e,"log10",n,"log1p",o,"log2",i,"sign",r,"sinh",a,"tanh",s,"trunc",p])}var v,g,d=System.get("traceur-runtime@0.0.87/src/runtime/polyfills/fround.js").fround,j=System.get("traceur-runtime@0.0.87/src/runtime/polyfills/utils.js"),w=j.maybeAddFunctions,O=j.registerPolyfill,S=j.toUint32,R=isFinite,_=isNaN,x=Math,P=x.abs,M=x.ceil,$=x.exp,E=x.floor,k=x.log,I=x.pow,T=x.sqrt;return"function"==typeof Float32Array?(g=new Float32Array(1),v=function(t){return g[0]=Number(t),g[0]}):v=d,O(y),{get clz32(){return t},get imul(){return e},get sign(){return r},get log10(){return n},get log2(){return i},get log1p(){return o},get expm1(){return u},get cosh(){return c},get sinh(){return a},get tanh(){return s},get acosh(){return l},get asinh(){return f},get atanh(){return h},get hypot(){return m},get trunc(){return p},get fround(){return v},get cbrt(){return b},get polyfillMath(){return y}}}),System.get("traceur-runtime@0.0.87/src/runtime/polyfills/Math.js"+""),System.registerModule("traceur-runtime@0.0.87/src/runtime/polyfills/polyfills.js",[],function(){"use strict";var t=System.get("traceur-runtime@0.0.87/src/runtime/polyfills/utils.js").polyfillAll;t(Reflect.global);var e=$traceurRuntime.setupGlobals;return $traceurRuntime.setupGlobals=function(r){e(r),t(r)},{}}),System.get("traceur-runtime@0.0.87/src/runtime/polyfills/polyfills.js"+""); 4 | //# sourceMappingURL=traceur-runtime.js.map -------------------------------------------------------------------------------- /scripts/src/angular2.temp.d.ts: -------------------------------------------------------------------------------- 1 | // Until we have angular2 official full TypeScript definitions 2 | interface List extends Array { } 3 | declare var require: any; 4 | declare var __filename: string; 5 | declare var __dirname: string; 6 | declare var global: any; 7 | declare var zone: any; 8 | declare var Zone: any; 9 | 10 | interface IRequestOptions { } 11 | interface IRequest { } 12 | interface IResponse { } 13 | declare class Query { } 14 | declare class RecordType { } 15 | declare class TypeDecorator { } 16 | declare class URLSearchParams { } 17 | declare class ConnectionBackend { } 18 | declare class Connection { } 19 | declare class ReadyStates { } 20 | declare class RequestMethods { } 21 | declare class RequestModesOpts { } 22 | declare class RequestCredentialsOpts { } 23 | declare class RequestCacheOpts { } 24 | declare class ResponseTypes { } 25 | declare class ComponentRef { } 26 | 27 | interface WeakMap { 28 | clear(): void; 29 | delete(key: K): boolean; 30 | get(key: K): V; 31 | has(key: K): boolean; 32 | set(key: K, value?: V): WeakMap; 33 | [Symbol.toStringTag]: string; 34 | } 35 | 36 | interface WeakMapConstructor { 37 | new (): WeakMap; 38 | new (iterable: Iterable<[K, V]>): WeakMap; 39 | prototype: WeakMap; 40 | } 41 | declare var WeakMap: WeakMapConstructor; 42 | 43 | interface Iterable { 44 | [Symbol.iterator](): Iterator; 45 | } 46 | 47 | interface IteratorResult { 48 | done: boolean; 49 | value?: T; 50 | } 51 | 52 | interface Iterator { 53 | next(): IteratorResult; 54 | return?(value?: any): IteratorResult; 55 | throw?(e?: any): IteratorResult; 56 | } 57 | 58 | interface Symbol { 59 | toString(): string; 60 | valueOf(): Object; 61 | [Symbol.toStringTag]: string; 62 | } 63 | 64 | interface Map { } 65 | 66 | interface SymbolConstructor { 67 | prototype: Symbol; 68 | (description?: string|number): symbol; 69 | for(key: string): symbol; 70 | keyFor(sym: symbol): string; 71 | hasInstance: symbol; 72 | isConcatSpreadable: symbol; 73 | iterator: symbol; 74 | toPrimitive: symbol; 75 | toStringTag: symbol; 76 | unscopables: symbol; 77 | } 78 | declare var Symbol: SymbolConstructor; 79 | 80 | declare module 'angular2/src/services/url_resolver' { 81 | class UrlResolver { } 82 | } 83 | 84 | declare module "angular2/src/facade/async" { 85 | class Observable { } 86 | class EventEmitter { 87 | next(val: any) 88 | return(val: any) 89 | throw(val: any) 90 | } 91 | } 92 | 93 | declare module "angular2/src/render/dom/shadow_dom/style_url_resolver" { 94 | class StyleUrlResolver { } 95 | } 96 | 97 | declare module "angular2/src/core/life_cycle/life_cycle" { 98 | class LifeCycle { 99 | tick(): any; 100 | } 101 | } 102 | 103 | declare module "zone.js" { 104 | var zone: any; 105 | var Zone: any; 106 | } 107 | 108 | // declare module "angular2/directives" { 109 | // function NgSwitch(): void; 110 | // function NgSwitchWhen(): void; 111 | // function NgSwitchDefault(): void; 112 | // function NgNonBindable(): void; 113 | // function NgIf(): void; 114 | // function NgFor(): void; 115 | // 116 | // var formDirectives: any; 117 | // var coreDirectives: any; 118 | // 119 | // } 120 | // 121 | // declare module "angular2/core" { 122 | // class EmulatedScopedShadowDomStrategy { 123 | // constructor(styleInliner: any, styleUrlResolver: any, styleHost: any) 124 | // } 125 | // class EmulatedUnscopedShadowDomStrategy { 126 | // constructor(styleUrlResolver: any, styleHost: any) 127 | // } 128 | // class NativeShadowDomStrategy { 129 | // constructor(styleUrlResolver: any) 130 | // } 131 | // class ShadowDomStrategy {} 132 | // } 133 | 134 | // declare module "angular2/src/facade/browser" { 135 | // var __esModule: boolean; 136 | // var win: any; 137 | // var document: any; 138 | // var location: any; 139 | // var gc: () => void; 140 | // const Event: any; 141 | // const MouseEvent: any; 142 | // const KeyboardEvent: any; 143 | // } 144 | // 145 | // declare module "angular2/src/router/browser_location" { 146 | // class BrowserLocation { 147 | // path(): string 148 | // } 149 | // } 150 | // 151 | // declare module "angular2/src/router/location" { 152 | // class Location { 153 | // normalize(url: string): string 154 | // } 155 | // } 156 | // 157 | declare module "angular2/router" { 158 | class Instruction { } 159 | class Router { 160 | navigate(url: string): Promise; 161 | config(config: any): Promise; 162 | deactivate(): Promise; 163 | activate(instruction: Instruction): Promise; 164 | recognize(url: string): Instruction; 165 | recognize(url: string): Instruction; 166 | renavigate(): Promise; 167 | generate(name: string, params: any): string; 168 | subscribe(onNext: Function): void; 169 | registerOutlet(outlet: any, name: any) 170 | } 171 | var RouterOutlet: any; 172 | var RouterLink: any; 173 | var RouteParams: any; 174 | var routerInjectables: any; 175 | var RouteConfigAnnotation: any; 176 | var RouteConfig: any; 177 | } 178 | // 179 | // 180 | // declare module "angular2/src/dom/browser_adapter" { 181 | // class BrowserDomAdapter { 182 | // static makeCurrent(): void; 183 | // logError(error: any): void; 184 | // attrToPropMap: any; 185 | // query(selector: string): any; 186 | // querySelector(el: any, selector: string): Node; 187 | // querySelectorAll(el: any, selector: string): List; 188 | // on(el: any, evt: any, listener: any): void; 189 | // onAndCancel(el: any, evt: any, listener: any): Function; 190 | // dispatchEvent(el: any, evt: any): void; 191 | // createMouseEvent(eventType: string): MouseEvent; 192 | // createEvent(eventType: any): Event; 193 | // getInnerHTML(el: any): any; 194 | // getOuterHTML(el: any): any; 195 | // nodeName(node: Node): string; 196 | // nodeValue(node: Node): string; 197 | // type(node: HTMLInputElement): string; 198 | // content(node: Node): Node; 199 | // firstChild(el: any): Node; 200 | // nextSibling(el: any): Node; 201 | // parentElement(el: any): any; 202 | // childNodes(el: any): List; 203 | // childNodesAsList(el: any): List; 204 | // clearNodes(el: any): void; 205 | // appendChild(el: any, node: any): void; 206 | // removeChild(el: any, node: any): void; 207 | // replaceChild(el: Node, newChild: any, oldChild: any): void; 208 | // remove(el: any): any; 209 | // insertBefore(el: any, node: any): void; 210 | // insertAllBefore(el: any, nodes: any): void; 211 | // insertAfter(el: any, node: any): void; 212 | // setInnerHTML(el: any, value: any): void; 213 | // getText(el: any): any; 214 | // setText(el: any, value: string): void; 215 | // getValue(el: any): any; 216 | // setValue(el: any, value: string): void; 217 | // getChecked(el: any): any; 218 | // setChecked(el: any, value: boolean): void; 219 | // createTemplate(html: any): HTMLElement; 220 | // createElement(tagName: any, doc?: Document): HTMLElement; 221 | // createTextNode(text: string, doc?: Document): Text; 222 | // createScriptTag(attrName: string, attrValue: string, doc?: Document): HTMLScriptElement; 223 | // createStyleElement(css: string, doc?: Document): HTMLStyleElement; 224 | // createShadowRoot(el: HTMLElement): DocumentFragment; 225 | // getShadowRoot(el: HTMLElement): DocumentFragment; 226 | // getHost(el: HTMLElement): HTMLElement; 227 | // clone(node: Node): Node; 228 | // hasProperty(element: any, name: string): boolean; 229 | // getElementsByClassName(element: any, name: string): any; 230 | // getElementsByTagName(element: any, name: string): any; 231 | // classList(element: any): List; 232 | // addClass(element: any, classname: string): void; 233 | // removeClass(element: any, classname: string): void; 234 | // hasClass(element: any, classname: string): any; 235 | // setStyle(element: any, stylename: string, stylevalue: string): void; 236 | // removeStyle(element: any, stylename: string): void; 237 | // getStyle(element: any, stylename: string): any; 238 | // tagName(element: any): string; 239 | // attributeMap(element: any): any; 240 | // hasAttribute(element: any, attribute: string): any; 241 | // getAttribute(element: any, attribute: string): any; 242 | // setAttribute(element: any, name: string, value: string): void; 243 | // removeAttribute(element: any, attribute: string): any; 244 | // templateAwareRoot(el: any): any; 245 | // createHtmlDocument(): Document; 246 | // defaultDoc(): Document; 247 | // getBoundingClientRect(el: any): any; 248 | // getTitle(): string; 249 | // setTitle(newTitle: string): void; 250 | // elementMatches(n: any, selector: string): boolean; 251 | // isTemplateElement(el: any): boolean; 252 | // isTextNode(node: Node): boolean; 253 | // isCommentNode(node: Node): boolean; 254 | // isElementNode(node: Node): boolean; 255 | // hasShadowRoot(node: any): boolean; 256 | // isShadowRoot(node: any): boolean; 257 | // importIntoDoc(node: Node): Node; 258 | // isPageRule(rule: any): boolean; 259 | // isStyleRule(rule: any): boolean; 260 | // isMediaRule(rule: any): boolean; 261 | // isKeyframesRule(rule: any): boolean; 262 | // getHref(el: Element): string; 263 | // getEventKey(event: any): string; 264 | // getGlobalEventTarget(target: string): EventTarget; 265 | // getHistory(): History; 266 | // getLocation(): Location; 267 | // getBaseHref(): any; 268 | // } 269 | // } 270 | // 271 | // declare module "angular2/angular2" { 272 | // function bootstrap(appComponentType: any, componentInjectableBindings?: Array, errorReporter?: Function): Promise; 273 | // 274 | // var JitProtoChangeDetector: any; 275 | // var uninitialized: any; 276 | // var defaultPipes: any; 277 | // var ___esModule: any; 278 | // interface OnChange {} 279 | // var appComponentAnnotatedTypeToken: any; 280 | // interface TemplateLoader {} 281 | // interface ShadowDomStrategy {} 282 | // interface NativeShadowDomStrategy {} 283 | // interface EmulatedScopedShadowDomStrategy {} 284 | // interface EmulatedUnscopedShadowDomStrategy {} 285 | // var Ancestor: any; 286 | // var Parent: any; 287 | // var Attribute: any; 288 | // interface ControlDirective {} 289 | // interface ControlGroupDirective {} 290 | // interface RequiredValidatorDirective {} 291 | // interface EventDispatcher {} 292 | // } 293 | // 294 | declare module "angular2/di" { 295 | 296 | function bind(token: any): any; 297 | class Injector { 298 | resolveAndCreateChild(bindings: [any]): Injector; 299 | } 300 | var Binding: any; 301 | var ResolvedBinding: any; 302 | var Dependency: any; 303 | var Key: any; 304 | var KeyRegistry: any; 305 | var TypeLiteral: any; 306 | var NoBindingError: any; 307 | var AbstractBindingError: any; 308 | var AsyncBindingError: any; 309 | var CyclicDependencyError: any; 310 | var InstantiationError: any; 311 | var InvalidBindingError: any; 312 | var NoAnnotationError: any; 313 | var OpaqueToken: any; 314 | var ___esModule: any; 315 | var InjectAnnotation: any; 316 | var InjectPromiseAnnotation: any; 317 | var InjectLazyAnnotation: any; 318 | var OptionalAnnotation: any; 319 | var InjectableAnnotation: any; 320 | var DependencyAnnotation: any; 321 | var Inject: any; 322 | var InjectPromise: any; 323 | var InjectLazy: any; 324 | var Optional: any; 325 | var Injectable: any; 326 | } 327 | 328 | declare module "angular2/http" { 329 | export interface IHttp { (url: string, options?: IRequestOptions): any } 330 | export interface ConnectionBackend { 331 | createConnection(observer: any, config: IRequest): Connection; 332 | } 333 | 334 | export class ReadyStates { } 335 | 336 | export interface Connection { 337 | readyState: ReadyStates; 338 | request: IRequest; 339 | response: Rx.Subject; 340 | dispose(): void; 341 | } 342 | 343 | export class Headers { 344 | _headersMap: Map>; 345 | append(name: string, value: string): void; 346 | delete(name: string): void; 347 | forEach(fn: Function); 348 | get(header: string): string; 349 | has(header: string); 350 | keys(); 351 | set(header: string, value: string | List): void; 352 | values(); 353 | getAll(header: string): Array; 354 | entries(); 355 | } 356 | 357 | export interface IRequestOptions { 358 | method?: any; 359 | headers?: Headers; 360 | body?: FormData | Blob | string; 361 | mode?: any; 362 | credentials?: any; 363 | cache?: any; 364 | } 365 | 366 | export interface IRequest { 367 | method: any; 368 | mode: any; 369 | credentials: any; 370 | } 371 | 372 | export interface ResponseOptions { 373 | status?: number; 374 | statusText?: string; 375 | headers?: Headers | Object; 376 | type?: any; 377 | url?: string; 378 | } 379 | 380 | export interface IResponse { 381 | headers: Headers; 382 | ok: boolean; 383 | status: number; 384 | statusText: string; 385 | type: any; 386 | url: string; 387 | totalBytes: number; 388 | bytesLoaded: number; 389 | blob(): Blob; 390 | arrayBuffer(): ArrayBuffer; 391 | text(): string; 392 | json(): Object; 393 | } 394 | 395 | export class Http { 396 | request(url: string | Request, options?: IRequestOptions): Rx.Observable; 397 | get(url: string, options?: IRequestOptions); 398 | post(url: string, body: FormData | Blob | string, options?: IRequestOptions); 399 | put(url: string, body: FormData | Blob | string, options?: IRequestOptions); 400 | delete(url: string, options?: IRequestOptions); 401 | patch(url: string, body: FormData | Blob | string, options?: IRequestOptions); 402 | head(url: string, options?: IRequestOptions); 403 | } 404 | 405 | export class Request implements IRequest { 406 | method: RequestMethods; 407 | mode: RequestModesOpts; 408 | credentials: RequestCredentialsOpts; 409 | headers: Headers; 410 | url: string; 411 | text(): String; 412 | } 413 | 414 | export class Response implements IResponse { 415 | type: ResponseTypes; 416 | ok: boolean; 417 | url: string; 418 | status: number; 419 | statusText: string; 420 | bytesLoaded: number; 421 | totalBytes: number; 422 | headers: Headers; 423 | blob(): Blob; 424 | json(): JSON; 425 | text(): string; 426 | arrayBuffer(): ArrayBuffer; 427 | } 428 | 429 | class ResponseTypes { } 430 | 431 | export class httpInjectables { } 432 | } 433 | -------------------------------------------------------------------------------- /scripts/src/bootstrap.ts: -------------------------------------------------------------------------------- 1 | // Angular2 2 | import {bootstrap} from 'angular2/angular2'; 3 | // Angular2 Router Injectables https://github.com/angular/angular/blob/f999d5a1566d3b830fd1a23ed554cbed4e1215e8/modules/angular2/router.ts 4 | import {routerInjectables} from 'angular2/router'; 5 | import {DummyService} from './services/dummyService' 6 | import {httpInjectables} from 'angular2/http'; 7 | 8 | import {MyApp} from './components/app/app'; 9 | 10 | // Second parameter provides a set of additional bindings 11 | // that will be used by Component (in our case application) 12 | // read more here: https://angular.io/docs/js/latest/api/core/bootstrap-function.html 13 | bootstrap(MyApp, [routerInjectables, httpInjectables, DummyService]); 14 | -------------------------------------------------------------------------------- /scripts/src/components/about/about.ts: -------------------------------------------------------------------------------- 1 | import {Component, View} from 'angular2/angular2'; 2 | import { _settings } from '../../settings' 3 | 4 | @Component({ 5 | selector: 'about' 6 | }) 7 | @View({ 8 | template: "
About
" 9 | }) 10 | // Component controller 11 | export class About { 12 | constructor() { 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /scripts/src/components/app/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello {{ name }}

4 | 8 | -------------------------------------------------------------------------------- /scripts/src/components/app/app.ts: -------------------------------------------------------------------------------- 1 | import {Component, View} from 'angular2/angular2'; 2 | import {Router, RouteConfig, RouterLink, RouterOutlet} from 'angular2/router'; 3 | import { Inject} from 'angular2/di'; 4 | 5 | import { _settings } from '../../settings' 6 | import {Sidebar} from '../sidebar/sidebar' 7 | import {Home} from '../home/home' 8 | import {About} from '../about/about' 9 | 10 | @Component({ 11 | selector: 'my-app' 12 | }) 13 | @View({ 14 | templateUrl: _settings.buildPath + '/components/app/app.html', 15 | directives: [Sidebar, RouterLink, RouterOutlet] 16 | }) 17 | 18 | // This is one way of configuring an application router 19 | // The second way is shown bellow, inside MyApp controller 20 | // @RouteConfig([ 21 | // { path: '/', as: 'home', component: Home }, 22 | // { path: '/about', as: 'about', component: About } 23 | // ]) 24 | // Component controller 25 | export class MyApp { 26 | name: string; 27 | constructor(@Inject(Router) router: Router) { 28 | this.name = 'Alice'; 29 | // here is the socond way of configuring router 30 | // simply inject router and configure from within a constructor or helper function 31 | router.config([ 32 | { path: '', as: 'home', component: Home }, 33 | { path: '/about', as: 'about', component: About } 34 | ]); 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /scripts/src/components/home/home.ts: -------------------------------------------------------------------------------- 1 | import {Component, View} from 'angular2/angular2'; 2 | import { _settings } from '../../settings' 3 | 4 | @Component({ 5 | selector: 'home' 6 | }) 7 | @View({ 8 | template: "
Home
" 9 | }) 10 | // Component controller 11 | export class Home { 12 | constructor() { 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /scripts/src/components/sidebar/sidebar.html: -------------------------------------------------------------------------------- 1 |
Sidebar
2 | 3 |
4 | {{a}} 5 |
6 |
7 | 10 |
11 | {{achievement.title}} {{achievement.type}} 12 |
-------------------------------------------------------------------------------- /scripts/src/components/sidebar/sidebar.ts: -------------------------------------------------------------------------------- 1 | import {Component, View, NgFor} from 'angular2/angular2'; 2 | import { _settings } from '../../settings'; 3 | import {DummyService} from '../../services/dummyService'; 4 | import {Inject} from 'angular2/di'; 5 | import { Http, httpInjectables} from 'angular2/http'; 6 | 7 | var dummyServiceMap = new WeakMap(); 8 | 9 | @Component({ 10 | selector: 'sidebar', 11 | injectables: [DummyService, Http] 12 | }) 13 | @View({ 14 | templateUrl : _settings.buildPath + "/components/sidebar/sidebar.html", 15 | directives: [NgFor] 16 | }) 17 | // Component controller 18 | export class Sidebar { 19 | myStrings : Array; 20 | value: string; 21 | achievements: Array; 22 | 23 | constructor(@Inject(DummyService) dummyService: DummyService) { 24 | this.myStrings = ['123','456','789']; 25 | this.value="Message"; 26 | // 27 | console.log(dummyService.getSomeData()); 28 | 29 | dummyServiceMap.set(this, dummyService); 30 | 31 | this.getAchievements('major'); 32 | 33 | setTimeout(() => { 34 | this.value = dummyService.getServerData().name; 35 | this.getAchievements('medium'); 36 | }, 1000); 37 | 38 | setTimeout(() => { 39 | this.getAchievements('minor'); 40 | }, 3000); 41 | } 42 | 43 | getAchievements(type: string){ 44 | dummyServiceMap.get(this).getAchievements(type) 45 | .map(r => r.json()) 46 | .subscribe(a => { 47 | if(!this.achievements || this.achievements.length === 0){ 48 | this.achievements = a; 49 | } 50 | else{ 51 | this.achievements.push(...a); 52 | } 53 | }); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /scripts/src/directives/tooltip.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EladRK/angular-starter/498eb0ee2832fffb1ac65807810ab3af7e83d2be/scripts/src/directives/tooltip.ts -------------------------------------------------------------------------------- /scripts/src/services/dummyService.ts: -------------------------------------------------------------------------------- 1 | import {Component, View} from 'angular2/angular2'; 2 | import { Inject} from 'angular2/di'; 3 | import {Http} from 'angular2/http'; 4 | 5 | var httpMap = new WeakMap(); 6 | export class DummyService 7 | { 8 | myData : Array; 9 | serverData: any; 10 | 11 | constructor(@Inject(Http) http:Http){ 12 | this.myData = new Array(); 13 | 14 | this.myData.push('milk'); 15 | this.myData.push('honey'); 16 | this.myData.push('cheese'); 17 | 18 | httpMap.set(this, http); 19 | 20 | http.get('/api/sample') 21 | .map(response => response.json()) 22 | .subscribe(data => { 23 | this.serverData = data; 24 | }); 25 | } 26 | 27 | getSomeData() : Array 28 | { 29 | return this.myData; 30 | } 31 | 32 | getServerData(): any{ 33 | return this.serverData; 34 | } 35 | 36 | getAchievements(type: string): any{ 37 | var path = '/api/achievements/' + type; 38 | console.log(path); 39 | return httpMap.get(this).get(path); 40 | } 41 | } -------------------------------------------------------------------------------- /scripts/src/settings.ts: -------------------------------------------------------------------------------- 1 | //settings object - currently angular does not support syntax 2 | //of setting relative path to templateUrl 3 | //so we will save it externally as settings const 4 | 5 | export const _settings = { 6 | buildPath: 'scripts/build' 7 | }; 8 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var bodyParser = require('body-parser'); 3 | var _ = require('underscore'); 4 | 5 | var app = express(); 6 | 7 | app.use(bodyParser.json()); 8 | app.use(bodyParser.urlencoded({ extended: true })); 9 | 10 | app.use(express.static('public')); 11 | app.use(require('connect-livereload')()); 12 | 13 | app.get('/', function (request, response) { 14 | response.sendfile('public/index.html'); 15 | }); 16 | 17 | app.get('/api/sample', function(request, response){ 18 | response.send({name:"Ravi"}); 19 | }); 20 | 21 | app.get('/api/achievements/:type', function(request, response) { 22 | var achievements=[ 23 | { 24 | title:'Received Microsoft MVP Award', 25 | type:'major' 26 | }, 27 | { 28 | title:'Approved as SitePoint author', 29 | type:'major' 30 | }, 31 | { 32 | title:'Approved as DotnetCurry author', 33 | type:'major' 34 | }, 35 | { 36 | title:'Mention on ASP.NET', 37 | type:'medium' 38 | }, 39 | { 40 | title:'First article published on SitePoint', 41 | type:'minor' 42 | }, 43 | { 44 | title:'Got a side project', 45 | type:'minor' 46 | }, 47 | { 48 | title:'Boss patted me for my work', 49 | type:'minor' 50 | } 51 | ]; 52 | 53 | response.send(_.filter(achievements, function(a){ 54 | return a.type === request.params.type; 55 | })); 56 | }); 57 | 58 | app.listen(8000, function () { 59 | console.log('Express server started!!!'); 60 | }); 61 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "removeComments": true, 5 | "preserveConstEnums": true, 6 | "sourceMap": true, 7 | "target": "ES5" 8 | } 9 | } -------------------------------------------------------------------------------- /tsd.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "v4", 3 | "repo": "borisyankov/DefinitelyTyped", 4 | "ref": "master", 5 | "path": "typings", 6 | "bundle": "typings/tsd.d.ts", 7 | "installed": { 8 | "es6-promise/es6-promise.d.ts": { 9 | "commit": "6f04d25ad38982d372cc3cda62fa4c0eef9e24d7" 10 | }, 11 | "rx/rx.d.ts": { 12 | "commit": "6f04d25ad38982d372cc3cda62fa4c0eef9e24d7" 13 | }, 14 | "rx/rx-lite.d.ts": { 15 | "commit": "6f04d25ad38982d372cc3cda62fa4c0eef9e24d7" 16 | }, 17 | "angular2/angular2.d.ts": { 18 | "commit": "6f04d25ad38982d372cc3cda62fa4c0eef9e24d7" 19 | } 20 | } 21 | } 22 | --------------------------------------------------------------------------------