├── .editorconfig
├── .gitignore
├── README.md
├── angular-cli.json
├── e2e
├── app.e2e-spec.ts
├── app.po.ts
└── tsconfig.json
├── karma.conf.js
├── package.json
├── protractor.conf.js
├── src
├── app
│ ├── app.component.css
│ ├── app.component.html
│ ├── app.component.spec.ts
│ ├── app.component.ts
│ ├── app.module.ts
│ ├── index.ts
│ ├── pouchdb.service.spec.ts
│ └── pouchdb.service.ts
├── assets
│ └── .gitkeep
├── environments
│ ├── environment.prod.ts
│ └── environment.ts
├── favicon.ico
├── index.html
├── main.ts
├── polyfills.ts
├── styles.css
├── test.ts
├── tsconfig.json
└── typings.d.ts
├── sync-gateway-config.json
├── tslint.json
└── typings.json
/.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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PouchDB, Angular 2, and Couchbase Example
2 |
3 | Example project for synchronizing documents between platforms and Couchbase with only Angular 2 and PouchDB.
4 |
5 | ## The Requirements
6 |
7 | This project depends on the following dependencies in order to be successful:
8 |
9 | * Node.js 4.0+
10 | * Angular 2 CLI
11 | * Couchbase Sync Gateway
12 |
13 | To develop Angular 2 applications you need the Angular CLI which is downloadable via the Node Package Manager (NPM) found in Node.js. For synchronization at least one Couchbase Sync Gateway instance must be available.
14 |
15 | ## Installation and Configuration
16 |
17 | Download the project from GitHub and execute the following to download all of the Angular 2 project dependencies:
18 |
19 | ```
20 | npm install
21 | ```
22 |
23 | With the dependencies installed, use launch Sync Gateway with the **sync-gateway-config.json** configuration file found at the root of the project.
24 |
25 | In the project's **src/app/app.component.ts** file, change the hostname to match that of your Sync Gateway instance.
26 |
27 | The project can be sampled by executing:
28 |
29 | ```
30 | ng serve
31 | ```
32 |
33 | The above command will serve the application at http://www.localhost:4200.
34 |
35 | ## Resources
36 |
37 | Couchbase - [http://www.couchbase.com](http://www.couchbase.com)
38 |
39 | PouchDB - [https://pouchdb.com](https://pouchdb.com)
40 |
41 | Angular 2 - [https://angular.io](https://angular.io)
--------------------------------------------------------------------------------
/angular-cli.json:
--------------------------------------------------------------------------------
1 | {
2 | "project": {
3 | "version": "1.0.0-beta.22-1",
4 | "name": "pouch-project"
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 | "test": "test.ts",
17 | "tsconfig": "tsconfig.json",
18 | "prefix": "app",
19 | "mobile": false,
20 | "styles": [
21 | "styles.css"
22 | ],
23 | "scripts": [],
24 | "environments": {
25 | "source": "environments/environment.ts",
26 | "dev": "environments/environment.ts",
27 | "prod": "environments/environment.prod.ts"
28 | }
29 | }
30 | ],
31 | "addons": [],
32 | "packages": [],
33 | "e2e": {
34 | "protractor": {
35 | "config": "./protractor.conf.js"
36 | }
37 | },
38 | "test": {
39 | "karma": {
40 | "config": "./karma.conf.js"
41 | }
42 | },
43 | "defaults": {
44 | "styleExt": "css",
45 | "prefixInterfaces": false,
46 | "inline": {
47 | "style": false,
48 | "template": false
49 | },
50 | "spec": {
51 | "class": false,
52 | "component": true,
53 | "directive": true,
54 | "module": false,
55 | "pipe": true,
56 | "service": true
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/e2e/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { PouchProjectPage } from './app.po';
2 |
3 | describe('pouch-project App', function() {
4 | let page: PouchProjectPage;
5 |
6 | beforeEach(() => {
7 | page = new PouchProjectPage();
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 PouchProjectPage {
4 | navigateTo() {
5 | return browser.get('/');
6 | }
7 |
8 | getParagraphText() {
9 | return element(by.css('app-root h1')).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/e2e/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "declaration": false,
5 | "emitDecoratorMetadata": true,
6 | "experimentalDecorators": true,
7 | "module": "commonjs",
8 | "moduleResolution": "node",
9 | "outDir": "../dist/out-tsc-e2e",
10 | "sourceMap": true,
11 | "target": "es5",
12 | "typeRoots": [
13 | "../node_modules/@types"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/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-remap-istanbul'),
12 | require('angular-cli/plugins/karma')
13 | ],
14 | files: [
15 | { pattern: './src/test.ts', watched: false }
16 | ],
17 | preprocessors: {
18 | './src/test.ts': ['angular-cli']
19 | },
20 | mime: {
21 | 'text/x-typescript': ['ts','tsx']
22 | },
23 | remapIstanbulReporter: {
24 | reports: {
25 | html: 'coverage',
26 | lcovonly: './coverage/coverage.lcov'
27 | }
28 | },
29 | angularCli: {
30 | config: './angular-cli.json',
31 | environment: 'dev'
32 | },
33 | reporters: config.angularCli && config.angularCli.codeCoverage
34 | ? ['progress', 'karma-remap-istanbul']
35 | : ['progress'],
36 | port: 9876,
37 | colors: true,
38 | logLevel: config.LOG_INFO,
39 | autoWatch: true,
40 | browsers: ['Chrome'],
41 | singleRun: false
42 | });
43 | };
44 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pouch-project",
3 | "version": "1.0.0",
4 | "author": {
5 | "name": "Nic Raboy",
6 | "url": "https://www.nraboy.com"
7 | },
8 | "license": "MIT",
9 | "angular-cli": {},
10 | "scripts": {
11 | "start": "ng serve",
12 | "lint": "tslint \"src/**/*.ts\"",
13 | "test": "ng test",
14 | "pree2e": "webdriver-manager update",
15 | "e2e": "protractor"
16 | },
17 | "private": true,
18 | "dependencies": {
19 | "@angular/common": "2.2.3",
20 | "@angular/compiler": "2.2.3",
21 | "@angular/core": "2.2.3",
22 | "@angular/forms": "2.2.3",
23 | "@angular/http": "2.2.3",
24 | "@angular/platform-browser": "2.2.3",
25 | "@angular/platform-browser-dynamic": "2.2.3",
26 | "@angular/router": "3.2.3",
27 | "core-js": "^2.4.1",
28 | "pouchdb": "^6.1.0",
29 | "rxjs": "5.0.0-beta.12",
30 | "ts-helpers": "^1.1.1",
31 | "zone.js": "^0.6.23"
32 | },
33 | "devDependencies": {
34 | "@angular/compiler-cli": "2.2.3",
35 | "@types/jasmine": "2.5.38",
36 | "@types/node": "^6.0.42",
37 | "angular-cli": "1.0.0-beta.22-1",
38 | "codelyzer": "~2.0.0-beta.1",
39 | "jasmine-core": "2.5.2",
40 | "jasmine-spec-reporter": "2.5.0",
41 | "karma": "1.2.0",
42 | "karma-chrome-launcher": "^2.0.0",
43 | "karma-cli": "^1.0.1",
44 | "karma-jasmine": "^1.0.2",
45 | "karma-remap-istanbul": "^0.2.1",
46 | "protractor": "4.0.9",
47 | "ts-node": "1.2.1",
48 | "tslint": "^4.0.2",
49 | "typescript": "~2.0.3",
50 | "webdriver-manager": "10.2.5"
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/protractor.conf.js:
--------------------------------------------------------------------------------
1 | // Protractor configuration file, see link for more information
2 | // https://github.com/angular/protractor/blob/master/docs/referenceConf.js
3 |
4 | /*global jasmine */
5 | var SpecReporter = require('jasmine-spec-reporter');
6 |
7 | exports.config = {
8 | allScriptsTimeout: 11000,
9 | specs: [
10 | './e2e/**/*.e2e-spec.ts'
11 | ],
12 | capabilities: {
13 | 'browserName': 'chrome'
14 | },
15 | directConnect: true,
16 | baseUrl: 'http://localhost:4200/',
17 | framework: 'jasmine',
18 | jasmineNodeOpts: {
19 | showColors: true,
20 | defaultTimeoutInterval: 30000,
21 | print: function() {}
22 | },
23 | useAllAngular2AppRoots: true,
24 | beforeLaunch: function() {
25 | require('ts-node').register({
26 | project: 'e2e'
27 | });
28 | },
29 | onPrepare: function() {
30 | jasmine.getEnv().addReporter(new SpecReporter());
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/src/app/app.component.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/couchbaselabs/pouchdb-angular2/6a96172ced5ffe1a24aadb70637c7eaf0119c59a/src/app/app.component.css
--------------------------------------------------------------------------------
/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | First Name |
10 | Last Name |
11 |
12 |
13 |
14 |
15 | {{ person.firstname }} |
16 | {{ person.lastname }} |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/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 | TestBed.compileComponents();
14 | });
15 |
16 | it('should create the app', async(() => {
17 | let fixture = TestBed.createComponent(AppComponent);
18 | let app = fixture.debugElement.componentInstance;
19 | expect(app).toBeTruthy();
20 | }));
21 | });
22 |
--------------------------------------------------------------------------------
/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit, NgZone } from '@angular/core';
2 | import { PouchDBService } from "./pouchdb.service";
3 |
4 | @Component({
5 | selector: 'app-root',
6 | templateUrl: './app.component.html',
7 | styleUrls: ['./app.component.css']
8 | })
9 | export class AppComponent implements OnInit {
10 |
11 | public people: Array;
12 | public form: any;
13 |
14 | public constructor(private database: PouchDBService, private zone: NgZone) {
15 | this.people = [];
16 | this.form = {
17 | "username": "",
18 | "firstname": "",
19 | "lastname": ""
20 | }
21 | }
22 |
23 | public ngOnInit() {
24 | this.database.sync("http://localhost:4984/nraboy");
25 | this.database.getChangeListener().subscribe(data => {
26 | for(let i = 0; i < data.change.docs.length; i++) {
27 | this.zone.run(() => {
28 | this.people.push(data.change.docs[i]);
29 | });
30 | }
31 | });
32 | this.database.fetch().then(result => {
33 | this.people = [];
34 | for(let i = 0; i < result.rows.length; i++) {
35 | this.people.push(result.rows[i].doc);
36 | }
37 | }, error => {
38 | console.error(error);
39 | });
40 | }
41 |
42 | public insert() {
43 | if(this.form.username && this.form.firstname && this.form.lastname) {
44 | this.database.put(this.form.username, this.form);
45 | this.form = {
46 | "username": "",
47 | "firstname": "",
48 | "lastname": ""
49 | }
50 | }
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { BrowserModule } from '@angular/platform-browser';
2 | import { NgModule } from '@angular/core';
3 | import { FormsModule } from '@angular/forms';
4 | import { HttpModule } from '@angular/http';
5 |
6 | import { AppComponent } from './app.component';
7 | import { PouchDBService } from "./pouchdb.service";
8 |
9 | @NgModule({
10 | declarations: [
11 | AppComponent
12 | ],
13 | imports: [
14 | BrowserModule,
15 | FormsModule,
16 | HttpModule
17 | ],
18 | providers: [PouchDBService],
19 | bootstrap: [AppComponent]
20 | })
21 | export class AppModule { }
22 |
--------------------------------------------------------------------------------
/src/app/index.ts:
--------------------------------------------------------------------------------
1 | export * from './app.component';
2 | export * from './app.module';
3 |
--------------------------------------------------------------------------------
/src/app/pouchdb.service.spec.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable:no-unused-variable */
2 |
3 | import { TestBed, async, inject } from '@angular/core/testing';
4 | import { PouchDBService } from './pouchdb.service';
5 |
6 | describe('PouchDBService', () => {
7 | beforeEach(() => {
8 | TestBed.configureTestingModule({
9 | providers: [PouchDBService]
10 | });
11 | });
12 |
13 | it('should ...', inject([PouchdbService], (service: PouchdbService) => {
14 | expect(service).toBeTruthy();
15 | }));
16 | });
17 |
--------------------------------------------------------------------------------
/src/app/pouchdb.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable, EventEmitter } from '@angular/core';
2 | var PouchDB = require("pouchdb");
3 |
4 | @Injectable()
5 | export class PouchDBService {
6 |
7 | private isInstantiated: boolean;
8 | private database: any;
9 | private listener: EventEmitter = new EventEmitter();
10 |
11 | public constructor() {
12 | if(!this.isInstantiated) {
13 | this.database = new PouchDB("nraboy");
14 | this.isInstantiated = true;
15 | }
16 | }
17 |
18 | public fetch() {
19 | return this.database.allDocs({include_docs: true});
20 | }
21 |
22 | public get(id: string) {
23 | return this.database.get(id);
24 | }
25 |
26 | public put(id: string, document: any) {
27 | document._id = id;
28 | return this.get(id).then(result => {
29 | document._rev = result._rev;
30 | return this.database.put(document);
31 | }, error => {
32 | if(error.status == "404") {
33 | return this.database.put(document);
34 | } else {
35 | return new Promise((resolve, reject) => {
36 | reject(error);
37 | });
38 | }
39 | });
40 | }
41 |
42 | public sync(remote: string) {
43 | let remoteDatabase = new PouchDB(remote);
44 | this.database.sync(remoteDatabase, {
45 | live: true
46 | }).on('change', change => {
47 | this.listener.emit(change);
48 | }).on('error', error => {
49 | console.error(JSON.stringify(error));
50 | });
51 | }
52 |
53 | public getChangeListener() {
54 | return this.listener;
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/src/assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/couchbaselabs/pouchdb-angular2/6a96172ced5ffe1a24aadb70637c7eaf0119c59a/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/couchbaselabs/pouchdb-angular2/6a96172ced5ffe1a24aadb70637c7eaf0119c59a/src/favicon.ico
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PouchProject
6 |
7 |
8 |
9 |
10 |
11 |
12 | Loading...
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import './polyfills.ts';
2 |
3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
4 | import { enableProdMode } from '@angular/core';
5 | import { environment } from './environments/environment';
6 | import { AppModule } from './app/';
7 |
8 | if (environment.production) {
9 | enableProdMode();
10 | }
11 |
12 | platformBrowserDynamic().bootstrapModule(AppModule);
13 |
--------------------------------------------------------------------------------
/src/polyfills.ts:
--------------------------------------------------------------------------------
1 | // This file includes polyfills needed by Angular 2 and is loaded before
2 | // the app. You can add your own extra polyfills to this file.
3 | import 'core-js/es6/symbol';
4 | import 'core-js/es6/object';
5 | import 'core-js/es6/function';
6 | import 'core-js/es6/parse-int';
7 | import 'core-js/es6/parse-float';
8 | import 'core-js/es6/number';
9 | import 'core-js/es6/math';
10 | import 'core-js/es6/string';
11 | import 'core-js/es6/date';
12 | import 'core-js/es6/array';
13 | import 'core-js/es6/regexp';
14 | import 'core-js/es6/map';
15 | import 'core-js/es6/set';
16 | import 'core-js/es6/reflect';
17 |
18 | import 'core-js/es7/reflect';
19 | import 'zone.js/dist/zone';
20 |
--------------------------------------------------------------------------------
/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
--------------------------------------------------------------------------------
/src/test.ts:
--------------------------------------------------------------------------------
1 | import './polyfills.ts';
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 | let 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.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": "",
4 | "declaration": false,
5 | "emitDecoratorMetadata": true,
6 | "experimentalDecorators": true,
7 | "lib": ["es6", "dom"],
8 | "mapRoot": "./",
9 | "module": "es6",
10 | "moduleResolution": "node",
11 | "outDir": "../dist/out-tsc",
12 | "sourceMap": true,
13 | "target": "es5",
14 | "typeRoots": [
15 | "../node_modules/@types"
16 | ]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | // Typings reference file, you can add your own global typings here
2 | // https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html
3 |
--------------------------------------------------------------------------------
/sync-gateway-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "log":["CRUD+", "REST+", "Changes+", "Attach+"],
3 | "databases": {
4 | "nraboy": {
5 | "server":"walrus:",
6 | "sync":`
7 | function (doc) {
8 | channel (doc.channels);
9 | }
10 | `,
11 | "users": {
12 | "GUEST": {
13 | "disabled": false,
14 | "admin_channels": ["*"]
15 | }
16 | }
17 | }
18 | },
19 | "CORS": {
20 | "Origin": ["http://localhost:4200"],
21 | "LoginOrigin": ["http://localhost:4200"],
22 | "Headers": ["Content-Type"],
23 | "MaxAge": 17280000
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rulesDirectory": [
3 | "node_modules/codelyzer"
4 | ],
5 | "rules": {
6 | "class-name": true,
7 | "comment-format": [
8 | true,
9 | "check-space"
10 | ],
11 | "curly": true,
12 | "eofline": true,
13 | "forin": true,
14 | "indent": [
15 | true,
16 | "spaces"
17 | ],
18 | "label-position": true,
19 | "max-line-length": [
20 | true,
21 | 140
22 | ],
23 | "member-access": false,
24 | "member-ordering": [
25 | true,
26 | "static-before-instance",
27 | "variables-before-functions"
28 | ],
29 | "no-arg": true,
30 | "no-bitwise": true,
31 | "no-console": [
32 | true,
33 | "debug",
34 | "info",
35 | "time",
36 | "timeEnd",
37 | "trace"
38 | ],
39 | "no-construct": true,
40 | "no-debugger": true,
41 | "no-duplicate-variable": true,
42 | "no-empty": false,
43 | "no-eval": true,
44 | "no-inferrable-types": true,
45 | "no-shadowed-variable": true,
46 | "no-string-literal": false,
47 | "no-switch-case-fall-through": true,
48 | "no-trailing-whitespace": true,
49 | "no-unused-expression": true,
50 | "no-use-before-declare": true,
51 | "no-var-keyword": true,
52 | "object-literal-sort-keys": false,
53 | "one-line": [
54 | true,
55 | "check-open-brace",
56 | "check-catch",
57 | "check-else",
58 | "check-whitespace"
59 | ],
60 | "quotemark": [
61 | true,
62 | "single"
63 | ],
64 | "radix": true,
65 | "semicolon": [
66 | "always"
67 | ],
68 | "triple-equals": [
69 | true,
70 | "allow-null-check"
71 | ],
72 | "typedef-whitespace": [
73 | true,
74 | {
75 | "call-signature": "nospace",
76 | "index-signature": "nospace",
77 | "parameter": "nospace",
78 | "property-declaration": "nospace",
79 | "variable-declaration": "nospace"
80 | }
81 | ],
82 | "variable-name": false,
83 | "whitespace": [
84 | true,
85 | "check-branch",
86 | "check-decl",
87 | "check-operator",
88 | "check-separator",
89 | "check-type"
90 | ],
91 |
92 | "directive-selector": [true, "attribute", "app", "camelCase"],
93 | "component-selector": [true, "element", "app", "kebab-case"],
94 | "use-input-property-decorator": true,
95 | "use-output-property-decorator": true,
96 | "use-host-property-decorator": true,
97 | "no-input-rename": true,
98 | "no-output-rename": true,
99 | "use-life-cycle-interface": true,
100 | "use-pipe-transform-interface": true,
101 | "component-class-suffix": true,
102 | "directive-class-suffix": true,
103 | "no-access-missing-member": true,
104 | "templates-use-public": true,
105 | "invoke-injectable": true
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/typings.json:
--------------------------------------------------------------------------------
1 | {
2 | "globalDependencies": {
3 | "require": "registry:dt/require#2.1.20+20160919185614"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------