├── .angular-cli.json ├── .editorconfig ├── .gitignore ├── LICENSE ├── README.md ├── demo.png ├── e2e ├── app.e2e-spec.ts ├── app.po.ts └── tsconfig.e2e.json ├── karma.conf.js ├── package.json ├── protractor.conf.js ├── src ├── anglarjs.ts ├── app │ ├── app.component.css │ ├── app.component.html │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── app.routing.ts │ ├── dashboard │ │ ├── about │ │ │ ├── about.component.css │ │ │ ├── about.component.html │ │ │ └── about.component.ts │ │ ├── dashboard.component.css │ │ ├── dashboard.component.html │ │ ├── dashboard.component.spec.ts │ │ ├── dashboard.component.ts │ │ └── dashboard.module.ts │ ├── home │ │ ├── about │ │ │ ├── about.component.css │ │ │ ├── about.component.html │ │ │ └── about.component.ts │ │ ├── home.component.css │ │ ├── home.component.html │ │ ├── home.component.spec.ts │ │ ├── home.component.ts │ │ ├── home.module.ts │ │ └── ng1 │ │ │ ├── grid.component.ts │ │ │ └── grid.directive.ts │ ├── ng1 │ │ ├── directive.ts │ │ └── grid.component.ts │ ├── route1 │ │ └── route1.component.ts │ ├── route2 │ │ └── route2.component.ts │ └── shared │ │ ├── shared.component.css │ │ ├── shared.component.html │ │ ├── shared.component.spec.ts │ │ ├── shared.component.ts │ │ └── shared.module.ts ├── assets │ └── .gitkeep ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── main.ts ├── polyfills.ts ├── styles.css ├── test.ts ├── tsconfig.app.json ├── tsconfig.spec.json └── typings.d.ts ├── tsconfig.json └── tslint.json /.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "grid2" 5 | }, 6 | "apps": [ 7 | { 8 | "root": "src", 9 | "outDir": "dist", 10 | "assets": [ 11 | "assets", 12 | "favicon.ico" 13 | ], 14 | "index": "index.html", 15 | "main": "main.ts", 16 | "polyfills": "polyfills.ts", 17 | "test": "test.ts", 18 | "tsconfig": "tsconfig.app.json", 19 | "testTsconfig": "tsconfig.spec.json", 20 | "prefix": "app", 21 | "styles": [ 22 | "styles.css", 23 | "../node_modules/angular-ui-grid/ui-grid.min.css" 24 | ], 25 | "scripts": [ 26 | "../node_modules/angular/angular.min.js", 27 | "../node_modules/angular-ui-grid/ui-grid.min.js" 28 | ], 29 | "environmentSource": "environments/environment.ts", 30 | "environments": { 31 | "dev": "environments/environment.ts", 32 | "prod": "environments/environment.prod.ts" 33 | } 34 | } 35 | ], 36 | "e2e": { 37 | "protractor": { 38 | "config": "./protractor.conf.js" 39 | } 40 | }, 41 | "lint": [ 42 | { 43 | "project": "src/tsconfig.app.json" 44 | }, 45 | { 46 | "project": "src/tsconfig.spec.json" 47 | }, 48 | { 49 | "project": "e2e/tsconfig.e2e.json" 50 | } 51 | ], 52 | "test": { 53 | "karma": { 54 | "config": "./karma.conf.js" 55 | } 56 | }, 57 | "defaults": { 58 | "styleExt": "css", 59 | "component": {} 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | 7 | # dependencies 8 | /node_modules 9 | /bower_components 10 | 11 | # IDEs and editors 12 | /.idea 13 | /.vscode 14 | .project 15 | .classpath 16 | .c9/ 17 | *.launch 18 | .settings/ 19 | 20 | # misc 21 | /.sass-cache 22 | /connect.lock 23 | /coverage/* 24 | /libpeerconnection.log 25 | npm-debug.log 26 | testem.log 27 | /typings 28 | 29 | # e2e 30 | /e2e/*.js 31 | /e2e/*.map 32 | 33 | #System Files 34 | .DS_Store 35 | Thumbs.db 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Vlado Tesanovic 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UI Grid and Angular 2 2 | 3 | Demo: ui-grid2.surge.sh 4 | 5 | 6 | -------------------------------------------------------------------------------- /demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vladotesanovic/ui-grid-angular2/3b888de927be2062dae9533ed3648990583d8581/demo.png -------------------------------------------------------------------------------- /e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { A2ttPage } from './app.po'; 2 | 3 | describe('a2tt App', () => { 4 | let page: A2ttPage; 5 | 6 | beforeEach(() => { 7 | page = new A2ttPage(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class A2ttPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "sourceMap": true, 4 | "declaration": false, 5 | "moduleResolution": "node", 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "lib": [ 9 | "es2016" 10 | ], 11 | "outDir": "../dist/out-tsc-e2e", 12 | "module": "commonjs", 13 | "target": "es6", 14 | "types":[ 15 | "jasmine", 16 | "node" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/0.13/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular/cli'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular/cli/plugins/karma') 14 | ], 15 | client:{ 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | files: [ 19 | { pattern: './src/test.ts', watched: false } 20 | ], 21 | preprocessors: { 22 | './src/test.ts': ['@angular/cli'] 23 | }, 24 | mime: { 25 | 'text/x-typescript': ['ts','tsx'] 26 | }, 27 | coverageIstanbulReporter: { 28 | reports: [ 'html', 'lcovonly' ], 29 | fixWebpackSourcePaths: true 30 | }, 31 | angularCli: { 32 | environment: 'dev' 33 | }, 34 | reporters: config.angularCli && config.angularCli.codeCoverage 35 | ? ['progress', 'coverage-istanbul'] 36 | : ['progress', 'kjhtml'], 37 | port: 9876, 38 | colors: true, 39 | logLevel: config.LOG_INFO, 40 | autoWatch: true, 41 | browsers: ['Chrome'], 42 | singleRun: false 43 | }); 44 | }; 45 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "grid2", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "start": "ng serve --port 3388 --aot=false", 7 | "lint": "ng lint", 8 | "test": "ng test", 9 | "e2e": "ng e2e", 10 | "build": "ng build --prod --sm=false --aot=true", 11 | "run": "cd dist && python -m SimpleHTTPServer 8001" 12 | }, 13 | "private": true, 14 | "dependencies": { 15 | "@angular/common": "^4.1.0", 16 | "@angular/compiler": "^4.1.0", 17 | "@angular/core": "^4.1.0", 18 | "@angular/forms": "^4.1.0", 19 | "@angular/http": "^4.1.0", 20 | "@angular/cli": "^1.0.1", 21 | "@angular/platform-browser": "^4.1.0", 22 | "@angular/platform-browser-dynamic": "^4.1.0", 23 | "@angular/router": "^4.1.0", 24 | "@angular/upgrade": "^4.1.0", 25 | "core-js": "^2.4.1", 26 | "rxjs": "^5.1.0", 27 | "zone.js": "^0.8.9", 28 | "angular": "1.5.9", 29 | "angular-ui-grid": "^4.0.4", 30 | "ts-helpers": "^1.1.1" 31 | }, 32 | "devDependencies": { 33 | "@types/angular": "^1.5.20", 34 | "@angular/compiler-cli": "^4.1.0", 35 | "@types/jasmine": "2.5.38", 36 | "@types/node": "~6.0.60", 37 | "codelyzer": "~3.0.0", 38 | "jasmine-core": "~2.5.2", 39 | "jasmine-spec-reporter": "~3.2.0", 40 | "karma": "~1.4.1", 41 | "karma-chrome-launcher": "~2.0.0", 42 | "karma-cli": "~1.0.1", 43 | "karma-jasmine": "~1.1.0", 44 | "karma-jasmine-html-reporter": "^0.2.2", 45 | "karma-coverage-istanbul-reporter": "^0.2.0", 46 | "protractor": "~5.1.0", 47 | "ts-node": "~3.0.2", 48 | "tslint": "~5.1.0", 49 | "typescript": "^2.2.2" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './e2e/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | beforeLaunch: function() { 23 | require('ts-node').register({ 24 | project: 'e2e/tsconfig.e2e.json' 25 | }); 26 | }, 27 | onPrepare() { 28 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /src/anglarjs.ts: -------------------------------------------------------------------------------- 1 | import * as angular from 'angular'; 2 | import { downgradeComponent } from '@angular/upgrade/static'; 3 | 4 | import { AppComponent } from './app/app.component'; 5 | 6 | export function initAngularjs() { 7 | 8 | const ng1Component: angular.IComponentOptions = { 9 | bindings: { 10 | data: '<', 11 | onUpdate: '&' 12 | }, 13 | transclude: true, 14 | controller: ['$scope', 'uiGridConstants', function($scope, uiGridConstants) { 15 | 16 | const ctrl = this; 17 | 18 | const today = new Date(); 19 | const nextWeek = new Date(); 20 | nextWeek.setDate(nextWeek.getDate() + 7); 21 | 22 | $scope.highlightFilteredHeader = function (row, rowRenderIndex, col, colRenderIndex) { 23 | if (col.filters[0].term) { 24 | return 'header-filtered'; 25 | } else { 26 | return ''; 27 | } 28 | }; 29 | 30 | $scope.msg = {}; 31 | 32 | $scope.gridOptions = { 33 | enableFiltering: true, 34 | showGridFooter: true, 35 | showColumnFooter: true, 36 | enableSorting: true, 37 | enableColumnResizing: true, 38 | treeRowHeaderAlwaysVisible: true, 39 | enableGridMenu: true, 40 | onRegisterApi: function (gridApi) { 41 | 42 | $scope.gridApi = gridApi; 43 | gridApi.edit.on.afterCellEdit($scope, (rowEntity, colDef, newValue, oldValue) => { 44 | $scope.msg.lastCellEdited = `edited row id: ${rowEntity.id} Column: ${colDef.name} newValue: ${newValue} oldValue: ${oldValue}`; 45 | ctrl.onUpdate({ 46 | 'rowId': rowEntity.id, 47 | 'column': colDef.name, 48 | 'new': newValue, 49 | 'old': oldValue 50 | }); 51 | $scope.$apply(); 52 | }); 53 | } 54 | }; 55 | 56 | $scope.toggleFiltering = function () { 57 | $scope.gridOptions.enableFiltering = !$scope.gridOptions.enableFiltering; 58 | $scope.gridApi.core.notifyDataChange(uiGridConstants.dataChange.COLUMN); 59 | }; 60 | 61 | function makeColDefs(row) { 62 | const colDefs = []; 63 | let exist = []; 64 | 65 | for (let i = 0; i < row.length; i++) { 66 | 67 | for (const colName in row[i]) { 68 | 69 | if (exist.indexOf(colName) === -1) { 70 | 71 | colDefs.push({ 72 | 'field': colName, 73 | 'width': 200 74 | }); 75 | exist.push(colName); 76 | } 77 | } 78 | } 79 | exist = undefined; 80 | return colDefs; 81 | } 82 | 83 | this.$onChanges = function(obj: { data: { currentValue: Array<{}>}}) { 84 | 85 | if (obj.data.currentValue && obj.data.currentValue.length) { 86 | const colDefs = makeColDefs(obj.data.currentValue); 87 | $scope.gridOptions.data = obj.data.currentValue; 88 | $scope.gridOptions.columnDefs = colDefs; 89 | } 90 | 91 | }; 92 | 93 | this.$onInit = function() {} 94 | 95 | }], 96 | template: 'Hello, Angular 2 from angular 1!
{{msg.lastCellEdited}}' 97 | }; 98 | 99 | const ng1Component2: angular.IComponentOptions = { 100 | bindings: { 101 | data: '<' 102 | }, 103 | transclude: true, 104 | controller: ['$scope', 'uiGridConstants', function($scope, uiGridConstants) { 105 | 106 | const ctrl = this; 107 | 108 | const today = new Date(); 109 | const nextWeek = new Date(); 110 | nextWeek.setDate(nextWeek.getDate() + 7); 111 | 112 | $scope.highlightFilteredHeader = function (row, rowRenderIndex, col, colRenderIndex) { 113 | if (col.filters[0].term) { 114 | return 'header-filtered'; 115 | } else { 116 | return ''; 117 | } 118 | }; 119 | 120 | $scope.gridOptions = { 121 | showGridFooter: true, 122 | showColumnFooter: true, 123 | enableFiltering: true, 124 | onRegisterApi: function (gridApi) { 125 | $scope.gridApi = gridApi; 126 | } 127 | }; 128 | 129 | $scope.toggleFiltering = function () { 130 | $scope.gridOptions.enableFiltering = !$scope.gridOptions.enableFiltering; 131 | $scope.gridApi.core.notifyDataChange(uiGridConstants.dataChange.COLUMN); 132 | }; 133 | 134 | function makeColDefs(row) { 135 | const colDefs = []; 136 | let exist = []; 137 | 138 | for (let i = 0; i < row.length; i++) { 139 | 140 | for (const colName in row[i]) { 141 | 142 | if (exist.indexOf(colName) === -1) { 143 | 144 | colDefs.push({ 145 | 'field': colName, 146 | 'width': 200 147 | }); 148 | exist.push(colName); 149 | } 150 | } 151 | } 152 | exist = undefined; 153 | return colDefs; 154 | } 155 | 156 | this.$onChanges = function(obj: { data: { currentValue: Array<{}>}}) { 157 | 158 | if (obj.data.currentValue.length) { 159 | 160 | const colDefs = makeColDefs(obj.data.currentValue); 161 | $scope.gridOptions.data = obj.data.currentValue; 162 | $scope.gridOptions.columnDefs = colDefs; 163 | } 164 | 165 | }; 166 | 167 | this.$onInit = function() {} 168 | 169 | }], 170 | template: 'Hello, Angular 2 from angular 1!
' 171 | }; 172 | 173 | return angular.module('ng1Module', ['ui.grid', 'ui.grid.grouping', 'ui.grid.edit', 'ui.grid.selection']) 174 | .component('ui-grid', ng1Component) 175 | .component('ng1', ng1Component2) 176 | .directive('appRoot', downgradeComponent({ component: AppComponent })); 177 | } 178 | -------------------------------------------------------------------------------- /src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vladotesanovic/ui-grid-angular2/3b888de927be2062dae9533ed3648990583d8581/src/app/app.component.css -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

2 | {{title}} 3 |

4 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async } from '@angular/core/testing'; 4 | import { AppComponent } from './app.component'; 5 | 6 | describe('AppComponent', () => { 7 | beforeEach(() => { 8 | TestBed.configureTestingModule({ 9 | declarations: [ 10 | AppComponent 11 | ], 12 | }); 13 | }); 14 | 15 | it('should create the app', async(() => { 16 | let fixture = TestBed.createComponent(AppComponent); 17 | let app = fixture.debugElement.componentInstance; 18 | expect(app).toBeTruthy(); 19 | })); 20 | 21 | it(`should have as title 'app works!'`, async(() => { 22 | let fixture = TestBed.createComponent(AppComponent); 23 | let app = fixture.debugElement.componentInstance; 24 | expect(app.title).toEqual('app works!'); 25 | })); 26 | 27 | it('should render title in a h1 tag', async(() => { 28 | let fixture = TestBed.createComponent(AppComponent); 29 | fixture.detectChanges(); 30 | let compiled = fixture.debugElement.nativeElement; 31 | expect(compiled.querySelector('h1').textContent).toContain('app works!'); 32 | })); 33 | }); 34 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app works!'; 10 | } 11 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { HttpModule } from '@angular/http'; 5 | import { RouterModule } from '@angular/router'; 6 | import { UpgradeModule } from '@angular/upgrade/static'; 7 | 8 | import { AppComponent } from './app.component'; 9 | import { Ng1ComponentFacade } from './ng1/directive'; 10 | import { GridComponent } from './ng1/grid.component'; 11 | import { Route1Component } from './route1/route1.component'; 12 | import { Route2Component } from './route2/route2.component'; 13 | 14 | @NgModule({ 15 | declarations: [ 16 | AppComponent, 17 | Route1Component, 18 | GridComponent, 19 | Route2Component, 20 | Ng1ComponentFacade 21 | ], 22 | imports: [ 23 | BrowserModule, 24 | FormsModule, 25 | HttpModule, 26 | UpgradeModule, 27 | RouterModule.forRoot([ 28 | { 29 | path: '', 30 | pathMatch: 'full', 31 | redirectTo: 'home' 32 | }, 33 | { 34 | path: 'route1', 35 | component: Route1Component 36 | }, 37 | { 38 | path: 'route2', 39 | component: Route2Component 40 | }, 41 | { loadChildren: 'app/home/home.module#HomeModule', path: 'home' } 42 | ], 43 | { 44 | useHash: true, 45 | initialNavigation: false 46 | }), 47 | ], 48 | entryComponents: [ 49 | AppComponent 50 | ], 51 | schemas: [ 52 | CUSTOM_ELEMENTS_SCHEMA 53 | ] 54 | }) 55 | export class AppModule { 56 | ngDoBootstrap(): void {} 57 | } 58 | -------------------------------------------------------------------------------- /src/app/app.routing.ts: -------------------------------------------------------------------------------- 1 | import { RouterModule, Route } from '@angular/router'; 2 | import { ModuleWithProviders } from '@angular/core'; 3 | import { Route1Component } from './route1/route1.component'; 4 | import { Route2Component } from './route2/route2.component'; 5 | 6 | const routes: Route[] = [ 7 | { 8 | path: '', 9 | pathMatch: 'full', 10 | redirectTo: 'home' 11 | }, 12 | { 13 | path: 'route1', 14 | component: Route1Component 15 | }, 16 | { 17 | path: 'route2', 18 | component: Route2Component 19 | }, 20 | { loadChildren: 'app/home/home.module#HomeModule', path: 'home' }, 21 | { loadChildren: 'app/dashboard/dashboard.module#DashboardModule', path: 'dashboard' } 22 | ]; 23 | 24 | export const routing: ModuleWithProviders = RouterModule.forRoot( 25 | routes, 26 | { 27 | useHash: true 28 | } 29 | ); 30 | -------------------------------------------------------------------------------- /src/app/dashboard/about/about.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vladotesanovic/ui-grid-angular2/3b888de927be2062dae9533ed3648990583d8581/src/app/dashboard/about/about.component.css -------------------------------------------------------------------------------- /src/app/dashboard/about/about.component.html: -------------------------------------------------------------------------------- 1 |

