diff --git a/demo-shell-ng2/app/app.component.ts b/demo-shell-ng2/app/app.component.ts index 665e3da929..1b186c1fcc 100644 --- a/demo-shell-ng2/app/app.component.ts +++ b/demo-shell-ng2/app/app.component.ts @@ -16,24 +16,20 @@ */ import { Component } from '@angular/core'; -import { ROUTER_DIRECTIVES, Router } from '@angular/router'; +import { Router } from '@angular/router'; import { - MDL, AlfrescoSettingsService, AlfrescoTranslationService, AlfrescoAuthenticationService } from 'ng2-alfresco-core'; -import { SearchBarComponent } from './components/index'; - declare var document: any; @Component({ selector: 'alfresco-app', templateUrl: 'app/app.component.html', - styleUrls: ['app/app.component.css'], - directives: [SearchBarComponent, ROUTER_DIRECTIVES, MDL] + styleUrls: ['app/app.component.css'] }) export class AppComponent { translate: AlfrescoTranslationService; diff --git a/demo-shell-ng2/app/app.module.ts b/demo-shell-ng2/app/app.module.ts new file mode 100644 index 0000000000..fa2ef01a6b --- /dev/null +++ b/demo-shell-ng2/app/app.module.ts @@ -0,0 +1,72 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * 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. + */ + +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; + +import { AppComponent } from './app.component'; +import { routing } from './app.routes'; + +import { SearchBarComponent } from './components/index'; +import { MDL, ALFRESCO_CORE_PROVIDERS, CONTEXT_MENU_DIRECTIVES, AlfrescoPipeTranslate } from 'ng2-alfresco-core'; +import { ALFRESCO_LOGIN_DIRECTIVES } from 'ng2-alfresco-login'; +import { ALFRESCO_DATATABLE_DIRECTIVES, PaginationComponent } from 'ng2-alfresco-datatable'; +import { ALFRESCO_TASKLIST_DIRECTIVES } from 'ng2-activiti-tasklist'; +import { ACTIVITI_PROCESSLIST_DIRECTIVES } from 'ng2-activiti-processlist'; +import { ActivitiForm, ATIVITI_FORM_PROVIDERS } from 'ng2-activiti-form'; +import { DOCUMENT_LIST_DIRECTIVES, DOCUMENT_LIST_PROVIDERS } from 'ng2-alfresco-documentlist'; +import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload'; +import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer'; +import { ALFRESCO_SEARCH_DIRECTIVES, ALFRESCO_SEARCH_PROVIDERS } from 'ng2-alfresco-search'; +import { TAGCOMPONENT, TAGSERVICES } from 'ng2-alfresco-tag'; +import { WEBSCRIPTCOMPONENT } from 'ng2-alfresco-webscript'; + +@NgModule({ + imports: [ + BrowserModule, + routing + ], + declarations: [ + AppComponent, + SearchBarComponent, + MDL, + ...ALFRESCO_LOGIN_DIRECTIVES, + ...ALFRESCO_DATATABLE_DIRECTIVES, PaginationComponent, + ...ALFRESCO_TASKLIST_DIRECTIVES, + ...ACTIVITI_PROCESSLIST_DIRECTIVES, + ActivitiForm, + ...DOCUMENT_LIST_DIRECTIVES, + ...CONTEXT_MENU_DIRECTIVES, + ...ALFRESCO_ULPOAD_COMPONENTS, + ...VIEWERCOMPONENT, + ...ALFRESCO_SEARCH_DIRECTIVES, + ...TAGCOMPONENT, + ...WEBSCRIPTCOMPONENT, + AlfrescoPipeTranslate + ], + providers: [ + ...ALFRESCO_CORE_PROVIDERS, + ...DOCUMENT_LIST_PROVIDERS, + ...ATIVITI_FORM_PROVIDERS, + ...ALFRESCO_SEARCH_PROVIDERS, + ...TAGSERVICES, + UploadService + ], + bootstrap: [ AppComponent ] +}) +export class AppModule { } + diff --git a/demo-shell-ng2/app/app.routes.ts b/demo-shell-ng2/app/app.routes.ts index 5f791bf8b5..c1e07484a7 100644 --- a/demo-shell-ng2/app/app.routes.ts +++ b/demo-shell-ng2/app/app.routes.ts @@ -15,7 +15,8 @@ * limitations under the License. */ -import { provideRouter, RouterConfig } from '@angular/router'; +import { ModuleWithProviders } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; import { FilesComponent, @@ -27,11 +28,11 @@ import { WebscriptComponent, TagComponent, AboutComponent, - FormViewer + FormViewer, + FormNodeViewer } from './components/index'; -import { FormNodeViewer } from './components/activiti/form-node-viewer.component'; -export const routes: RouterConfig = [ +export const appRoutes: Routes = [ { path: 'home', component: FilesComponent }, { path: 'files', component: FilesComponent }, { path: 'datatable', component: DataTableDemoComponent }, @@ -48,6 +49,4 @@ export const routes: RouterConfig = [ { path: 'about', component: AboutComponent } ]; -export const appRouterProviders = [ - provideRouter(routes) -]; +export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes); diff --git a/demo-shell-ng2/app/components/about/about.component.ts b/demo-shell-ng2/app/components/about/about.component.ts index 30b667a14a..93320f2746 100644 --- a/demo-shell-ng2/app/components/about/about.component.ts +++ b/demo-shell-ng2/app/components/about/about.component.ts @@ -17,21 +17,14 @@ import { Component, OnInit } from '@angular/core'; import { Http } from '@angular/http'; -import { - ALFRESCO_DATATABLE_DIRECTIVES, - ObjectDataTableAdapter /*, - DataSorting, - ObjectDataRow, - ObjectDataColumn*/ -} from 'ng2-alfresco-datatable'; +import { ObjectDataTableAdapter } from 'ng2-alfresco-datatable'; declare let __moduleName: string; @Component({ moduleId: __moduleName, selector: 'about-page', - templateUrl: './about.component.html', - directives: [ALFRESCO_DATATABLE_DIRECTIVES] + templateUrl: './about.component.html' }) export class AboutComponent implements OnInit { diff --git a/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts b/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts index 08e487dabd..55e2405e49 100644 --- a/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts +++ b/demo-shell-ng2/app/components/activiti/activiti-demo.component.ts @@ -16,14 +16,12 @@ */ import { Component, AfterViewChecked, ViewChild, Input } from '@angular/core'; -import { ALFRESCO_TASKLIST_DIRECTIVES, +import { AppDefinitionRepresentationModel, FilterRepresentationModel, UserTaskFilterRepresentationModel, ActivitiApps } from 'ng2-activiti-tasklist'; -import { ACTIVITI_PROCESSLIST_DIRECTIVES } from 'ng2-activiti-processlist'; -import { ActivitiForm } from 'ng2-activiti-form'; import { ActivatedRoute } from '@angular/router'; import { Subscription } from 'rxjs/Rx'; import { @@ -38,8 +36,7 @@ declare var componentHandler; moduleId: __moduleName, selector: 'activiti-demo', templateUrl: './activiti-demo.component.html', - styleUrls: ['./activiti-demo.component.css'], - directives: [ALFRESCO_TASKLIST_DIRECTIVES, ACTIVITI_PROCESSLIST_DIRECTIVES, ActivitiForm] + styleUrls: ['./activiti-demo.component.css'] }) export class ActivitiDemoComponent implements AfterViewChecked { diff --git a/demo-shell-ng2/app/components/activiti/form-node-viewer.component.ts b/demo-shell-ng2/app/components/activiti/form-node-viewer.component.ts index 1b5f994660..a73a709543 100644 --- a/demo-shell-ng2/app/components/activiti/form-node-viewer.component.ts +++ b/demo-shell-ng2/app/components/activiti/form-node-viewer.component.ts @@ -16,8 +16,7 @@ */ import { Component, OnInit, OnDestroy, AfterViewChecked } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { ActivitiForm, FormService, EcmModelService, NodeService } from 'ng2-activiti-form'; +import { ActivatedRoute } from '@angular/router'; import { Subscription } from 'rxjs/Rx'; declare let __moduleName: string; @@ -27,9 +26,7 @@ declare var componentHandler; moduleId: __moduleName, selector: 'form-node-viewer', templateUrl: './form-node-viewer.component.html', - styleUrls: ['./form-node-viewer.component.css'], - directives: [ActivitiForm], - providers: [FormService, EcmModelService, NodeService] + styleUrls: ['./form-node-viewer.component.css'] }) export class FormNodeViewer implements OnInit, OnDestroy, AfterViewChecked { @@ -37,9 +34,7 @@ export class FormNodeViewer implements OnInit, OnDestroy, AfterViewChecked { private sub: Subscription; - constructor(private formService: FormService, - private route: ActivatedRoute, - private router: Router) { + constructor(private route: ActivatedRoute) { } ngOnInit() { diff --git a/demo-shell-ng2/app/components/activiti/form-viewer.component.ts b/demo-shell-ng2/app/components/activiti/form-viewer.component.ts index 2acfc75777..6998e1fcb5 100644 --- a/demo-shell-ng2/app/components/activiti/form-viewer.component.ts +++ b/demo-shell-ng2/app/components/activiti/form-viewer.component.ts @@ -16,8 +16,7 @@ */ import { Component, OnInit, OnDestroy, AfterViewChecked } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { ActivitiForm, FormService, EcmModelService, NodeService } from 'ng2-activiti-form'; +import { ActivatedRoute } from '@angular/router'; import { Subscription } from 'rxjs/Rx'; declare let __moduleName: string; @@ -27,9 +26,7 @@ declare var componentHandler; moduleId: __moduleName, selector: 'form-viewer', templateUrl: './form-viewer.component.html', - styleUrls: ['./form-viewer.component.css'], - directives: [ActivitiForm], - providers: [FormService, EcmModelService, NodeService] + styleUrls: ['./form-viewer.component.css'] }) export class FormViewer implements OnInit, OnDestroy, AfterViewChecked { @@ -37,9 +34,7 @@ export class FormViewer implements OnInit, OnDestroy, AfterViewChecked { private sub: Subscription; - constructor(private formService: FormService, - private route: ActivatedRoute, - private router: Router) { + constructor(private route: ActivatedRoute) { } ngOnInit() { diff --git a/demo-shell-ng2/app/components/datatable/datatable-demo.component.ts b/demo-shell-ng2/app/components/datatable/datatable-demo.component.ts index c9c183222d..ae615fe7e6 100644 --- a/demo-shell-ng2/app/components/datatable/datatable-demo.component.ts +++ b/demo-shell-ng2/app/components/datatable/datatable-demo.component.ts @@ -17,7 +17,6 @@ import { Component } from '@angular/core'; import { - ALFRESCO_DATATABLE_DIRECTIVES, ObjectDataTableAdapter, DataSorting, ObjectDataRow, @@ -29,8 +28,7 @@ declare let __moduleName: string; @Component({ moduleId: __moduleName, selector: 'datatable-demo', - templateUrl: './datatable-demo.component.html', - directives: [ALFRESCO_DATATABLE_DIRECTIVES] + templateUrl: './datatable-demo.component.html' }) export class DataTableDemoComponent { diff --git a/demo-shell-ng2/app/components/files/files.component.ts b/demo-shell-ng2/app/components/files/files.component.ts index 79a3d5946f..2951b41fc9 100644 --- a/demo-shell-ng2/app/components/files/files.component.ts +++ b/demo-shell-ng2/app/components/files/files.component.ts @@ -18,22 +18,12 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; import { - DOCUMENT_LIST_DIRECTIVES, - DOCUMENT_LIST_PROVIDERS, DocumentActionsService, DocumentList, ContentActionHandler, DocumentActionModel, FolderActionModel } from 'ng2-alfresco-documentlist'; -import { - MDL, - AlfrescoContentService, - CONTEXT_MENU_DIRECTIVES -} from 'ng2-alfresco-core'; -import { PaginationComponent } from 'ng2-alfresco-datatable'; -import { ALFRESCO_ULPOAD_COMPONENTS } from 'ng2-alfresco-upload'; -import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer'; import { FormService } from 'ng2-activiti-form'; declare let __moduleName: string; @@ -42,16 +32,7 @@ declare let __moduleName: string; moduleId: __moduleName, selector: 'files-component', templateUrl: './files.component.html', - styleUrls: ['./files.component.css'], - directives: [ - DOCUMENT_LIST_DIRECTIVES, - MDL, - ALFRESCO_ULPOAD_COMPONENTS, - VIEWERCOMPONENT, - CONTEXT_MENU_DIRECTIVES, - PaginationComponent - ], - providers: [DOCUMENT_LIST_PROVIDERS, FormService] + styleUrls: ['./files.component.css'] }) export class FilesComponent implements OnInit { currentPath: string = '/Sites/swsdp/documentLibrary'; @@ -68,8 +49,7 @@ export class FilesComponent implements OnInit { @ViewChild(DocumentList) documentList: DocumentList; - constructor(private contentService: AlfrescoContentService, - private documentActions: DocumentActionsService, + constructor(private documentActions: DocumentActionsService, private formService: FormService, private router: Router) { documentActions.setHandler('my-handler', this.myDocumentActionHandler.bind(this)); diff --git a/demo-shell-ng2/app/components/index.ts b/demo-shell-ng2/app/components/index.ts index 9a0eb3b24c..26ba6ae5de 100644 --- a/demo-shell-ng2/app/components/index.ts +++ b/demo-shell-ng2/app/components/index.ts @@ -26,3 +26,4 @@ export { WebscriptComponent } from './webscript/webscript.component'; export { TagComponent } from './tag/tag.component'; export { AboutComponent } from './about/about.component'; export { FilesComponent } from './files/files.component'; +export { FormNodeViewer } from './activiti/form-node-viewer.component'; diff --git a/demo-shell-ng2/app/components/login/login-demo.component.ts b/demo-shell-ng2/app/components/login/login-demo.component.ts index 693bcbcb1b..a2dc0a7ef7 100644 --- a/demo-shell-ng2/app/components/login/login-demo.component.ts +++ b/demo-shell-ng2/app/components/login/login-demo.component.ts @@ -15,10 +15,9 @@ * limitations under the License. */ -import {Component, ViewChild, OnInit} from '@angular/core'; -import {AlfrescoLoginComponent} from 'ng2-alfresco-login'; -import {ROUTER_DIRECTIVES, Router} from '@angular/router'; -import {Validators} from '@angular/common'; +import { Component, ViewChild, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; +import { Validators } from '@angular/forms'; declare let __moduleName: string; @@ -26,9 +25,7 @@ declare let __moduleName: string; moduleId: __moduleName, selector: 'login-demo', templateUrl: './login-demo.component.html', - styleUrls: ['./login-demo.component.css'], - directives: [ROUTER_DIRECTIVES, AlfrescoLoginComponent], - pipes: [] + styleUrls: ['./login-demo.component.css'] }) export class LoginDemoComponent implements OnInit { diff --git a/demo-shell-ng2/app/components/router/AuthRouterOutlet.ts b/demo-shell-ng2/app/components/router/AuthRouterOutlet.ts deleted file mode 100644 index 6b85b38075..0000000000 --- a/demo-shell-ng2/app/components/router/AuthRouterOutlet.ts +++ /dev/null @@ -1,53 +0,0 @@ -/*! - * @license - * Copyright 2016 Alfresco Software, Ltd. - * - * 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. - */ - -/* -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'; - -@Directive({selector: 'auth-router-outlet'}) -export class AuthRouterOutlet extends RouterOutlet { - - publicRoutes: Array; - private router: Router; - - constructor(_elementRef: ElementRef, _loader: DynamicComponentLoader, - _parentRouter: Router, @Attribute('name') nameAttr: string, - private authentication: AlfrescoAuthenticationService) { - super(_elementRef, _loader, _parentRouter, nameAttr); - - this.router = _parentRouter; - this.publicRoutes = [ - '', 'login', 'signup' - ]; - } - - activate(instruction: ComponentInstruction) { - if (this._canActivate(instruction.urlPath)) { - return super.activate(instruction); - } - - this.router.navigate(['Login']); - } - - _canActivate(url) { - return this.publicRoutes.indexOf(url) !== -1 - || this.authentication.isLoggedIn(); - } -} -*/ diff --git a/demo-shell-ng2/app/components/search/search-bar.component.ts b/demo-shell-ng2/app/components/search/search-bar.component.ts index 318bfb7877..ed9f2e71d7 100644 --- a/demo-shell-ng2/app/components/search/search-bar.component.ts +++ b/demo-shell-ng2/app/components/search/search-bar.component.ts @@ -16,8 +16,6 @@ */ import { Component, EventEmitter, Output } from '@angular/core'; -import { ALFRESCO_SEARCH_DIRECTIVES } from 'ng2-alfresco-search'; -import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer'; import { AlfrescoAuthenticationService } from 'ng2-alfresco-core'; declare let __moduleName: string; @@ -25,8 +23,7 @@ declare let __moduleName: string; @Component({ moduleId: __moduleName, selector: 'search-bar', - templateUrl: './search-bar.component.html', - directives: [ALFRESCO_SEARCH_DIRECTIVES, VIEWERCOMPONENT] + templateUrl: './search-bar.component.html' }) export class SearchBarComponent { diff --git a/demo-shell-ng2/app/components/search/search.component.ts b/demo-shell-ng2/app/components/search/search.component.ts index 2d14f09e4b..a7306c954f 100644 --- a/demo-shell-ng2/app/components/search/search.component.ts +++ b/demo-shell-ng2/app/components/search/search.component.ts @@ -16,9 +16,6 @@ */ import { Component } from '@angular/core'; -import { AlfrescoContentService } from 'ng2-alfresco-core'; -import { ALFRESCO_SEARCH_DIRECTIVES } from 'ng2-alfresco-search'; -import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer'; declare let __moduleName: string; @@ -47,17 +44,13 @@ declare let __moduleName: string; width: 100%; } } - `], - directives: [ ALFRESCO_SEARCH_DIRECTIVES, VIEWERCOMPONENT ] + `] }) export class SearchComponent { fileShowed: boolean = false; fileNodeId: string; - constructor(public contentService: AlfrescoContentService) { - } - onFileClicked(event) { if (event.value.entry.isFile) { this.fileNodeId = event.value.entry.id; diff --git a/demo-shell-ng2/app/components/tag/tag.component.ts b/demo-shell-ng2/app/components/tag/tag.component.ts index b04db97abf..e362f692a7 100644 --- a/demo-shell-ng2/app/components/tag/tag.component.ts +++ b/demo-shell-ng2/app/components/tag/tag.component.ts @@ -16,7 +16,6 @@ */ import { Component } from '@angular/core'; -import { TAGCOMPONENT, TAGSERVICES } from 'ng2-alfresco-tag'; @Component({ selector: 'alfresco-tag-demo', @@ -31,9 +30,7 @@ import { TAGCOMPONENT, TAGSERVICES } from 'ng2-alfresco-tag'; - `, - directives: [TAGCOMPONENT], - providers: [TAGSERVICES] + ` }) export class TagComponent { diff --git a/demo-shell-ng2/app/components/webscript/webscript.component.ts b/demo-shell-ng2/app/components/webscript/webscript.component.ts index 839c42975f..db9a007c61 100644 --- a/demo-shell-ng2/app/components/webscript/webscript.component.ts +++ b/demo-shell-ng2/app/components/webscript/webscript.component.ts @@ -16,11 +16,6 @@ */ import { Component } from '@angular/core'; -import { - CONTEXT_MENU_DIRECTIVES -} from 'ng2-alfresco-core'; - -import { WEBSCRIPTCOMPONENT } from 'ng2-alfresco-webscript'; @Component({ selector: 'alfresco-webscript-demo', @@ -37,8 +32,7 @@ import { WEBSCRIPTCOMPONENT } from 'ng2-alfresco-webscript'; [servicePath]="servicePath" [contentType]="'HTML'" (onSuccess)= "logData($event)"> - `, - directives: [WEBSCRIPTCOMPONENT, CONTEXT_MENU_DIRECTIVES] + ` }) export class WebscriptComponent { diff --git a/demo-shell-ng2/app/main.ts b/demo-shell-ng2/app/main.ts index b29781b824..d585676518 100644 --- a/demo-shell-ng2/app/main.ts +++ b/demo-shell-ng2/app/main.ts @@ -15,22 +15,8 @@ * limitations under the License. */ -import { bootstrap } from '@angular/platform-browser-dynamic'; -import { PLATFORM_PIPES } from '@angular/core'; -import { HTTP_PROVIDERS } from '@angular/http'; -import { ALFRESCO_SEARCH_PROVIDERS } from 'ng2-alfresco-search'; -import { ALFRESCO_CORE_PROVIDERS, AlfrescoPipeTranslate } from 'ng2-alfresco-core'; -import { ATIVITI_FORM_PROVIDERS } from 'ng2-activiti-form'; -import { UploadService } from 'ng2-alfresco-upload'; -import { AppComponent } from './app.component'; -import { appRouterProviders } from './app.routes'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { AppModule } from './app.module'; -bootstrap(AppComponent, [ - appRouterProviders, - HTTP_PROVIDERS, - ALFRESCO_CORE_PROVIDERS, - { provide: PLATFORM_PIPES, useValue: AlfrescoPipeTranslate, multi: true }, - ALFRESCO_SEARCH_PROVIDERS, - UploadService, - ATIVITI_FORM_PROVIDERS -]).catch(err => console.error(err)); +const platform = platformBrowserDynamic(); +platform.bootstrapModule(AppModule); diff --git a/demo-shell-ng2/package.json b/demo-shell-ng2/package.json index be4f6f7ccd..3cc95f27d7 100644 --- a/demo-shell-ng2/package.json +++ b/demo-shell-ng2/package.json @@ -51,29 +51,29 @@ "alfresco" ], "dependencies": { - "@angular/common": "2.0.0-rc.3", - "@angular/compiler": "2.0.0-rc.3", - "@angular/core": "2.0.0-rc.3", - "@angular/forms": "0.1.1", - "@angular/http": "2.0.0-rc.3", - "@angular/platform-browser": "2.0.0-rc.3", - "@angular/platform-browser-dynamic": "2.0.0-rc.3", - "@angular/router": "3.0.0-alpha.7", - "@angular/router-deprecated": "2.0.0-rc.2", - "@angular/upgrade": "2.0.0-rc.3", - "alfresco-js-api": "^0.3.0", + "@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/router": "3.0.0", + "@angular/upgrade": "2.0.0", + "core-js": "^2.4.1", + "reflect-metadata": "^0.1.3", + "rxjs": "5.0.0-beta.12", "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", + "zone.js": "^0.6.23", + "rimraf": "2.5.2", "material-design-icons": "2.2.3", "material-design-lite": "1.2.1", - "ng2-translate": "2.2.0", + "ng2-translate": "2.5.0", "pdfjs-dist": "1.5.404", "flag-icon-css": "2.3.0", "intl": "1.2.4", + "alfresco-js-api": "^0.3.0", "ng2-alfresco-core": "0.3.2", "ng2-alfresco-datatable": "0.3.2", "ng2-alfresco-documentlist": "0.3.2", diff --git a/demo-shell-ng2/systemjs.config.js b/demo-shell-ng2/systemjs.config.js index 87a654c536..2eaf5d818b 100644 --- a/demo-shell-ng2/systemjs.config.js +++ b/demo-shell-ng2/systemjs.config.js @@ -2,82 +2,66 @@ * System configuration for Angular 2 samples * Adjust as necessary for your application needs. */ -(function(global) { - // map tells the System loader where to look for things - 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', +(function (global) { + System.config({ + paths: { + // paths serve as alias + 'npm:': 'node_modules/' + }, + // map tells the System loader where to look for things + map: { + // our app is within the app folder + app: 'app', + // angular bundles + '@angular/core': 'npm:@angular/core/bundles/core.umd.js', + '@angular/common': 'npm:@angular/common/bundles/common.umd.js', + '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', + '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', + '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', + '@angular/http': 'npm:@angular/http/bundles/http.umd.js', + '@angular/router': 'npm:@angular/router/bundles/router.umd.js', + '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', + // other libraries + 'rxjs': 'npm:rxjs', + 'ng2-translate': 'npm:ng2-translate', + 'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist', + 'ng2-alfresco-datatable': 'npm:ng2-alfresco-datatable/dist', + 'ng2-alfresco-documentlist': 'npm:ng2-alfresco-documentlist/dist', + 'ng2-alfresco-login': 'npm:ng2-alfresco-login/dist', + 'ng2-alfresco-search': 'npm:ng2-alfresco-search/dist', + 'ng2-alfresco-upload': 'npm:ng2-alfresco-upload/dist', + 'ng2-activiti-form': 'npm:ng2-activiti-form/dist', + 'ng2-alfresco-viewer': 'npm:ng2-alfresco-viewer/dist', + 'ng2-alfresco-webscript': 'npm:ng2-alfresco-webscript/dist', + 'ng2-alfresco-tag': 'npm:ng2-alfresco-tag/dist', + 'ng2-activiti-tasklist': 'npm:ng2-activiti-tasklist/dist', + 'alfresco-js-api': 'npm:alfresco-js-api/dist', + 'ng2-activiti-processlist': 'npm:ng2-activiti-processlist/dist' + }, + // packages tells the System loader how to load when no filename and/or no extension + packages: { + app: { + main: './main.js', + defaultExtension: 'js' + }, + rxjs: { + defaultExtension: 'js' + }, + 'ng2-translate': { defaultExtension: 'js' }, - 'ng2-translate': 'node_modules/ng2-translate', - 'ng2-alfresco-core': 'node_modules/ng2-alfresco-core/dist', - 'ng2-alfresco-datatable': 'node_modules/ng2-alfresco-datatable/dist', - 'ng2-alfresco-documentlist': 'node_modules/ng2-alfresco-documentlist/dist', - 'ng2-alfresco-login': 'node_modules/ng2-alfresco-login/dist', - 'ng2-alfresco-search': 'node_modules/ng2-alfresco-search/dist', - 'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload/dist', - 'ng2-activiti-form': 'node_modules/ng2-activiti-form/dist', - 'ng2-alfresco-viewer': 'node_modules/ng2-alfresco-viewer/dist', - 'ng2-alfresco-webscript': 'node_modules/ng2-alfresco-webscript/dist', - 'ng2-alfresco-tag': 'node_modules/ng2-alfresco-tag/dist', - 'ng2-activiti-tasklist': 'node_modules/ng2-activiti-tasklist/dist', - 'alfresco-js-api': 'node_modules/alfresco-js-api/dist', - 'ng2-activiti-processlist': 'node_modules/ng2-activiti-processlist/dist' - }; - // packages tells the System loader how to load when no filename and/or no extension - var packages = { - 'app': { main: 'main.js', defaultExtension: 'js' }, - 'rxjs': { defaultExtension: 'js' }, - 'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' }, - - 'ng2-translate': { defaultExtension: 'js' }, - - 'ng2-alfresco-core': { main: 'index.js', defaultExtension: 'js'}, - 'ng2-alfresco-datatable': { main: 'index.js', defaultExtension: 'js'}, - 'ng2-alfresco-documentlist': { main: 'index.js', defaultExtension: 'js'}, - 'ng2-alfresco-login': { main: 'index.js', defaultExtension: 'js'}, - 'ng2-alfresco-search': { main: 'index.js', defaultExtension: 'js'}, - 'ng2-alfresco-upload': { main: 'index.js', defaultExtension: 'js'}, - 'ng2-alfresco-viewer': { main: 'index.js', defaultExtension: 'js'}, - 'ng2-activiti-form': { main: 'index.js', defaultExtension: 'js'}, - 'ng2-activiti-processlist': { main: 'index.js', defaultExtension: 'js'}, - 'ng2-activiti-tasklist': { main: 'index.js', defaultExtension: 'js'}, - 'ng2-alfresco-webscript': { main: 'index.js', defaultExtension: 'js'}, - 'ng2-alfresco-tag': { main: 'index.js', defaultExtension: 'js'}, - 'alfresco-js-api': { main: 'alfresco-js-api.js', 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: '/bundles/' + 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); - - // No umd for router yet - packages['@angular/router'] = { main: 'index.js', defaultExtension: 'js' }; - - var config = { - map: map, - packages: packages - }; - System.config(config); + 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-datatable': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-documentlist': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-login': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-search': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-upload': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-viewer': { main: './index.js', defaultExtension: 'js'}, + 'ng2-activiti-form': { main: './index.js', defaultExtension: 'js'}, + 'ng2-activiti-processlist': { main: './index.js', defaultExtension: 'js'}, + 'ng2-activiti-tasklist': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-webscript': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-tag': { main: './index.js', defaultExtension: 'js'}, + 'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'} + } + }); })(this);