Skip to content
This repository has been archived by the owner on Jul 12, 2019. It is now read-only.

Commit

Permalink
Update for Angular 6
Browse files Browse the repository at this point in the history
  • Loading branch information
vadjs committed May 29, 2018
1 parent 101f6e1 commit 6ccbab1
Show file tree
Hide file tree
Showing 7 changed files with 206 additions and 137 deletions.
89 changes: 0 additions & 89 deletions .angular-cli.json

This file was deleted.

157 changes: 157 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"universal-demo": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.browser.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets",
"src/favicon.ico",
"src/robots.txt",
"src/manifest.json"
],
"styles": [
"src/styles.scss",
"src/styles/main.scss"
],
"scripts": []
},
"configurations": {
"dev": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/browser/environment.ts"
}
]
},
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/browser/environment.prod.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "universal-demo:build"
},
"configurations": {
"dev": {
"browserTarget": "universal-demo:build:dev"
},
"production": {
"browserTarget": "universal-demo:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "universal-demo:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [],
"styles": [
"src/styles.scss",
"src/styles/main.scss"
],
"assets": [
"src/assets",
"src/favicon.ico",
"src/robots.txt",
"src/manifest.json"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"server": {
"builder": "@angular-devkit/build-angular:server",
"options": {
"outputPath": "dist-server",
"main": "main.server.ts",
"tsConfig": "tsconfig.server.json"
}
}
}
},
"universal-demo-e2e": {
"root": "",
"sourceRoot": "",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "universal-demo:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "universal-demo",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "scss"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
}
6 changes: 3 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
require('@angular-devkit/build-angular/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
Expand Down
5 changes: 2 additions & 3 deletions lib/ngx-transfer-http/src/transfer-http.service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Injectable, Inject, PLATFORM_ID } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { TransferState } from '@angular/platform-browser';
import { Observable } from 'rxjs';
import { Observable, from } from 'rxjs';
import { tap } from 'rxjs/operators';
import { fromPromise } from 'rxjs/observable/fromPromise';
import { isPlatformBrowser, isPlatformServer } from '@angular/common';

@Injectable()
Expand Down Expand Up @@ -258,7 +257,7 @@ export class TransferHttpService {
// Server only code.
}

return fromPromise(Promise.resolve(data));
return from(Promise.resolve(data));
}

private setCache(key, data): any {
Expand Down
75 changes: 38 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,52 +27,53 @@
},
"private": false,
"dependencies": {
"@angular/animations": "5.2.9",
"@angular/common": "5.2.9",
"@angular/compiler": "5.2.9",
"@angular/core": "5.2.9",
"@angular/forms": "5.2.9",
"@angular/http": "5.2.9",
"@angular/platform-browser": "5.2.9",
"@angular/platform-browser-dynamic": "5.2.9",
"@angular/router": "5.2.9",
"@angular/service-worker": "5.2.9",
"@nguniversal/common": "5.0.0",
"@nguniversal/express-engine": "5.0.0",
"@nguniversal/module-map-ngfactory-loader": "5.0.0",
"@ngx-meta/core": "5.0.0",
"@ngx-translate/core": "9.1.1",
"@ngx-translate/http-loader": "2.0.1",
"@angular/animations": "6.0.3",
"@angular/common": "6.0.3",
"@angular/compiler": "6.0.3",
"@angular/core": "6.0.3",
"@angular/forms": "6.0.3",
"@angular/http": "6.0.3",
"@angular/platform-browser": "6.0.3",
"@angular/platform-browser-dynamic": "6.0.3",
"@angular/router": "6.0.3",
"@angular/service-worker": "6.0.3",
"@nguniversal/common": "6.0.0",
"@nguniversal/express-engine": "6.0.0",
"@nguniversal/module-map-ngfactory-loader": "6.0.0",
"@ngx-meta/core": "6.0.0-rc.1",
"@ngx-translate/core": "10.0.2",
"@ngx-translate/http-loader": "3.0.1",
"cookie-parser": "1.4.3",
"core-js": "2.5.4",
"core-js": "2.5.7",
"ngx-cookie-service": "1.0.10",
"node-fetch": "2.1.2",
"rxjs": "5.5.8",
"zone.js": "0.8.24"
"rxjs": "6.2.0",
"zone.js": "0.8.26"
},
"devDependencies": {
"@angular/cli": "1.7.3",
"@angular/compiler-cli": "5.2.9",
"@angular/language-service": "5.2.9",
"@angular/platform-server": "5.2.9",
"@types/jasmine": "2.8.6",
"@angular/cli": "6.0.5",
"@angular/compiler-cli": "6.0.3",
"@angular/language-service": "6.0.3",
"@angular/platform-server": "6.0.3",
"@types/jasmine": "2.8.7",
"@types/jasminewd2": "2.0.3",
"@types/node": "9.6.1",
"codelyzer": "4.2.1",
"@types/node": "10.1.3",
"codelyzer": "4.3.0",
"jasmine-core": "3.1.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "2.0.0",
"karma": "2.0.2",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.4.2",
"karma-jasmine": "1.1.1",
"karma-jasmine-html-reporter": "1.0.0",
"nodemon": "1.17.3",
"preboot": "6.0.0-beta.3",
"protractor": "5.3.0",
"ssri": "5.3.0",
"tslint": "5.9.1",
"typescript": "2.6.2",
"ng-packagr":"2.4.5"
"karma-coverage-istanbul-reporter": "2.0.1",
"karma-jasmine": "1.1.2",
"karma-jasmine-html-reporter": "1.1.0",
"nodemon": "1.17.5",
"preboot": "6.0.0-beta.4",
"protractor": "5.3.2",
"ssri": "6.0.0",
"tslint": "5.10.0",
"typescript": "2.7.2",
"ng-packagr": "3.0.0",
"@angular-devkit/build-angular": "~0.6.5"
}
}
8 changes: 4 additions & 4 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Component } from '@angular/core';

import { MetaService } from '@ngx-meta/core';
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/first';
import 'rxjs/add/operator/do';
import 'rxjs/add/observable/fromPromise';





@Component({
selector: 'app-root',
Expand Down
Loading

0 comments on commit 6ccbab1

Please sign in to comment.