Upgrade Demo App to angular 2.0.0-rc.1

This commit is contained in:
Denys Vuika 2016-06-14 12:06:29 +01:00
parent a81378bcda
commit bcff692a7b
15 changed files with 98 additions and 77 deletions

View File

@ -49,8 +49,8 @@
<main class="mdl-layout__content"> <main class="mdl-layout__content">
<div class="page-content"> <div class="page-content">
<alfresco-login method="{{methodName}}"></alfresco-login> <alfresco-login method="{{methodName}}"></alfresco-login>
<!--<router-outlet></router-outlet>--> <router-outlet></router-outlet>
<auth-router-outlet></auth-router-outlet> <!--<auth-router-outlet></auth-router-outlet>-->
</div> </div>
</main> </main>
</div> </div>

View File

@ -15,11 +15,11 @@
* limitations under the License. * limitations under the License.
*/ */
import { Component } from 'angular2/core'; import { Component } from '@angular/core';
import { Router, RouteConfig, ROUTER_DIRECTIVES } from 'angular2/router'; import { Router, RouteConfig, ROUTER_DIRECTIVES } from '@angular/router-deprecated';
import { MDL } from 'ng2-alfresco-core/dist/ng2-alfresco-core'; import { MDL } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import { FilesComponent } from './components/files/files.component'; import { FilesComponent } from './components/files/files.component';
import { AuthRouterOutlet } from './components/router/AuthRouterOutlet';
import { import {
AlfrescoSettingsService, AlfrescoSettingsService,
AlfrescoTranslationService, AlfrescoTranslationService,
@ -39,7 +39,7 @@ declare var document: any;
selector: 'alfresco-app', selector: 'alfresco-app',
templateUrl: 'app/app.component.html', templateUrl: 'app/app.component.html',
styleUrls: ['app/app.component.css'], styleUrls: ['app/app.component.css'],
directives: [SearchBarComponent, ROUTER_DIRECTIVES, AuthRouterOutlet, MDL], directives: [SearchBarComponent, ROUTER_DIRECTIVES, MDL],
pipes: [AlfrescoPipeTranslate] pipes: [AlfrescoPipeTranslate]
}) })
@RouteConfig([ @RouteConfig([

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { Component } from 'angular2/core'; import { Component } from '@angular/core';
import { import {
ALFRESCO_DATATABLE_DIRECTIVES, ALFRESCO_DATATABLE_DIRECTIVES,
ObjectDataTableAdapter, ObjectDataTableAdapter,

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { Component } from 'angular2/core'; import { Component } from '@angular/core';
import { import {
DOCUMENT_LIST_DIRECTIVES, DOCUMENT_LIST_DIRECTIVES,
DOCUMENT_LIST_PROVIDERS, DOCUMENT_LIST_PROVIDERS,

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { Component } from 'angular2/core'; import { Component } from '@angular/core';
import { AlfrescoLoginComponent } from 'ng2-alfresco-login/dist/ng2-alfresco-login'; import { AlfrescoLoginComponent } from 'ng2-alfresco-login/dist/ng2-alfresco-login';
declare let __moduleName: string; declare let __moduleName: string;

View File

@ -15,8 +15,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { ElementRef, DynamicComponentLoader, Directive, Attribute } from 'angular2/core'; /*
import { Router, RouterOutlet, ComponentInstruction } from 'angular2/router'; import { ElementRef, DynamicComponentLoader, Directive, Attribute } from '@angular/core';
import { Router, RouterOutlet, ComponentInstruction } from '@angular/router-deprecated';
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core'; import { AlfrescoAuthenticationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
@Directive({selector: 'auth-router-outlet'}) @Directive({selector: 'auth-router-outlet'})
@ -49,3 +50,4 @@ export class AuthRouterOutlet extends RouterOutlet {
|| this.authentication.isLoggedIn(); || this.authentication.isLoggedIn();
} }
} }
*/

View File

@ -15,8 +15,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { Component } from 'angular2/core'; import { Component } from '@angular/core';
import { Router } from 'angular2/router'; import { Router } from '@angular/router-deprecated';
import { ALFRESCO_SEARCH_DIRECTIVES } from 'ng2-alfresco-search/dist/ng2-alfresco-search'; import { ALFRESCO_SEARCH_DIRECTIVES } from 'ng2-alfresco-search/dist/ng2-alfresco-search';
import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer/dist/ng2-alfresco-viewer'; import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer/dist/ng2-alfresco-viewer';
import { import {

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { Component } from 'angular2/core'; import { Component } from '@angular/core';
import { ALFRESCO_SEARCH_DIRECTIVES } from 'ng2-alfresco-search/dist/ng2-alfresco-search'; import { ALFRESCO_SEARCH_DIRECTIVES } from 'ng2-alfresco-search/dist/ng2-alfresco-search';
declare let __moduleName: string; declare let __moduleName: string;

View File

@ -15,8 +15,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { Injectable } from 'angular2/core'; import { Injectable } from '@angular/core';
import { Http, Headers, RequestOptions, Response } from 'angular2/http'; import { Http, Headers, RequestOptions, Response } from '@angular/http';
// import { Observable } from 'rxjs/Rx';
@Injectable() @Injectable()
export class ActivitiService { export class ActivitiService {

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { Component, OnInit } from 'angular2/core'; import { Component, OnInit } from '@angular/core';
import { ActivitiService } from './activiti.service'; import { ActivitiService } from './activiti.service';
import { import {
ALFRESCO_DATATABLE_DIRECTIVES, ALFRESCO_DATATABLE_DIRECTIVES,

View File

@ -15,12 +15,12 @@
* limitations under the License. * limitations under the License.
*/ */
import { bootstrap } from 'angular2/platform/browser'; import { bootstrap } from '@angular/platform-browser-dynamic';
import { AppComponent } from './app.component'; import { ROUTER_PROVIDERS } from '@angular/router-deprecated';
import { ROUTER_PROVIDERS } from 'angular2/router'; import { HTTP_PROVIDERS } from '@angular/http';
import { HTTP_PROVIDERS } from 'angular2/http';
import { ALFRESCO_CORE_PROVIDERS } from 'ng2-alfresco-core/dist/ng2-alfresco-core'; import { ALFRESCO_CORE_PROVIDERS } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import { UploadService } from 'ng2-alfresco-upload/dist/ng2-alfresco-upload'; import { UploadService } from 'ng2-alfresco-upload/dist/ng2-alfresco-upload';
import { AppComponent } from './app.component';
bootstrap(AppComponent, [ bootstrap(AppComponent, [
ROUTER_PROVIDERS, ROUTER_PROVIDERS,

View File

@ -16,17 +16,14 @@
<link href="node_modules/flag-icon-css/css/flag-icon.min.css" rel="stylesheet"> <link href="node_modules/flag-icon-css/css/flag-icon.min.css" rel="stylesheet">
<!-- 1. Load libraries --> <!-- 1. Load libraries -->
<!-- IE required polyfills, in this exact order --> <!-- Polyfill(s) for older browsers -->
<script src="node_modules/es6-shim/es6-shim.min.js"></script> <script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/systemjs/dist/system-polyfills.js"></script>
<script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="node_modules/angular2/bundles/router.dev.js"></script>
<script src="node_modules/angular2/bundles/http.dev.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/alfresco-js-api/bundle.js"></script>
<script src="/app/js/xml2json.js"></script> <script src="/app/js/xml2json.js"></script>
<script src="node_modules/alfresco-js-api/bundle.js"></script> <script src="node_modules/alfresco-js-api/bundle.js"></script>
@ -37,7 +34,7 @@
<!-- 2. Configure SystemJS --> <!-- 2. Configure SystemJS -->
<script src="systemjs.config.js"></script> <script src="systemjs.config.js"></script>
<script> <script>
System.import('app/main').catch(function(err){ console.error(err); }); System.import('app').catch(function(err){ console.error(err); });
</script> </script>
</head> </head>
<!-- 3. Display the application --> <!-- 3. Display the application -->

View File

@ -8,7 +8,7 @@
"tsc": "tsc", "tsc": "tsc",
"tsc:w": "tsc -w", "tsc:w": "tsc -w",
"serve": "node browser-sync-config.js", "serve": "node browser-sync-config.js",
"typings": "typings", "typings": "typings install",
"tslint": "npm run tslint-src && npm run tslint-root", "tslint": "npm run tslint-src && npm run tslint-root",
"tslint-src": "tslint -c tslint.json app/**/*.ts", "tslint-src": "tslint -c tslint.json app/**/*.ts",
"tslint-root": "tslint -c tslint.json *.ts", "tslint-root": "tslint -c tslint.json *.ts",
@ -51,23 +51,35 @@
"alfresco" "alfresco"
], ],
"dependencies": { "dependencies": {
"alfresco-js-api": "^0.1.0", "@angular/common": "2.0.0-rc.1",
"angular2": "2.0.0-beta.15", "@angular/compiler": "2.0.0-rc.1",
"es6-shim": "^0.35.0", "@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",
"systemjs": "0.19.27",
"core-js": "^2.4.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12",
"angular2-in-memory-web-api": "0.0.11",
"material-design-icons": "^2.2.3", "material-design-icons": "^2.2.3",
"material-design-lite": "^1.1.3", "material-design-lite": "^1.1.3",
"ng2-translate": "2.1.0",
"pdfjs-dist": "^1.5.258",
"alfresco-js-api": "^0.1.0",
"ng2-alfresco-core": "^0.1.0", "ng2-alfresco-core": "^0.1.0",
"ng2-alfresco-datatable": "^0.1.0", "ng2-alfresco-datatable": "^0.1.0",
"ng2-alfresco-documentlist": "^0.1.0", "ng2-alfresco-documentlist": "^0.1.0",
"ng2-alfresco-login": "^0.1.0", "ng2-alfresco-login": "^0.1.0",
"ng2-alfresco-search": "^0.1.9", "ng2-alfresco-search": "^0.1.9",
"ng2-alfresco-upload": "^0.1.0", "ng2-alfresco-upload": "^0.1.0",
"ng2-alfresco-viewer": "^0.1.13", "ng2-alfresco-viewer": "^0.1.13"
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"systemjs": "0.19.26",
"zone.js": "0.6.10",
"ng2-translate": "1.11.1"
}, },
"devDependencies": { "devDependencies": {
"browser-sync": "^2.10.0", "browser-sync": "^2.10.0",
@ -78,7 +90,7 @@
"license-check": "^1.0.4", "license-check": "^1.0.4",
"tslint": "^3.8.1", "tslint": "^3.8.1",
"typescript": "^1.8.10", "typescript": "^1.8.10",
"typings": "^0.7.12" "typings": "^1.0.4"
}, },
"license-check-config": { "license-check-config": {
"src": [ "src": [

View File

@ -1,57 +1,65 @@
/** /**
* @license * System configuration for Angular 2 samples
* Copyright 2016 Alfresco Software, Ltd. * Adjust as necessary for your application needs.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ */
(function(global) { (function(global) {
// map tells the System loader where to look for things // map tells the System loader where to look for things
var map = { var map = {
'app': 'app', // 'dist',
'@angular': 'node_modules/@angular',
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
'rxjs': 'node_modules/rxjs',
'ng2-translate': 'node_modules/ng2-translate',
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core', 'ng2-alfresco-core': 'node_modules/ng2-alfresco-core',
'ng2-alfresco-datatable': 'node_modules/ng2-alfresco-datatable', 'ng2-alfresco-datatable': 'node_modules/ng2-alfresco-datatable',
'ng2-alfresco-documentlist': 'node_modules/ng2-alfresco-documentlist', 'ng2-alfresco-documentlist': 'node_modules/ng2-alfresco-documentlist',
'ng2-alfresco-login': 'node_modules/ng2-alfresco-login', 'ng2-alfresco-login': 'node_modules/ng2-alfresco-login',
'ng2-alfresco-search': 'node_modules/ng2-alfresco-search', 'ng2-alfresco-search': 'node_modules/ng2-alfresco-search',
'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload', 'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload',
'ng2-alfresco-viewer': 'node_modules/ng2-alfresco-viewer', 'ng2-alfresco-viewer': 'node_modules/ng2-alfresco-viewer'
'rxjs': 'node_modules/rxjs',
'ng2-translate': 'node_modules/ng2-translate'
}; };
// packages tells the System loader how to load when no filename and/or no extension // packages tells the System loader how to load when no filename and/or no extension
var packages = { var packages = {
app: { 'app': { main: 'main.js', defaultExtension: 'js' },
format: 'register', 'rxjs': { defaultExtension: 'js' },
defaultExtension: 'js' 'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
},
'ng2-translate': { defaultExtension: 'js' },
'ng2-alfresco-core': {defaultExtension: 'js'}, 'ng2-alfresco-core': {defaultExtension: 'js'},
'ng2-alfresco-datatable': {defaultExtension: 'js'}, 'ng2-alfresco-datatable': {defaultExtension: 'js'},
'ng2-alfresco-documentlist': {defaultExtension: 'js'}, 'ng2-alfresco-documentlist': {defaultExtension: 'js'},
'ng2-alfresco-login': {defaultExtension: 'js'}, 'ng2-alfresco-login': {defaultExtension: 'js'},
'ng2-alfresco-search': {defaultExtension: 'js'}, 'ng2-alfresco-search': {defaultExtension: 'js'},
'ng2-alfresco-upload': {defaultExtension: 'js'}, 'ng2-alfresco-upload': {defaultExtension: 'js'},
'ng2-alfresco-viewer': {defaultExtension: 'js'}, 'ng2-alfresco-viewer': {defaultExtension: 'js'}
'rxjs': {defaultExtension: 'js'},
'ng2-translate': {defaultExtension: 'js'}
}; };
var ngPackageNames = [
'common',
'compiler',
'core',
'http',
'platform-browser',
'platform-browser-dynamic',
'router',
'router-deprecated',
'upgrade'
];
// Individual files (~300 requests):
function packIndex(pkgName) {
packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' };
}
// Bundled (~40 requests):
function packUmd(pkgName) {
packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' };
}
// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
// Add package entries for angular packages
ngPackageNames.forEach(setPackageConfig);
var config = { var config = {
map: map, map: map,
packages: packages packages: packages
}; };
System.config(config); System.config(config);
})(this); })(this);

View File

@ -1,6 +1,7 @@
{ {
"ambientDependencies": { "globalDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c", "core-js": "registry:dt/core-js#0.0.0+20160317120654",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#d594ef506d1efe2fea15f8f39099d19b39436b71" "jasmine": "registry:dt/jasmine#2.2.0+20160505161446",
} "node": "registry:dt/node#4.0.0+20160509154515"
}
} }