[
  {
    "path": ".gitignore",
    "content": ".idea\nbuild\nnode_modules\ntypings"
  },
  {
    "path": "LICENCE",
    "content": "MIT License\n\nCopyright (c) 2016 Rafal Borowiec\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "Angular2 with TypeScript and Gulp\n=================================\n\nA basic Angular2 application with Gulp as build system.\n\n#### 1. Prerequisites\n\n*nodejs* must be installed on your system and the below global node packages must be installed:\n\n- gulp\n\n> npm i -g gulp\n\n- gulp-cli\n\n> npm i -g gulp-cli\n\n- typings\n\n> npm i -g typings@1.3.3\n\n- typescript\n\n> npm i -g typescript@2.0.2\n\n- ts-node\n\n> npm i -g ts-node@1.3.0\n\n#### 2. Cloning the repository\n\nClone the repository:\n\n> git clone https://github.com/kolorobot/angular2-typescript-gulp.git\n\nNavigate to `angular2-typescript-gulp` directory:\n\n> cd angular2-typescript-gulp\n\n#### 3. Installing dependencies\n\nInstall dependencies by running the following command:\n\n> npm install\n\n`node_modules` and `typings` directories will be created during the install.\n\n#### 4. Building the project\n\nBuild the project by running the following command:\n\n> npm run clean & npm run build\n\n`build` directory will be created during the build\n\n#### 5. Starting the application\n\nStart the application by running the following command:\n\n> npm start\n\nThe application will be displayed in the browser.\n\nResources\n---------\n\n- [A step-by-step tutorial](http://blog.codeleak.pl/2016/03/quickstart-angular2-with-typescript-and.html)\n"
  },
  {
    "path": "bs-config.json",
    "content": "{\n  \"port\": 8000,\n  \"files\": [\n    \"build/**/*.{html,htm,css,js}\"\n  ],\n  \"server\": {\n    \"baseDir\": \"build\"\n  }\n}"
  },
  {
    "path": "gulpfile.ts",
    "content": "\"use strict\";\n\nconst gulp = require(\"gulp\");\nconst del = require(\"del\");\nconst tsc = require(\"gulp-typescript\");\nconst sourcemaps = require('gulp-sourcemaps');\nconst tsProject = tsc.createProject(\"tsconfig.json\");\nconst tslint = require('gulp-tslint');\n\n/**\n * Remove build directory.\n */\ngulp.task('clean', (cb) => {\n    return del([\"build\"], cb);\n});\n\n/**\n * Lint all custom TypeScript files.\n */\ngulp.task('tslint', () => {\n    return gulp.src(\"src/**/*.ts\")\n        .pipe(tslint({\n            formatter: 'prose'\n        }))\n        .pipe(tslint.report());\n});\n\n/**\n * Compile TypeScript sources and create sourcemaps in build directory.\n */\ngulp.task(\"compile\", [\"tslint\"], () => {\n    let tsResult = gulp.src(\"src/**/*.ts\")\n        .pipe(sourcemaps.init())\n        .pipe(tsProject());\n    return tsResult.js\n        .pipe(sourcemaps.write(\".\", {sourceRoot: '/src'}))\n        .pipe(gulp.dest(\"build\"));\n});\n\n/**\n * Copy all resources that are not TypeScript files into build directory.\n */\ngulp.task(\"resources\", () => {\n    return gulp.src([\"src/**/*\", \"!**/*.ts\"])\n        .pipe(gulp.dest(\"build\"));\n});\n\n/**\n * Copy all required libraries into build directory.\n */\ngulp.task(\"libs\", () => {\n    return gulp.src([\n            'core-js/client/shim.min.js',\n            'systemjs/dist/system-polyfills.js',\n            'systemjs/dist/system.src.js',\n            'reflect-metadata/Reflect.js',\n            'rxjs/**/*.js',\n            'zone.js/dist/**',\n            '@angular/**/bundles/**'\n        ], {cwd: \"node_modules/**\"}) /* Glob required here. */\n        .pipe(gulp.dest(\"build/lib\"));\n});\n\n/**\n * Watch for changes in TypeScript, HTML and CSS files.\n */\ngulp.task('watch', function () {\n    gulp.watch([\"src/**/*.ts\"], ['compile']).on('change', function (e) {\n        console.log('TypeScript file ' + e.path + ' has been changed. Compiling.');\n    });\n    gulp.watch([\"src/**/*.html\", \"src/**/*.css\"], ['resources']).on('change', function (e) {\n        console.log('Resource file ' + e.path + ' has been changed. Updating.');\n    });\n});\n\n/**\n * Build the project.\n */\ngulp.task(\"build\", ['compile', 'resources', 'libs'], () => {\n    console.log(\"Building the project ...\");\n});"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"angular2-typescript-gulp\",\n  \"version\": \"1.0.0\",\n  \"description\": \"Angular2 with TypeScript and Gulp QuickStart\",\n  \"scripts\": {\n    \"clean\": \"gulp clean\",\n    \"compile\": \"gulp compile\",\n    \"build\": \"gulp build\",\n    \"start\": \"concurrent --kill-others \\\"gulp watch\\\" \\\"lite-server\\\"\",\n    \"postinstall\": \"typings install\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/kolorobot/angular2-typescript-gulp.git\"\n  },\n  \"author\": \"Rafał Borowiec\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/kolorobot/angular2-typescript-gulp/issues\"\n  },\n  \"dependencies\": {\n    \"@angular/common\": \"~2.2.4\",\n    \"@angular/compiler\": \"~2.2.4\",\n    \"@angular/core\": \"~2.2.4\",\n    \"@angular/forms\": \"~2.2.4\",\n    \"@angular/http\": \"~2.2.4\",\n    \"@angular/platform-browser\": \"~2.2.4\",\n    \"@angular/platform-browser-dynamic\": \"~2.2.4\",\n    \"@angular/router\": \"~3.2.4\",\n    \"@angular/upgrade\": \"~2.2.4\",\n\n    \"core-js\": \"^2.4.1\",\n    \"reflect-metadata\": \"^0.1.3\",\n    \"rxjs\": \"5.0.0-beta.12\",\n    \"systemjs\": \"0.19.27\",\n    \"zone.js\": \"^0.6.23\"\n  },\n  \"devDependencies\": {\n    \"concurrently\": \"^3.1.0\",\n    \"del\": \"^2.2.0\",\n    \"gulp\": \"^3.9.1\",\n    \"gulp-sourcemaps\": \"^1.9.1\",\n    \"gulp-tslint\": \"^7.0.1\",\n    \"gulp-typescript\": \"^3.1.3\",\n    \"lite-server\": \"^2.2.2\",\n    \"tslint\": \"^4.0.2\",\n    \"typescript\": \"^2.1.4\",\n    \"typings\": \"^2.0.0\",\n    \"ts-node\": \"^1.7.2\"\n  }\n}\n"
  },
  {
    "path": "src/app/about/components/about.component.ts",
    "content": "import {Component} from \"@angular/core\";\nimport {OnInit} from \"@angular/core\";\n\n@Component({\n    templateUrl: './app/about/components/about.html'\n})\nexport class AboutComponent implements OnInit {\n\n    ngOnInit() {\n\n    }\n}"
  },
  {
    "path": "src/app/about/components/about.html",
    "content": "<h1>About</h1>\n<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>"
  },
  {
    "path": "src/app/app.component.ts",
    "content": "import {Component, OnInit} from \"@angular/core\";\n\n@Component({\n    selector: \"app\",\n    templateUrl: \"./app/app.html\"\n})\nexport class AppComponent implements OnInit {\n    ngOnInit() {\n        console.log(\"Application component initialized ...\");\n    }\n}"
  },
  {
    "path": "src/app/app.html",
    "content": "<section>\n    <nav>\n        <a routerLink=\"/tasks\">Task List</a>\n        <a routerLink=\"/about\">About</a>\n    </nav>\n    <router-outlet></router-outlet>\n</section>"
  },
  {
    "path": "src/app/app.module.ts",
    "content": "import {NgModule}      from '@angular/core';\nimport {BrowserModule} from '@angular/platform-browser';\n\nimport {AppComponent} from \"./app.component\";\nimport {TaskListComponent} from \"./todo/components/task-list.component\";\nimport {AboutComponent} from \"./about/components/about.component\";\nimport {TaskComponent} from \"./todo/components/task.component\";\n\nimport {routing, appRoutingProviders} from './app.routing';\nimport {FormsModule} from \"@angular/forms\";\n\n@NgModule({\n    imports: [\n        BrowserModule,\n        FormsModule,\n        routing\n    ],\n    declarations: [\n        AppComponent,\n        TaskComponent,\n        TaskListComponent,\n        AboutComponent\n    ],\n    providers: [\n        appRoutingProviders\n    ],\n    bootstrap: [AppComponent]\n})\nexport class AppModule {\n}"
  },
  {
    "path": "src/app/app.routing.ts",
    "content": "import {Routes, RouterModule} from \"@angular/router\";\nimport {TaskListComponent} from \"./todo/components/task-list.component\";\nimport {AboutComponent} from \"./about/components/about.component\";\nimport {ModuleWithProviders} from \"@angular/core\";\n\nconst appRoutes: Routes = [\n    {path: '', redirectTo: 'tasks', pathMatch: 'full'},\n    {path: 'tasks', component: TaskListComponent, data: {title: 'TaskList'}},\n    {path: 'about', component: AboutComponent, data: {title: 'About'}}\n];\n\nexport const appRoutingProviders: any[] = [];\nexport const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes, { useHash: true });\n"
  },
  {
    "path": "src/app/main.ts",
    "content": "///<reference path=\"../../typings/index.d.ts\"/>\n\nimport {platformBrowserDynamic} from '@angular/platform-browser-dynamic';\nimport {AppModule} from './app.module';\n\nconst platform = platformBrowserDynamic();\n\nplatform.bootstrapModule(AppModule);"
  },
  {
    "path": "src/app/todo/components/task-list.component.ts",
    "content": "import {Component} from \"@angular/core\";\nimport {Task} from \"../models/task\";\nimport {OnInit} from \"@angular/core\";\nimport {TaskService} from \"../services/task-service\";\nimport {TaskComponent} from \"./task.component\";\n\n@Component({\n    selector: 'task-list',\n    templateUrl: './app/todo/components/task-list.html',\n    styleUrls: ['./app/todo/components/task-list.css'],\n    providers: [TaskService]\n})\nexport class TaskListComponent implements OnInit {\n\n    todoCount:number;\n    selectedTask:Task;\n    tasks:Array<Task>;\n\n    constructor(private _taskService:TaskService) {\n        this.tasks = _taskService.getTasks();\n        this.calculateTodoCount();\n    }\n\n    ngOnInit() {\n        console.log(\"Todo component initialized with \" + this.tasks.length + \" tasks.\");\n    }\n\n    calculateTodoCount() {\n        this.todoCount = this.tasks.filter(t => !t.done).length;\n    }\n\n    select(task:Task) {\n        this.selectedTask = task;\n    }\n}"
  },
  {
    "path": "src/app/todo/components/task-list.css",
    "content": "li.selected {\n    background-color: #8a8a8a;\n}"
  },
  {
    "path": "src/app/todo/components/task-list.html",
    "content": "<h1>Todo tasks ({{todoCount}})</h1>\n<ul>\n    <li *ngFor=\"let task of tasks\" [class.selected]=\"task == selectedTask\">\n        <a href=\"javascript:void(0)\" (click)=\"select(task)\">\n            {{task.name}}\n            <span [ngSwitch]=\"task.done\">\n                <template [ngSwitchCase]=\"true\">[Done]</template>\n                <template [ngSwitchCase]=\"false\">[Todo]</template>\n            </span>\n        </a>\n    </li>\n</ul>\n\n<task *ngIf=\"selectedTask\" [task]=\"selectedTask\" (statusChanged)=\"calculateTodoCount()\"></task>"
  },
  {
    "path": "src/app/todo/components/task.component.ts",
    "content": "import {Component} from \"@angular/core\";\nimport {Input} from \"@angular/core\";\n\nimport {Task} from \"../models/task\";\nimport {Output} from \"@angular/core\";\nimport {EventEmitter} from \"@angular/core\";\n\n@Component({\n    selector: 'task',\n    templateUrl: './app/todo/components/task.html'\n})\nexport class TaskComponent {\n    @Input() task:Task;\n    @Output() statusChanged:any = new EventEmitter<any>();\n\n    toggleDone() {\n        this.task.toggleDone();\n        this.statusChanged.emit(null);\n    }\n}\n"
  },
  {
    "path": "src/app/todo/components/task.html",
    "content": "<form role=\"form\">\n    <input title=\"Name\" type=\"text\" [(ngModel)]=\"task.name\" name=\"name\" [disabled]=\"task.done\" />\n    <input title=\"Done\" type=\"checkbox\" (click)=\"toggleDone()\" [checked]=\"task.done\" />\n</form>\n"
  },
  {
    "path": "src/app/todo/models/task.ts",
    "content": "export class Task {\n\n    constructor(public name:string, public done:boolean) {\n    }\n\n    toggleDone() {\n        this.done = !this.done;\n    }\n}"
  },
  {
    "path": "src/app/todo/services/task-service.ts",
    "content": "import {Injectable} from \"@angular/core\";\nimport {Task} from \"../models/task\";\n\n@Injectable()\nexport class TaskService {\n\n    private tasks:Array<Task> = [\n        new Task(\"Task 1\", false),\n        new Task(\"Task 2\", false),\n        new Task(\"Task 3\", false),\n        new Task(\"Task 4\", false),\n        new Task(\"Task 5\", false)\n    ];\n\n    getTasks():Array<Task> {\n        return this.tasks;\n    }\n\n    addTask(name:string) {\n        this.tasks.push(new Task(name, false));\n    }\n\n}"
  },
  {
    "path": "src/index.html",
    "content": "<html>\n<head>\n    <title>Angular 2 TypeScript Gulp QuickStart</title>\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n    <!-- 1. Load libraries -->\n    <!-- Polyfill(s) for older browsers -->\n    <script src=\"lib/core-js/client/shim.min.js\"></script>\n\n    <script src=\"lib/zone.js/dist/zone.js\"></script>\n    <script src=\"lib/reflect-metadata/Reflect.js\"></script>\n    <script src=\"lib/systemjs/dist/system.src.js\"></script>\n\n    <!-- 2. Configure SystemJS -->\n    <script src=\"systemjs.config.js\"></script>\n    <script>\n        System.import('app')\n                .then(null, console.error.bind(console));\n    </script>\n\n</head>\n\n<!-- 3. Display the application -->\n<body>\n<app>Loading...</app>\n</body>\n\n</html>\n"
  },
  {
    "path": "src/systemjs.config.js",
    "content": "(function (global) {\n    System.config({\n        paths: {\n            // paths serve as alias\n            'npm:': 'lib/'\n        },\n        // map tells the System loader where to look for things\n        map: {\n            // our app is within the app folder\n            app: 'app',\n            // angular bundles\n            '@angular/core': 'npm:@angular/core/bundles/core.umd.js',\n            '@angular/common': 'npm:@angular/common/bundles/common.umd.js',\n            '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',\n            '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',\n            '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',\n            '@angular/http': 'npm:@angular/http/bundles/http.umd.js',\n            '@angular/router': 'npm:@angular/router/bundles/router.umd.js',\n            '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',\n            // other libraries\n            'rxjs': 'npm:rxjs'\n        },\n        // packages tells the System loader how to load when no filename and/or no extension\n        packages: {\n            app: {\n                main: './main.js',\n                defaultExtension: 'js'\n            },\n            rxjs: {\n                defaultExtension: 'js'\n            }\n        }\n    });\n})(this);\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"outDir\": \"build/app\",\n    \"target\": \"es5\",\n    \"module\": \"system\",\n    \"moduleResolution\": \"node\",\n    \"sourceMap\": true,\n    \"emitDecoratorMetadata\": true,\n    \"experimentalDecorators\": true,\n    \"removeComments\": false,\n    \"noImplicitAny\": false\n  },\n  \"exclude\": [\n    \"gulpfile.ts\",\n    \"node_modules\"\n  ]\n}"
  },
  {
    "path": "tslint.json",
    "content": "{\n  \"rules\": {\n    \"class-name\": true,\n    \"curly\": true,\n    \"eofline\": false,\n    \"forin\": true,\n    \"indent\": [\n      true,\n      4\n    ],\n    \"label-position\": true,\n    \"max-line-length\": [\n      true,\n      140\n    ],\n    \"no-arg\": true,\n    \"no-bitwise\": true,\n    \"no-console\": [\n      true,\n      \"debug\",\n      \"info\",\n      \"time\",\n      \"timeEnd\",\n      \"trace\"\n    ],\n    \"no-construct\": true,\n    \"no-debugger\": true,\n    \"no-duplicate-variable\": true,\n    \"no-empty\": false,\n    \"no-eval\": true,\n    \"no-string-literal\": false,\n    \"no-trailing-whitespace\": true,\n    \"no-use-before-declare\": true,\n    \"one-line\": [\n      true,\n      \"check-open-brace\",\n      \"check-catch\",\n      \"check-else\",\n      \"check-whitespace\"\n    ],\n    \"radix\": true,\n    \"semicolon\": true,\n    \"triple-equals\": [\n      true,\n      \"allow-null-check\"\n    ],\n    \"variable-name\": false,\n    \"whitespace\": [\n      true,\n      \"check-branch\",\n      \"check-decl\",\n      \"check-operator\",\n      \"check-separator\"\n    ]\n  }\n}\n"
  },
  {
    "path": "typings.json",
    "content": "{\n  \"globalDependencies\": {\n    \"core-js\": \"registry:dt/core-js#0.0.0+20160725163759\",\n    \"node\": \"registry:dt/node#6.0.0+20160909174046\",\n    \"jasmine\": \"registry:dt/jasmine#2.2.0+20160621224255\"\n  }\n}"
  }
]