Merge tslint-warnings

This commit is contained in:
William Welling
2016-12-02 08:10:32 -06:00
19 changed files with 112 additions and 176 deletions

View File

@@ -8,14 +8,14 @@ let __compiler__ = require('@angular/compiler');
import { __platform_browser_private__ } from '@angular/platform-browser';
import { __core_private__ } from '@angular/core';
if (!__core_private__['ViewUtils']) {
__core_private__['ViewUtils'] = __core_private__['view_utils'];
__core_private__['ViewUtils'] = __core_private__['view_utils'];
}
if (__compiler__ && __compiler__.SelectorMatcher && __compiler__.CssSelector) {
(__compiler__).__compiler_private__ = {
SelectorMatcher: __compiler__.SelectorMatcher,
CssSelector: __compiler__.CssSelector
}
(__compiler__).__compiler_private__ = {
SelectorMatcher: __compiler__.SelectorMatcher,
CssSelector: __compiler__.CssSelector
}
}

View File

@@ -9,25 +9,25 @@ import { __platform_browser_private__ } from '@angular/platform-browser';
import { __core_private__ } from '@angular/core';
let patch = false;
if (!__core_private__['ViewUtils']) {
patch = true;
__core_private__['ViewUtils'] = __core_private__['view_utils'];
patch = true;
__core_private__['ViewUtils'] = __core_private__['view_utils'];
}
if (__compiler__ && __compiler__.SelectorMatcher && __compiler__.CssSelector) {
patch = true;
(__compiler__).__compiler_private__ = {
SelectorMatcher: __compiler__.SelectorMatcher,
CssSelector: __compiler__.CssSelector
}
patch = true;
(__compiler__).__compiler_private__ = {
SelectorMatcher: __compiler__.SelectorMatcher,
CssSelector: __compiler__.CssSelector
}
}
if (patch) {
var __universal__ = require('angular2-platform-node/__private_imports__');
__universal__.ViewUtils = __core_private__['view_utils'];
__universal__.CssSelector = __universal__.CssSelector || __compiler__.CssSelector;
__universal__.SelectorMatcher = __universal__.SelectorMatcher || __compiler__.SelectorMatcher;
var __universal__ = require('angular2-platform-node/__private_imports__');
__universal__.ViewUtils = __core_private__['view_utils'];
__universal__.CssSelector = __universal__.CssSelector || __compiler__.CssSelector;
__universal__.SelectorMatcher = __universal__.SelectorMatcher || __compiler__.SelectorMatcher;
}
// Fix Material Support

View File

@@ -6,9 +6,9 @@
* found in the LICENSE file at https://angular.io/license
*/
import {Injectable} from '@angular/core';
import { Injectable } from '@angular/core';
// es6-modules are used here
import {DomAdapter, getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
import { DomAdapter, getDOM } from '@angular/platform-browser/src/dom/dom_adapter';
/**
* Represent meta element.
@@ -69,7 +69,7 @@ export class Meta {
* @param tags
* @returns {HTMLMetaElement[]}
*/
addTags(...tags: Array<MetaDefinition|MetaDefinition[]>): HTMLMetaElement[] {
addTags(...tags: Array<MetaDefinition | MetaDefinition[]>): HTMLMetaElement[] {
const presentTags = this._flattenArray(tags);
if (presentTags.length === 0) return [];
return presentTags.map((tag: MetaDefinition) => this._addInternal(tag));

View File

@@ -4,16 +4,19 @@ import { Component, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/
changeDetection: ChangeDetectionStrategy.Default,
encapsulation: ViewEncapsulation.Emulated,
selector: 'ds-home',
styleUrls: ['./home.component.scss'],
styleUrls: ['./home.component.css'],
templateUrl: './home.component.html'
})
export class HomeComponent {
data: any = {};
constructor() {
this.universalInit();
}
universalInit() {
}
}

View File

@@ -11,9 +11,9 @@ export class ApiService {
}
/**
* whatever domain/feature method name
*/
/**
* whatever domain/feature method name
*/
get(url: string, options?: any) {
return this._http.get(url, options)
.map(res => res.json())

View File

@@ -4,7 +4,7 @@ import { Inject, Injectable, isDevMode } from '@angular/core';
export class CacheService {
static KEY = 'CacheService';
constructor(@Inject('LRU') public _cache: Map<string, any>) {
constructor( @Inject('LRU') public _cache: Map<string, any>) {
}

View File

@@ -23,14 +23,14 @@ export function hashCodeString(str: string): string {
// domain/feature service
@Injectable()
export class ModelService {
// This is only one example of one Model depending on your domain
// This is only one example of one Model depending on your domain
constructor(public _api: ApiService, public _cache: CacheService) {
}
/**
* whatever domain/feature method name
*/
/**
* whatever domain/feature method name
*/
get(url) {
// you want to return the cache if there is a response in it.
// This would cache the first response so if your API isn't idempotent

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -1,9 +1,9 @@
var util = require('util');
var {Router} = require('express');
var { Router } = require('express');
// Our API for demos only
import {fakeDataBase} from './db';
import {fakeDemoRedisCache} from './cache';
import { fakeDataBase } from './db';
import { fakeDemoRedisCache } from './cache';
// you would use cookies/token etc
var USER_ID = 'f9d98cf1-1b96-464e-8755-bcc2a5c09077'; // hardcoded as an example
@@ -32,9 +32,9 @@ export function serverApi(req, res) {
var COUNT = 4;
var TODOS = [
{ id: 0, value: 'finish example', created_at: new Date(), completed: false },
{ id: 1, value: 'add tests', created_at: new Date(), completed: false },
{ id: 1, value: 'add tests', created_at: new Date(), completed: false },
{ id: 2, value: 'include development environment', created_at: new Date(), completed: false },
{ id: 3, value: 'include production environment', created_at: new Date(), completed: false }
{ id: 3, value: 'include production environment', created_at: new Date(), completed: false }
];
export function createTodoApi() {
@@ -51,7 +51,7 @@ export function createTodoApi() {
})
.post(function(req, res) {
console.log('POST', util.inspect(req.body, {colors: true}));
console.log('POST', util.inspect(req.body, { colors: true }));
var todo = req.body;
if (todo) {
TODOS.push({
@@ -81,12 +81,12 @@ export function createTodoApi() {
router.route('/todos/:todo_id')
.get(function(req, res) {
console.log('GET', util.inspect(req.todo, {colors: true}));
console.log('GET', util.inspect(req.todo, { colors: true }));
res.json(req.todo);
})
.put(function(req, res) {
console.log('PUT', util.inspect(req.body, {colors: true}));
console.log('PUT', util.inspect(req.body, { colors: true }));
var index = TODOS.indexOf(req.todo);
var todo = TODOS[index] = req.body;

8
src/typings.d.ts vendored
View File

@@ -39,7 +39,7 @@ interface SystemJS {
// Extra variables that live on Global that will be replaced by webpack DefinePlugin
declare var ENV: string;
declare var HMR: boolean;
declare var Zone: {current: any};
declare var Zone: { current: any };
interface GlobalEnvironment {
ENV;
HMR;
@@ -68,6 +68,6 @@ interface WebpackRequire {
}
// Extend typings
interface NodeRequire extends WebpackRequire {}
interface NodeModule extends WebpackModule {}
interface Global extends GlobalEnvironment {}
interface NodeRequire extends WebpackRequire { }
interface NodeModule extends WebpackModule { }
interface Global extends GlobalEnvironment { }