Commit 76bb82c8 by Tuukka Kivilahti

update to angular-6-beta

1 parent a9ab48ed
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "moya-angular"
"name": "angular6testi"
},
"apps": [
{
......@@ -12,18 +13,18 @@
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.json",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"styles.scss"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"hmr": "environments/environment.hmr.ts",
"prod": "environments/environment.prod.ts"
}
}
......@@ -35,7 +36,16 @@
},
"lint": [
{
"project": "src/tsconfig.json"
"project": "src/tsconfig.app.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "e2e/tsconfig.e2e.json",
"exclude": "**/node_modules/**"
}
],
"test": {
......@@ -44,14 +54,7 @@
}
},
"defaults": {
"styleExt": "scss",
"class": {
"spec": false
},
"component": {
"spec": true,
"inlineStyle": false,
"inlineTemplate": false
}
"styleExt": "css",
"component": {}
}
}
......@@ -7,50 +7,49 @@
"ng": "ng",
"start": "ng serve --preserve-symlinks --proxy-config=moyaproxy.conf.json --base-href=/",
"build": "ng build --preserve-symlinks",
"aot": "ng build --preserve-symlinks --aot",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
"e2e": "ng e2e",
"version": "ng version"
},
"private": true,
"dependencies": {
"@angular/animations": "^5.2.4",
"@angular/common": "^5.2.4",
"@angular/compiler": "^5.2.4",
"@angular/core": "^5.2.4",
"@angular/forms": "^5.2.4",
"@angular/http": "^5.2.4",
"@angular/material": "^5.2.0",
"@angular/platform-browser": "^5.2.4",
"@angular/platform-browser-dynamic": "^5.2.4",
"@angular/platform-server": "^5.2.4",
"@angular/router": "^5.2.4",
"bootstrap": "^4.0.0",
"@angular/animations": "^6.0.0-beta.6",
"@angular/common": "^6.0.0-beta.6",
"@angular/compiler": "^6.0.0-beta.6",
"@angular/core": "^6.0.0-beta.6",
"@angular/forms": "^6.0.0-beta.6",
"@angular/http": "^6.0.0-beta.6",
"@angular/material": "^6.0.0-beta.3",
"@angular/platform-browser": "^6.0.0-beta.6",
"@angular/platform-browser-dynamic": "^6.0.0-beta.6",
"@angular/router": "^6.0.0-beta.6",
"core-js": "^2.5.1",
"rxjs": "^5.5.0",
"zone.js": "^0.8.19",
"bootstrap": "^4.0.0",
"ngx-bootstrap": "^2.0.2",
"rxjs": "^5.4.3",
"ts-helpers": "^1.1.1",
"zone.js": "^0.8.19"
"ts-helpers": "^1.1.1"
},
"devDependencies": {
"@angular/cli": "^1.6.8",
"@angular/compiler-cli": "^5.2.4",
"@angularclass/hmr": "^2.1.3",
"@types/jasmine": "2.8.6",
"@types/node": "^9.4.4",
"codelyzer": "~4.1.0",
"jasmine-core": "2.99.1",
"jasmine-spec-reporter": "4.2.1",
"karma": "2.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.6.0",
"node-sass": "^4.5.3",
"protractor": "^5.1.2",
"raw-loader": "^0.5.1",
"sass-loader": "^6.0.6",
"ts-node": "5.0.0",
"tslint": "^5.9.1",
"typescript": "^2.5.3"
"@angular/cli": "~6.0.0-beta.4",
"@angular/compiler-cli": "^6.0.0-beta.6",
"@angular/language-service": "^6.0.0-beta.6",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~9.4.6",
"codelyzer": "^4.0.1",
"jasmine-core": "~3.1.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.3.0",
"ts-node": "~5.0.0",
"tslint": "~5.9.1",
"typescript": "~2.5.3"
}
}
......@@ -9,7 +9,6 @@ import {AlertModule} from 'ngx-bootstrap';
import {RouterModule, Routes} from '@angular/router';
import {OldMoyaComponent} from './old-moya/old-moya.component';
import {SafePipe} from './pipes/safe.pipe';
import {TestComponent} from './test/test.component';
import {AdminMenuComponent} from './menu/admin-menu/admin-menu.component';
import {TopMenuComponent} from './menu/top-menu/top-menu.component';
......@@ -19,13 +18,13 @@ import {UserMenuComponent} from './menu/user-menu/user-menu.component';
import {UserComponent} from './user/user.component';
import {InfoComponent} from './info/info.component';
import {AdminComponent} from './admin/admin.component';
import {I18nPipe} from './pipes/i18n.pipe';
import {HttpClientModule, HttpHandler } from '@angular/common/http';
import { HttpModule } from '@angular/http';
import {StaticInjector} from "@angular/core/src/di/injector";
import {CommonModule} from "@angular/common";
import {CacheService} from "./shared/services/cache.service";
import {MoyaRestModule} from "./moya-rest";
import {SafePipe} from "./pipes/safe.pipe";
const appRoutes: Routes = [
{
......@@ -63,7 +62,6 @@ const appRoutes: Routes = [
AppComponent,
ViplistComponent,
OldMoyaComponent,
SafePipe,
TestComponent,
TopMenuComponent,
LeftMenuComponent,
......@@ -73,7 +71,7 @@ const appRoutes: Routes = [
UserComponent,
InfoComponent,
AdminComponent,
I18nPipe
SafePipe
],
imports: [
......
import { Pipe, PipeTransform } from '@angular/core'
@Pipe({
name: 'i18n'
})
export class I18nPipe implements PipeTransform {
i18n = require('../../i18n/i18n.json')
transform(value: any, args?: any): any {
return this.i18n[value];
}
}
import {NgModuleRef, ApplicationRef} from '@angular/core';
import {createNewHosts} from '@angularclass/hmr';
/**
* Created by tuukka on 14/02/17.
*/
export const hmrBootstrap = (module: any, bootstrap: () => Promise<NgModuleRef<any>>) => {
let ngModule: NgModuleRef<any>;
module.hot.accept();
bootstrap().then(mod => ngModule = mod);
module.hot.dispose(() => {
let appRef: ApplicationRef = ngModule.injector.get(ApplicationRef);
let elements = appRef.components.map(c => c.location.nativeElement);
let makeVisible = createNewHosts(elements);
ngModule.destroy();
makeVisible();
});
};
......@@ -4,7 +4,7 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { environment } from './environments/environment';
import { AppModule } from './app/app.module';
import {hmrBootstrap} from './hmr';
if (environment.production) {
enableProdMode();
......@@ -15,17 +15,6 @@ if (environment.production) {
const bootstrap = () => {
return platformBrowserDynamic().bootstrapModule(AppModule);
};
bootstrap();
if (environment.hmr) {
if (module['hot']) {
console.log('starting with hmr!');
hmrBootstrap(module, bootstrap);
} else {
console.error('HMR is not enabled for webpack-dev-server!');
console.log('Are you using the --hmr flag for ng serve?');
}
} else {
bootstrap();
}
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/spec",
"baseUrl": "./",
"module": "commonjs",
"types": [
"jasmine",
"node"
]
},
"files": [
"test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}
/* SystemJS module definition */
declare var module: NodeModule;
interface NodeModule {
id: string;
}
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es6",
"dom"
],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
},
"include": [
"**/*.ts",
]
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!