This commit is contained in:
mauriziovitale84
2016-05-24 13:01:19 +01:00
parent 61614a1a98
commit 793ed8c02b
5 changed files with 54 additions and 43 deletions

View File

@@ -1,4 +1,4 @@
# angular2-testing # angular2-alfresco-login
Install: Install:

View File

@@ -5,6 +5,11 @@
<title>Angular 2 Testing</title> <title>Angular 2 Testing</title>
<base href="/"> <base href="/">
<!-- Google Material Design Lite -->
<link rel="stylesheet" href="node_modules/material-design-lite/material.min.css">
<script src="node_modules/material-design-lite/material.min.js"></script>
<link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css">
<!-- 1. Load libraries --> <!-- 1. Load libraries -->
<!-- IE required polyfills, in this exact order --> <!-- IE required polyfills, in this exact order -->
<script src="node_modules/es6-shim/es6-shim.min.js"></script> <script src="node_modules/es6-shim/es6-shim.min.js"></script>
@@ -16,6 +21,7 @@
<script src="node_modules/angular2/bundles/angular2.dev.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/router.dev.js"></script>
<script src="node_modules/angular2/bundles/http.dev.js"></script> <script src="node_modules/angular2/bundles/http.dev.js"></script>
<script src="node_modules/alfresco-core-rest-api/bundle.js"></script>
<script> <script>
System.config({ System.config({
@@ -23,14 +29,13 @@
map: { map: {
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core', 'ng2-alfresco-core': 'node_modules/ng2-alfresco-core',
'ng2-alfresco-login': 'node_modules/ng2-alfresco-login', 'ng2-alfresco-login': 'node_modules/ng2-alfresco-login',
'ng2-translate': 'node_modules/ng2-translate',
'rxjs': 'node_modules/rxjs', 'rxjs': 'node_modules/rxjs',
'angular2' : 'node_modules/angular2', 'angular2' : 'node_modules/angular2',
'ng2-translate' : 'node_modules/ng2-translate', 'ng2-translate': 'node_modules/ng2-translate',
'app': 'dist/src' 'src': 'src'
}, },
packages: { packages: {
'app': { 'src': {
defaultExtension: 'js' defaultExtension: 'js'
}, },
'ng2-alfresco-core': { 'ng2-alfresco-core': {
@@ -39,9 +44,6 @@
'ng2-alfresco-login': { 'ng2-alfresco-login': {
defaultExtension: 'js' defaultExtension: 'js'
}, },
'ng2-translate': {
defaultExtension: 'js'
},
'rxjs': { 'rxjs': {
defaultExtension: 'js' defaultExtension: 'js'
}, },
@@ -51,7 +53,7 @@
} }
}); });
System.import('dist/src/my-app').catch(console.log.bind(console)); System.import('dist/main').catch(console.log.bind(console));
</script> </script>
</head> </head>

View File

@@ -5,34 +5,45 @@
"author": "Alfresco Software, Ltd.", "author": "Alfresco Software, Ltd.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"postinstall": "npm run typings", "postinstall": "npm run build && npm run typings",
"typings": "typings install", "typings": "typings install",
"start": "npm run test && http-server -c-1 -o -p 8875 .", "start": "rm -rf dist && npm install && npm run server",
"build": "rm -rf dist && tsc", "server": "lite-server",
"pretest": "npm install && npm run build" "build": "rm -rf dist && tsc"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"contributors": [
{
"name": "Maurizio Vitale",
"email": "maurizio.vitale@alfresco.com"
}
],
"keywords": [
"ng2",
"angular",
"angular2",
"alfresco"
],
"dependencies": { "dependencies": {
"angular2": "2.0.0-beta.13", "alfresco-core-rest-api": "^0.1.0",
"es6-promise": "3.0.2", "angular2": "2.0.0-beta.15",
"es6-shim": "0.35.0", "es6-shim": "^0.35.0",
"material-design-icons": "^2.2.3",
"material-design-lite": "^1.1.3",
"ng2-alfresco-core": "^0.1.0",
"ng2-alfresco-login": "^0.1.0", "ng2-alfresco-login": "^0.1.0",
"ng2-translate": "^1.11.3",
"ng2-translate": "^1.11.2",
"reflect-metadata": "0.1.2", "reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2", "rxjs": "5.0.0-beta.2",
"zone.js": "0.6.6" "systemjs": "0.19.26",
"zone.js": "0.6.10"
}, },
"devDependencies": { "devDependencies": {
"http-server": "0.8.5", "browser-sync": "^2.10.0",
"systemjs": "0.19.17", "concurrently": "^2.0.0",
"typescript": "1.7.5", "lite-server": "^2.2.0",
"typings": "0.6.8" "typescript": "^1.8.10",
"typings": "^0.7.12"
}, },
"keywords": [
"angular2",
"typescript"
],
"publishConfig": { "publishConfig": {
"registry": "http://devproducts.alfresco.me:4873/" "registry": "http://devproducts.alfresco.me:4873/"
} }

View File

@@ -18,11 +18,9 @@
*/ */
import { Component } from 'angular2/core'; import { Component } from 'angular2/core';
import { AlfrescoLoginComponent } from 'ng2-alfresco-login/ng2-alfresco-login'; import { AlfrescoLoginComponent, AlfrescoAuthenticationService } from 'ng2-alfresco-login/dist/ng2-alfresco-login';
import { Router, RouteConfig, ROUTER_DIRECTIVES } from 'angular2/router'; import { Router, RouteConfig, ROUTER_DIRECTIVES } from 'angular2/router';
import { AlfrescoSettingsService } from 'ng2-alfresco-core/services'; import { AlfrescoSettingsService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import { AlfrescoAuthenticationService } from 'ng2-alfresco-login/ng2-alfresco-login';
@Component({ @Component({
selector: 'my-login', selector: 'my-login',
@@ -33,7 +31,7 @@ import { AlfrescoAuthenticationService } from 'ng2-alfresco-login/ng2-alfresco-l
@RouteConfig([ @RouteConfig([
{path: '/', name: 'Login', component: AlfrescoLoginComponent, useAsDefault: true} {path: '/', name: 'Login', component: AlfrescoLoginComponent, useAsDefault: true}
]) ])
export class MyLoginComponent { export class AppComponent {
constructor(public auth: AlfrescoAuthenticationService, constructor(public auth: AlfrescoAuthenticationService,
public router: Router, public router: Router,

View File

@@ -15,20 +15,20 @@
* limitations under the License. * limitations under the License.
*/ */
import {bootstrap} from 'angular2/platform/browser'; import { bootstrap } from 'angular2/platform/browser';
import {MyLoginComponent} from './components/my-login.component'; import { AppComponent } from './components/app-component';
import {ALFRESCO_AUTHENTICATION} from 'ng2-alfresco-login/ng2-alfresco-login'; import { ALFRESCO_AUTHENTICATION } from 'ng2-alfresco-login/dist/ng2-alfresco-login';
import {ROUTER_PROVIDERS} from 'angular2/router'; import { ROUTER_PROVIDERS } from 'angular2/router';
import {provide} from 'angular2/core'; import { provide } from 'angular2/core';
import {HTTP_PROVIDERS} from 'angular2/http'; import { Http } from 'angular2/http';
import {TranslateService, TranslateLoader} from 'ng2-translate/ng2-translate'; import { HTTP_PROVIDERS } from 'angular2/http';
import {ALFRESCO_CORE_PROVIDERS, AlfrescoTranslationService} from 'ng2-alfresco-core/services'; import { ALFRESCO_CORE_PROVIDERS, AlfrescoTranslationService, AlfrescoTranslationLoader } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
bootstrap(MyLoginComponent, [ bootstrap(AppComponent, [
ROUTER_PROVIDERS, ROUTER_PROVIDERS,
HTTP_PROVIDERS, HTTP_PROVIDERS,
provide(TranslateLoader, {useClass: AlfrescoTranslationService}), AlfrescoTranslationLoader,
TranslateService, AlfrescoTranslationService,
ALFRESCO_AUTHENTICATION, ALFRESCO_AUTHENTICATION,
ALFRESCO_CORE_PROVIDERS ALFRESCO_CORE_PROVIDERS
]); ]);