From bfd3e4342849927c99f89f6d8e0e71bc20678025 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Mon, 17 Oct 2016 08:56:55 +0000 Subject: [PATCH] Updating basic project (angular-universal starter) to the lattest version 17-10-2016 git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@44092 d315682c-612b-4755-9ff5-7f18f6832af3 --- portal-2/README.md | 33 ++++++++++++++++- portal-2/package.json | 36 +++++++++---------- ...{main.browser.ts => app.browser.module.ts} | 0 .../src/{main.node.ts => app.node.module.ts} | 0 .../insertClaim/insertClaim.component.ts | 2 +- .../dataProvider/dataProvider.component.ts | 2 +- .../src/app/landingPages/landing.module.ts | 12 +++---- portal-2/src/app/utils/utils.module.ts | 2 +- portal-2/src/client.ts | 2 +- portal-2/src/server.ts | 4 +-- portal-2/webpack.config.ts | 10 ++---- 11 files changed, 65 insertions(+), 38 deletions(-) rename portal-2/src/{main.browser.ts => app.browser.module.ts} (100%) rename portal-2/src/{main.node.ts => app.node.module.ts} (100%) diff --git a/portal-2/README.md b/portal-2/README.md index b1c84a93..0a776153 100644 --- a/portal-2/README.md +++ b/portal-2/README.md @@ -1,9 +1,16 @@ + +

+ + Universal Angular 2 + +