2 | about from dashboard works! 3 |

4 |
5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /src/app/dashboard/about/about.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Http, Response } from "@angular/http"; 3 | 4 | import "rxjs/add/operator/map"; 5 | 6 | @Component({ 7 | selector: 'app-dashboard-about', 8 | templateUrl: './about.component.html', 9 | styleUrls: ['./about.component.css'] 10 | }) 11 | export class AboutComponent { 12 | myData = []; 13 | constructor(public http: Http) { 14 | 15 | this.http 16 | .get('https://jsonplaceholder.typicode.com/users') 17 | .map((response: Response) => response.json()) 18 | .subscribe((data) => { 19 | this.myData = data; 20 | }); 21 | } 22 | 23 | logForm(value: any) { 24 | console.log(value); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/app/dashboard/dashboard.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vladotesanovic/ui-grid-angular2/3b888de927be2062dae9533ed3648990583d8581/src/app/dashboard/dashboard.component.css -------------------------------------------------------------------------------- /src/app/dashboard/dashboard.component.html: -------------------------------------------------------------------------------- 1 |

2 | dashboard works! 3 |

4 | 5 | 6 | -------------------------------------------------------------------------------- /src/app/dashboard/dashboard.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 3 | import { By } from '@angular/platform-browser'; 4 | import { DebugElement } from '@angular/core'; 5 | 6 | import { DashboardComponent } from './dashboard.component'; 7 | 8 | describe('DashboardComponent', () => { 9 | let component: DashboardComponent; 10 | let fixture: ComponentFixture; 11 | 12 | beforeEach(async(() => { 13 | TestBed.configureTestingModule({ 14 | declarations: [ DashboardComponent ] 15 | }) 16 | .compileComponents(); 17 | })); 18 | 19 | beforeEach(() => { 20 | fixture = TestBed.createComponent(DashboardComponent); 21 | component = fixture.componentInstance; 22 | fixture.detectChanges(); 23 | }); 24 | 25 | it('should create', () => { 26 | expect(component).toBeTruthy(); 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /src/app/dashboard/dashboard.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-dashboard', 5 | templateUrl: './dashboard.component.html', 6 | styleUrls: ['./dashboard.component.css'] 7 | }) 8 | export class DashboardComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/dashboard/dashboard.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { DashboardComponent } from './dashboard.component'; 4 | import { RouterModule } from "@angular/router"; 5 | import { AboutComponent } from "./about/about.component"; 6 | import { ReactiveFormsModule, FormsModule } from "@angular/forms"; 7 | import { SharedModule } from "../shared/shared.module"; 8 | 9 | @NgModule({ 10 | imports: [ 11 | CommonModule, 12 | ReactiveFormsModule, 13 | FormsModule, 14 | SharedModule, 15 | RouterModule.forChild([{ 16 | path: "", component: DashboardComponent, 17 | children: [{ 18 | path: "about", 19 | component: AboutComponent 20 | }] 21 | }]) 22 | ], 23 | declarations: [DashboardComponent, AboutComponent] 24 | }) 25 | export class DashboardModule { } 26 | -------------------------------------------------------------------------------- /src/app/home/about/about.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vladotesanovic/ui-grid-angular2/3b888de927be2062dae9533ed3648990583d8581/src/app/home/about/about.component.css -------------------------------------------------------------------------------- /src/app/home/about/about.component.html: -------------------------------------------------------------------------------- 1 |

2 | about works! 3 |

4 |
5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | -------------------------------------------------------------------------------- /src/app/home/about/about.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Http, Response } from "@angular/http"; 3 | 4 | import "rxjs/add/operator/map"; 5 | 6 | @Component({ 7 | selector: 'app-about', 8 | templateUrl: './about.component.html', 9 | styleUrls: ['./about.component.css'] 10 | }) 11 | export class AboutComponent { 12 | myData = []; 13 | constructor(public http: Http) { 14 | 15 | this.http 16 | .get('https://jsonplaceholder.typicode.com/users') 17 | .map((response: Response) => response.json()) 18 | .subscribe((data) => { 19 | this.myData = data; 20 | }); 21 | } 22 | 23 | logForm(value: any) { 24 | console.log(value); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/app/home/home.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vladotesanovic/ui-grid-angular2/3b888de927be2062dae9533ed3648990583d8581/src/app/home/home.component.css -------------------------------------------------------------------------------- /src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |

2 | home works! 3 |

4 | About 5 |



6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 3 | import { By } from '@angular/platform-browser'; 4 | import { DebugElement } from '@angular/core'; 5 | 6 | import { HomeComponent } from './home.component'; 7 | 8 | describe('HomeComponent', () => { 9 | let component: HomeComponent; 10 | let fixture: ComponentFixture; 11 | 12 | beforeEach(async(() => { 13 | TestBed.configureTestingModule({ 14 | declarations: [ HomeComponent ] 15 | }) 16 | .compileComponents(); 17 | })); 18 | 19 | beforeEach(() => { 20 | fixture = TestBed.createComponent(HomeComponent); 21 | component = fixture.componentInstance; 22 | fixture.detectChanges(); 23 | }); 24 | 25 | it('should create', () => { 26 | expect(component).toBeTruthy(); 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html', 6 | styleUrls: ['./home.component.css'] 7 | }) 8 | export class HomeComponent {} 9 | -------------------------------------------------------------------------------- /src/app/home/home.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { HomeComponent } from './home.component'; 4 | 5 | import { RouterModule } from "@angular/router"; 6 | import { AboutComponent } from "./about/about.component"; 7 | import { Ng1TestComponentFacade } from "./ng1/grid.directive"; 8 | import { GridComponent } from "./ng1/grid.component"; 9 | import { ReactiveFormsModule, FormsModule } from "@angular/forms"; 10 | import { SharedModule } from "../shared/shared.module"; 11 | 12 | @NgModule({ 13 | imports: [ 14 | CommonModule, 15 | SharedModule, 16 | ReactiveFormsModule, 17 | FormsModule, 18 | RouterModule.forChild([{ 19 | path: "", 20 | component: HomeComponent, 21 | children: [{ 22 | path: "about", 23 | component: AboutComponent 24 | }] 25 | }]) 26 | ], 27 | declarations: [ 28 | HomeComponent, 29 | AboutComponent, 30 | GridComponent, 31 | Ng1TestComponentFacade 32 | ], 33 | bootstrap: [HomeComponent], 34 | schemas: [ 35 | CUSTOM_ELEMENTS_SCHEMA 36 | ] 37 | }) 38 | export class HomeModule {} 39 | -------------------------------------------------------------------------------- /src/app/home/ng1/grid.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Http, Response } from "@angular/http"; 3 | 4 | import "rxjs/add/operator/map"; 5 | 6 | @Component({ 7 | selector: 'app-grid2', 8 | template: 'Draw new grid: ', 9 | }) 10 | export class GridComponent { 11 | myData = []; 12 | constructor(public http: Http) { 13 | 14 | this.http 15 | .get("https://jsonplaceholder.typicode.com/users") 16 | .map((response: Response) => response.json()) 17 | .subscribe((data) => { 18 | this.myData = data; 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/app/home/ng1/grid.directive.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Directive, ElementRef, Injector, Input, OnInit, SimpleChanges, OnChanges, DoCheck, 3 | OnDestroy 4 | } from "@angular/core"; 5 | import { UpgradeComponent } from "@angular/upgrade/static"; 6 | 7 | @Directive({selector: 'ng1'}) 8 | export class Ng1TestComponentFacade extends UpgradeComponent implements OnInit, OnChanges, DoCheck, 9 | OnDestroy { 10 | 11 | @Input() data: {}; 12 | constructor(elementRef: ElementRef, injector: Injector) { 13 | super('ng1', elementRef, injector); 14 | } 15 | 16 | ngOnInit() { super.ngOnInit(); } 17 | 18 | ngOnChanges(changes: SimpleChanges) { super.ngOnChanges(changes); } 19 | ngDoCheck() { super.ngDoCheck(); } 20 | ngOnDestroy() { super.ngOnDestroy(); } 21 | } 22 | -------------------------------------------------------------------------------- /src/app/ng1/directive.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Directive, ElementRef, Injector, Input, OnInit, SimpleChanges, OnChanges, DoCheck, 3 | OnDestroy, Output, EventEmitter 4 | } from '@angular/core'; 5 | import { UpgradeComponent } from '@angular/upgrade/static'; 6 | 7 | @Directive({selector: 'ui-grid'}) 8 | export class Ng1ComponentFacade extends UpgradeComponent implements OnInit, OnChanges, DoCheck, 9 | OnDestroy { 10 | 11 | @Input() data: {}; 12 | @Output() onUpdate: EventEmitter<{}>; 13 | 14 | constructor(elementRef: ElementRef, injector: Injector) { 15 | super('ui-grid', elementRef, injector); 16 | } 17 | 18 | ngOnInit() { super.ngOnInit(); } 19 | 20 | ngOnChanges(changes: SimpleChanges) { super.ngOnChanges(changes); } 21 | ngDoCheck() { super.ngDoCheck(); } 22 | ngOnDestroy() { super.ngOnDestroy(); } 23 | } 24 | -------------------------------------------------------------------------------- /src/app/ng1/grid.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Http, Response } from '@angular/http'; 3 | 4 | import 'rxjs/add/operator/map'; 5 | import { Observable } from 'rxjs/Observable'; 6 | 7 | @Component({ 8 | selector: 'app-grid', 9 | template: `
{{ data | json }}
`, 10 | }) 11 | export class GridComponent implements OnInit { 12 | data: {}; 13 | myData$: Observable; 14 | 15 | constructor(public http: Http) {} 16 | 17 | ngOnInit() { 18 | this.myData$ = this.http 19 | .get('https://jsonplaceholder.typicode.com/users') 20 | .map((response: Response) => response.json()); 21 | } 22 | 23 | onUpdate(data: {}) { 24 | this.data = data; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/app/route1/route1.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, AfterViewInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-route1', 5 | template: `

Grid Route

6 | 7 | `, 8 | }) 9 | export class Route1Component implements AfterViewInit { 10 | constructor() {} 11 | ngAfterViewInit() {} 12 | } 13 | -------------------------------------------------------------------------------- /src/app/route2/route2.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-route2', 5 | template: `

Route 2

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
`, 23 | }) 24 | export class Route2Component { 25 | constructor() {} 26 | 27 | logForm(value: any) { 28 | console.log(value); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/app/shared/shared.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vladotesanovic/ui-grid-angular2/3b888de927be2062dae9533ed3648990583d8581/src/app/shared/shared.component.css -------------------------------------------------------------------------------- /src/app/shared/shared.component.html: -------------------------------------------------------------------------------- 1 |

2 | shared works! 3 |

4 | -------------------------------------------------------------------------------- /src/app/shared/shared.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 3 | import { By } from '@angular/platform-browser'; 4 | import { DebugElement } from '@angular/core'; 5 | 6 | import { SharedComponent } from './shared.component'; 7 | 8 | describe('SharedComponent', () => { 9 | let component: SharedComponent; 10 | let fixture: ComponentFixture; 11 | 12 | beforeEach(async(() => { 13 | TestBed.configureTestingModule({ 14 | declarations: [ SharedComponent ] 15 | }) 16 | .compileComponents(); 17 | })); 18 | 19 | beforeEach(() => { 20 | fixture = TestBed.createComponent(SharedComponent); 21 | component = fixture.componentInstance; 22 | fixture.detectChanges(); 23 | }); 24 | 25 | it('should create', () => { 26 | expect(component).toBeTruthy(); 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /src/app/shared/shared.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-shared', 5 | templateUrl: './shared.component.html', 6 | styleUrls: ['./shared.component.css'] 7 | }) 8 | export class SharedComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { SharedComponent } from "./shared.component"; 5 | 6 | @NgModule({ 7 | imports: [ 8 | CommonModule 9 | ], 10 | declarations: [ 11 | SharedComponent 12 | ], 13 | exports: [ 14 | SharedComponent, 15 | CommonModule, 16 | FormsModule 17 | ] 18 | }) 19 | export class SharedModule { } 20 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vladotesanovic/ui-grid-angular2/3b888de927be2062dae9533ed3648990583d8581/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vladotesanovic/ui-grid-angular2/3b888de927be2062dae9533ed3648990583d8581/src/favicon.ico -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Grid2 6 | 7 | 8 | 9 | 10 | 11 | 12 | Fork me on GitHub 13 | Loading... 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { environment } from './environments/environment'; 3 | import { AppModule } from './app/app.module'; 4 | import { initAngularjs } from "./anglarjs"; 5 | import { Router } from "@angular/router"; 6 | import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; 7 | import { UpgradeModule } from "@angular/upgrade/static"; 8 | 9 | if (environment.production) { 10 | enableProdMode(); 11 | } 12 | 13 | // bootstrap Angular 1 application 14 | initAngularjs(); 15 | 16 | platformBrowserDynamic().bootstrapModule(AppModule).then(platformRef => { 17 | const upgrade = platformRef.injector.get(UpgradeModule) as UpgradeModule; 18 | upgrade.bootstrap(document.documentElement, ['ng1Module']); 19 | upgrade.ngZone.run(() => { 20 | upgrade.injector.get(Router).initialNavigation(); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/set'; 35 | 36 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 37 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 38 | 39 | /** IE10 and IE11 requires the following to support `@angular/animation`. */ 40 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 41 | 42 | 43 | /** Evergreen browsers require these. **/ 44 | import 'core-js/es6/reflect'; 45 | import 'core-js/es7/reflect'; 46 | 47 | 48 | /** ALL Firefox browsers require the following to support `@angular/animation`. **/ 49 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 50 | 51 | 52 | 53 | /*************************************************************************************************** 54 | * Zone JS is required by Angular itself. 55 | */ 56 | import 'zone.js/dist/zone'; // Included with Angular CLI. 57 | 58 | 59 | 60 | /*************************************************************************************************** 61 | * APPLICATION IMPORTS 62 | */ 63 | 64 | /** 65 | * Date, currency, decimal and percent pipes. 66 | * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 67 | */ 68 | // import 'intl'; // Run `npm install --save intl`. 69 | -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/long-stack-trace-zone'; 4 | import 'zone.js/dist/proxy.js'; 5 | import 'zone.js/dist/sync-test'; 6 | import 'zone.js/dist/jasmine-patch'; 7 | import 'zone.js/dist/async-test'; 8 | import 'zone.js/dist/fake-async-test'; 9 | import { getTestBed } from '@angular/core/testing'; 10 | import { 11 | BrowserDynamicTestingModule, 12 | platformBrowserDynamicTesting 13 | } from '@angular/platform-browser-dynamic/testing'; 14 | 15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. 16 | declare var __karma__: any; 17 | declare var require: any; 18 | 19 | // Prevent Karma from running prematurely. 20 | __karma__.loaded = function () {}; 21 | 22 | // First, initialize the Angular testing environment. 23 | getTestBed().initTestEnvironment( 24 | BrowserDynamicTestingModule, 25 | platformBrowserDynamicTesting() 26 | ); 27 | // Then we find all the tests. 28 | const context = require.context('./', true, /\.spec\.ts$/); 29 | // And load the modules. 30 | context.keys().map(context); 31 | // Finally, start Karma to run the tests. 32 | __karma__.start(); 33 | -------------------------------------------------------------------------------- /src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "sourceMap": true, 4 | "declaration": false, 5 | "moduleResolution": "node", 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "lib": [ 9 | "es2016", 10 | "dom" 11 | ], 12 | "outDir": "../out-tsc/app", 13 | "target": "es5", 14 | "module": "es2015", 15 | "baseUrl": "", 16 | "types": [] 17 | }, 18 | "exclude": [ 19 | "test.ts", 20 | "**/*.spec.ts" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "sourceMap": true, 4 | "declaration": false, 5 | "moduleResolution": "node", 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "lib": [ 9 | "es2016" 10 | ], 11 | "outDir": "../out-tsc/spec", 12 | "module": "commonjs", 13 | "target": "es6", 14 | "baseUrl": "", 15 | "types": [ 16 | "jasmine", 17 | "node" 18 | ] 19 | }, 20 | "files": [ 21 | "test.ts" 22 | ], 23 | "include": [ 24 | "**/*.spec.ts" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: { 3 | id: string; 4 | }; 5 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "es5", 11 | "lib": [ 12 | "es2016", 13 | "dom" 14 | ] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "callable-types": true, 7 | "class-name": true, 8 | "comment-format": [ 9 | true, 10 | "check-space" 11 | ], 12 | "curly": true, 13 | "eofline": true, 14 | "forin": true, 15 | "import-blacklist": [true, "rxjs"], 16 | "import-spacing": true, 17 | "indent": [ 18 | true, 19 | "spaces" 20 | ], 21 | "interface-over-type-literal": true, 22 | "label-position": true, 23 | "max-line-length": [ 24 | true, 25 | 140 26 | ], 27 | "member-access": false, 28 | "member-ordering": [ 29 | true, 30 | "static-before-instance", 31 | "variables-before-functions" 32 | ], 33 | "no-arg": true, 34 | "no-bitwise": true, 35 | "no-console": [ 36 | true, 37 | "debug", 38 | "info", 39 | "time", 40 | "timeEnd", 41 | "trace" 42 | ], 43 | "no-construct": true, 44 | "no-debugger": true, 45 | "no-duplicate-variable": true, 46 | "no-empty": false, 47 | "no-empty-interface": true, 48 | "no-eval": true, 49 | "no-inferrable-types": [true, "ignore-params"], 50 | "no-shadowed-variable": true, 51 | "no-string-literal": false, 52 | "no-string-throw": true, 53 | "no-switch-case-fall-through": true, 54 | "no-trailing-whitespace": true, 55 | "no-unused-expression": true, 56 | "no-use-before-declare": true, 57 | "no-var-keyword": true, 58 | "object-literal-sort-keys": false, 59 | "one-line": [ 60 | true, 61 | "check-open-brace", 62 | "check-catch", 63 | "check-else", 64 | "check-whitespace" 65 | ], 66 | "prefer-const": true, 67 | "quotemark": [ 68 | true, 69 | "single" 70 | ], 71 | "radix": true, 72 | "semicolon": [ 73 | "always" 74 | ], 75 | "triple-equals": [ 76 | true, 77 | "allow-null-check" 78 | ], 79 | "typedef-whitespace": [ 80 | true, 81 | { 82 | "call-signature": "nospace", 83 | "index-signature": "nospace", 84 | "parameter": "nospace", 85 | "property-declaration": "nospace", 86 | "variable-declaration": "nospace" 87 | } 88 | ], 89 | "typeof-compare": true, 90 | "unified-signatures": true, 91 | "variable-name": false, 92 | "whitespace": [ 93 | true, 94 | "check-branch", 95 | "check-decl", 96 | "check-operator", 97 | "check-separator", 98 | "check-type" 99 | ], 100 | 101 | "directive-selector": [true, "attribute", "app", "camelCase"], 102 | "component-selector": [true, "element", "app", "kebab-case"], 103 | "use-input-property-decorator": true, 104 | "use-output-property-decorator": true, 105 | "use-host-property-decorator": true, 106 | "no-input-rename": true, 107 | "no-output-rename": true, 108 | "use-life-cycle-interface": true, 109 | "use-pipe-transform-interface": true, 110 | "component-class-suffix": true, 111 | "directive-class-suffix": true, 112 | "no-access-missing-member": true, 113 | "templates-use-public": true, 114 | "invoke-injectable": true 115 | } 116 | } 117 | --------------------------------------------------------------------------------