+ # Angular 2 Universal Starter [![Universal Angular 2](https://img.shields.io/badge/universal-angular2-brightgreen.svg?style=flat)](https://github.com/angular/universal) > Server-Side Rendering for Angular 2 A minimal Angular 2 starter for Universal JavaScript using TypeScript 2 and Webpack 2 -> If you're looking for the Angular Universal repo go to [angular/universal](https://github.com/angular/universal) +> If you're looking for the Angular Universal repo go to [**angular/universal**](https://github.com/angular/universal) [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) @@ -21,3 +28,27 @@ A minimal Angular 2 starter for Universal JavaScript using TypeScript 2 and Webp ## Watch files * `npm run watch` to build your client app and start a web server + + + +### Documentation +[Design Doc](https://docs.google.com/document/d/1q6g9UlmEZDXgrkY88AJZ6MUrUxcnwhBGS0EXbVlYicY) + +### Videos +Angular 2 Universal Patterns - ng-conf, May 2016 +[![Angular 2 Universal Patterns](http://img.youtube.com/vi/TCj_oC3m6_U/0.jpg)](https://www.youtube.com/watch?v=TCj_oC3m6_U) + +Angular Universal Source Code - ReadTheSource, January 2016 +[![Angular Universal Source Code](http://img.youtube.com/vi/qOjtFjXoebY/0.jpg)](https://www.youtube.com/watch?v=qOjtFjXoebY) + +Full Stack Angular 2 - AngularConnect, Oct 2015 +[![Full Stack Angular 2](https://img.youtube.com/vi/MtoHFDfi8FM/0.jpg)](https://www.youtube.com/watch?v=MtoHFDfi8FM) + +Angular 2 Server Rendering - Angular U, July 2015 +[![Angular 2 Server Rendering](http://img.youtube.com/vi/0wvZ7gakqV4/0.jpg)](http://www.youtube.com/watch?v=0wvZ7gakqV4) + +## [preboot.js](https://github.com/angular/preboot) +> Control server-rendered page and transfer state before client-side web app loads to the client-side-app. + +# License +[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](/LICENSE) diff --git a/portal-2/package.json b/portal-2/package.json index 81ae0ea2..4ca373ca 100644 --- a/portal-2/package.json +++ b/portal-2/package.json @@ -29,30 +29,30 @@ "Mark Pieszak " ], "dependencies": { - "@angular/common": "2.0.0", - "@angular/compiler": "2.0.0", - "@angular/core": "2.0.0", - "@angular/forms": "2.0.0", - "@angular/http": "2.0.0", - "@angular/platform-browser": "2.0.0", - "@angular/platform-browser-dynamic": "2.0.0", - "@angular/platform-server": "2.0.0", - "@angular/router": "3.0.0", + "@angular/common": "2.1.0", + "@angular/compiler": "2.1.0", + "@angular/core": "2.1.0", + "@angular/forms": "2.1.0", + "@angular/http": "2.1.0", + "@angular/platform-browser": "2.1.0", + "@angular/platform-browser-dynamic": "2.1.0", + "@angular/platform-server": "2.1.0", + "@angular/router": "3.1.0", "@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.6", - "angular2-express-engine": "~2.0.11", - "angular2-platform-node": "~2.0.11", - "angular2-universal": "~2.0.11", - "angular2-universal-polyfills": "~2.0.11", + "angular2-express-engine": "~2.1.0-rc.1", + "angular2-platform-node": "~2.1.0-rc.1", + "angular2-universal": "~2.1.0-rc.1", + "angular2-universal-polyfills": "~2.1.0-rc.1", "body-parser": "^1.15.2", "bootstrap": "^4.0.0-alpha.4", "express": "^4.14.0", "methods": "~1.1.2", "ng2-webstorage": "^1.2.2", + "preboot": "~4.5.2", "rxjs": "5.0.0-beta.12", - "zone.js": "0.6.23" + "zone.js": "~0.6.25" }, "devDependencies": { - "@angularclass/resolve-angular-routes": "^1.0.9", "@types/body-parser": "0.0.29", "@types/compression": "0.0.29", "@types/cookie-parser": "^1.3.29", @@ -72,10 +72,10 @@ "string-replace-loader": "github:gdi2290/string-replace-loader", "ts-loader": "^0.8.2", "ts-node": "^1.3.0", - "typescript": "2.0.0", - "webpack": "2.1.0-beta.22", + "typescript": "2.0.2", + "webpack": "2.1.0-beta.25", "webpack-dev-middleware": "^1.6.1", - "webpack-dev-server": "^2.1.0-beta.0", + "webpack-dev-server": "2.1.0-beta.9", "webpack-merge": "^0.13.0" } } diff --git a/portal-2/src/main.browser.ts b/portal-2/src/app.browser.module.ts similarity index 100% rename from portal-2/src/main.browser.ts rename to portal-2/src/app.browser.module.ts diff --git a/portal-2/src/main.node.ts b/portal-2/src/app.node.module.ts similarity index 100% rename from portal-2/src/main.node.ts rename to portal-2/src/app.node.module.ts diff --git a/portal-2/src/app/claimPages/linking/insertClaim/insertClaim.component.ts b/portal-2/src/app/claimPages/linking/insertClaim/insertClaim.component.ts index 0730ae34..d175ae25 100644 --- a/portal-2/src/app/claimPages/linking/insertClaim/insertClaim.component.ts +++ b/portal-2/src/app/claimPages/linking/insertClaim/insertClaim.component.ts @@ -210,7 +210,7 @@ private afterclaimsInsertion(insertedIds, errorInClaims){ if(this.inline){ this.show = "end"; }else{ - this._router.navigate( ['/my-claims'] ); + this._router.navigate( ['/myclaims'] ); } this.showChange.emit({ value: this.show diff --git a/portal-2/src/app/landingPages/dataProvider/dataProvider.component.ts b/portal-2/src/app/landingPages/dataProvider/dataProvider.component.ts index af6fffea..66b3c552 100644 --- a/portal-2/src/app/landingPages/dataProvider/dataProvider.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/dataProvider.component.ts @@ -4,7 +4,7 @@ import {DataProviderService} from '../../services/dataProvider.service'; import {DataProviderInfo} from '../../utils/entities/dataProviderInfo'; import {ActivatedRoute} from '@angular/router'; -import{TabsComponent} from './tabs.component.ts'; +import{TabsComponent} from './tabs.component'; @Component({ selector: 'dataprovider', diff --git a/portal-2/src/app/landingPages/landing.module.ts b/portal-2/src/app/landingPages/landing.module.ts index a0edfae3..26c808af 100644 --- a/portal-2/src/app/landingPages/landing.module.ts +++ b/portal-2/src/app/landingPages/landing.module.ts @@ -9,12 +9,12 @@ import {ServicesModule} from '../services/services.module'; import {SearchModule} from '../searchPages/search.module'; -import {TabPagingComponent} from './tabPaging.component.ts'; -import {TabTableComponent} from './tabTable.component.ts'; -import {ShowTitleComponent} from './showTitle.component.ts'; -import {ShowAuthorsComponent} from './showAuthors.component.ts'; -import {ShowIdentifiersComponent} from './showIdentifiers.component.ts'; -import {ShowSubjectsComponent} from './showSubjects.component.ts'; +import {TabPagingComponent} from './tabPaging.component'; +import {TabTableComponent} from './tabTable.component'; +import {ShowTitleComponent} from './showTitle.component'; +import {ShowAuthorsComponent} from './showAuthors.component'; +import {ShowIdentifiersComponent} from './showIdentifiers.component'; +import {ShowSubjectsComponent} from './showSubjects.component'; import {PublicationsTabComponent} from './dataProvider/publicationsTab.component'; import {DatasetsTabComponent} from './dataProvider/datasetsTab.component'; diff --git a/portal-2/src/app/utils/utils.module.ts b/portal-2/src/app/utils/utils.module.ts index 4c6c1006..e14df1df 100644 --- a/portal-2/src/app/utils/utils.module.ts +++ b/portal-2/src/app/utils/utils.module.ts @@ -11,7 +11,7 @@ import {PagingFormatter} from './pagingFormatter.component'; import {AutocompleteComponent} from './autoComplete.component'; import {ShowDataProvidersComponent} from './showDataProviders.component'; -import {ExportCSVComponent} from './exportCSV.component.ts'; +import {ExportCSVComponent} from './exportCSV.component'; import {IFrameComponent} from './iframe.component'; import {AlertModal} from './modal/alert'; diff --git a/portal-2/src/client.ts b/portal-2/src/client.ts index 4b89d28d..f0224caa 100644 --- a/portal-2/src/client.ts +++ b/portal-2/src/client.ts @@ -8,7 +8,7 @@ import { platformUniversalDynamic } from 'angular2-universal'; // enable prod for faster renders enableProdMode(); -import { MainModule } from './main.browser'; +import { MainModule } from './app.browser.module'; const platformRef = platformUniversalDynamic(); diff --git a/portal-2/src/server.ts b/portal-2/src/server.ts index 9f21b655..b0225182 100644 --- a/portal-2/src/server.ts +++ b/portal-2/src/server.ts @@ -12,7 +12,7 @@ import { enableProdMode } from '@angular/core'; import { createEngine } from 'angular2-express-engine'; // App -import { MainModule } from './main.node'; +import { MainModule } from './app.node.module'; // enable prod for faster renders enableProdMode(); @@ -47,7 +47,7 @@ function ngApp(req, res) { preboot: false, baseUrl: '/', requestUrl: req.originalUrl, - originUrl: req.hostname + originUrl: 'http://localhost:3000' }); } // Routes with html5pushstate diff --git a/portal-2/webpack.config.ts b/portal-2/webpack.config.ts index be6c8239..80e4e5b7 100644 --- a/portal-2/webpack.config.ts +++ b/portal-2/webpack.config.ts @@ -1,11 +1,10 @@ var webpack = require('webpack'); var path = require('path'); -var resolveNgRoute = require('@angularclass/resolve-angular-routes'); var commonConfig = { resolve: { - extensions: ['', '.ts', '.js', '.json'] + extensions: ['.ts', '.js', '.json'] }, module: { loaders: [ @@ -21,7 +20,7 @@ var commonConfig = { // The (\\|\/) piece accounts for path separators in *nix and Windows /angular(\\|\/)core(\\|\/)src(\\|\/)linker/, root('./src'), - resolveNgRoute(root('./src')) + {} ) ] @@ -52,7 +51,7 @@ var serverConfig = { libraryTarget: 'commonjs2' }, module: { - preLoaders: [ + loaders: [ { test: /angular2-material/, loader: "imports-loader?window=>global" } ], }, @@ -92,9 +91,6 @@ var serverConfig = { // Default config var defaultConfig = { context: __dirname, - resolve: { - root: root('/src') - }, output: { publicPath: path.resolve(__dirname), filename: 'index.js'