#17 Demo app Login component

This commit is contained in:
mauriziovitale84
2016-04-28 17:22:25 +01:00
parent e40c15ebfc
commit 860cff2368
12 changed files with 273 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
import { Router } from 'angular2/router';
import { AlfrescoSettingsService } from 'ng2-alfresco-core/services';
import { AlfrescoAuthenticationService } from 'ng2-alfresco-login/ng2-alfresco-login';
export declare class AppComponent {
auth: AlfrescoAuthenticationService;
router: Router;
constructor(auth: AlfrescoAuthenticationService, router: Router, alfrescoSettingsService: AlfrescoSettingsService);
}

View File

@@ -0,0 +1,54 @@
System.register(['angular2/core', 'ng2-alfresco-login/ng2-alfresco-login', 'angular2/router', 'ng2-alfresco-core/services'], function(exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1, ng2_alfresco_login_1, router_1, services_1, ng2_alfresco_login_2;
var AppComponent;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (ng2_alfresco_login_1_1) {
ng2_alfresco_login_1 = ng2_alfresco_login_1_1;
ng2_alfresco_login_2 = ng2_alfresco_login_1_1;
},
function (router_1_1) {
router_1 = router_1_1;
},
function (services_1_1) {
services_1 = services_1_1;
}],
execute: function() {
AppComponent = (function () {
function AppComponent(auth, router, alfrescoSettingsService) {
this.auth = auth;
this.router = router;
alfrescoSettingsService.host = 'http://192.168.99.100:8080';
}
AppComponent = __decorate([
core_1.Component({
selector: 'my-app',
template: '<alfresco-login></alfresco-login>',
directives: [router_1.ROUTER_DIRECTIVES, ng2_alfresco_login_1.AlfrescoLoginComponent]
}),
router_1.RouteConfig([
{ path: '/', name: 'Login', component: ng2_alfresco_login_1.AlfrescoLoginComponent, useAsDefault: true }
]),
__metadata('design:paramtypes', [ng2_alfresco_login_2.AlfrescoAuthenticationService, router_1.Router, services_1.AlfrescoSettingsService])
], AppComponent);
return AppComponent;
}());
exports_1("AppComponent", AppComponent);
}
}
});
//# sourceMappingURL=app.component.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"app.component.js","sourceRoot":"","sources":["app.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAgBA;gBAEI,sBAAmB,IAAkC,EAClC,MAAa,EACpB,uBAA+C;oBAFxC,SAAI,GAAJ,IAAI,CAA8B;oBAClC,WAAM,GAAN,MAAM,CAAO;oBAE5B,uBAAuB,CAAC,IAAI,GAAG,4BAA4B,CAAC;gBAEhE,CAAC;gBAhBL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,QAAQ;wBAClB,QAAQ,EAAE,mCAAmC;wBAC7C,UAAU,EAAE,CAAC,0BAAiB,EAAE,2CAAsB,CAAC;qBAC1D,CAAC;oBAED,oBAAW,CAAC;wBACT,EAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,2CAAsB,EAAE,YAAY,EAAE,IAAI,EAAC;qBACpF,CAAC;;gCAAA;gBAUF,mBAAC;YAAD,CAAC,AATD,IASC;YATD,uCASC,CAAA"}

View File

@@ -0,0 +1,26 @@
import {Component} from 'angular2/core';
import {AlfrescoLoginComponent} from 'ng2-alfresco-login/ng2-alfresco-login';
import {Router, RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';
import {AlfrescoSettingsService} from 'ng2-alfresco-core/services';
import {AlfrescoAuthenticationService} from 'ng2-alfresco-login/ng2-alfresco-login';
@Component({
selector: 'my-app',
template: '<alfresco-login></alfresco-login>',
directives: [ROUTER_DIRECTIVES, AlfrescoLoginComponent]
})
@RouteConfig([
{path: '/', name: 'Login', component: AlfrescoLoginComponent, useAsDefault: true}
])
export class AppComponent {
constructor(public auth:AlfrescoAuthenticationService,
public router:Router,
alfrescoSettingsService:AlfrescoSettingsService) {
alfrescoSettingsService.host = 'http://192.168.99.100:8080';
}
}

View File

View File

@@ -0,0 +1,48 @@
System.register(['angular2/platform/browser', './app.component', 'ng2-alfresco-login/ng2-alfresco-login', 'angular2/router', 'angular2/core', 'angular2/http', 'ng2-translate/ng2-translate', 'ng2-alfresco-core/services'], function(exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var browser_1, app_component_1, ng2_alfresco_login_1, router_1, core_1, http_1, http_2, ng2_translate_1, services_1;
return {
setters:[
function (browser_1_1) {
browser_1 = browser_1_1;
},
function (app_component_1_1) {
app_component_1 = app_component_1_1;
},
function (ng2_alfresco_login_1_1) {
ng2_alfresco_login_1 = ng2_alfresco_login_1_1;
},
function (router_1_1) {
router_1 = router_1_1;
},
function (core_1_1) {
core_1 = core_1_1;
},
function (http_1_1) {
http_1 = http_1_1;
http_2 = http_1_1;
},
function (ng2_translate_1_1) {
ng2_translate_1 = ng2_translate_1_1;
},
function (services_1_1) {
services_1 = services_1_1;
}],
execute: function() {
browser_1.bootstrap(app_component_1.AppComponent, [
router_1.ROUTER_PROVIDERS,
http_2.HTTP_PROVIDERS,
core_1.provide(ng2_translate_1.TranslateLoader, {
useFactory: function (http) { return new ng2_translate_1.TranslateStaticLoader(http, 'node_modules/ng2-alfresco-login/i18n', '.json'); },
deps: [http_1.Http]
}),
// use TranslateService here, and not TRANSLATE_PROVIDERS (which will define a default TranslateStaticLoader)
ng2_translate_1.TranslateService,
ng2_alfresco_login_1.ALFRESCO_AUTHENTICATION,
services_1.ALFRESCO_CORE_PROVIDERS
]);
}
}
});
//# sourceMappingURL=main.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAUA,mBAAS,CAAC,4BAAY,EAAE;gBACpB,yBAAgB;gBAChB,qBAAc;gBACd,cAAO,CAAC,+BAAe,EAAE;oBACrB,UAAU,EAAE,UAAC,IAAU,IAAK,OAAA,IAAI,qCAAqB,CAAC,IAAI,EAAE,sCAAsC,EAAE,OAAO,CAAC,EAAhF,CAAgF;oBAC5G,IAAI,EAAE,CAAC,WAAI,CAAC;iBACf,CAAC;gBACF,6GAA6G;gBAC7G,gCAAgB;gBAChB,4CAAuB;gBACvB,kCAAuB;aAC1B,CAAC,CAAC"}

View File

@@ -0,0 +1,22 @@
import {bootstrap} from 'angular2/platform/browser';
import {AppComponent} from './app.component';
import {ALFRESCO_AUTHENTICATION} from 'ng2-alfresco-login/ng2-alfresco-login';
import {ROUTER_PROVIDERS} from 'angular2/router';
import {provide} from 'angular2/core';
import {Http} from 'angular2/http';
import {HTTP_PROVIDERS} from 'angular2/http';
import {TRANSLATE_PROVIDERS, TranslateService, TranslateLoader, TranslateStaticLoader} from 'ng2-translate/ng2-translate';
import {ALFRESCO_CORE_PROVIDERS} from 'ng2-alfresco-core/services';
bootstrap(AppComponent, [
ROUTER_PROVIDERS,
HTTP_PROVIDERS,
provide(TranslateLoader, {
useFactory: (http: Http) => new TranslateStaticLoader(http, 'node_modules/ng2-alfresco-login/i18n', '.json'),
deps: [Http]
}),
// use TranslateService here, and not TRANSLATE_PROVIDERS (which will define a default TranslateStaticLoader)
TranslateService,
ALFRESCO_AUTHENTICATION,
ALFRESCO_CORE_PROVIDERS
]);

View File

@@ -0,0 +1,60 @@
<html>
<head>
<title>Alfresco Login Component Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href="/">
<!-- 1. Load libraries -->
<!-- IE required polyfills, in this exact order -->
<script src="node_modules/es6-shim/es6-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>
<!-- 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="https://fonts.googleapis.com/icon?family=Material+Icons">
<!-- 2. Configure SystemJS -->
<script>
System.config({
map: {
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core',
'ng2-alfresco-login': 'node_modules/ng2-alfresco-login',
'ng2-translate': 'node_modules/ng2-translate',
'rxjs': 'node_modules/rxjs'
},
packages: {
app: {
defaultExtension: 'js'
},
'ng2-alfresco-core': {
defaultExtension: 'js'
},
'ng2-alfresco-login': {
defaultExtension: 'js'
},
'ng2-translate': {
defaultExtension: 'js'
},
'rxjs': {
defaultExtension: 'js'
}
}
});
System.import('app/main')
.then(null, console.error.bind(console));
</script>
</head>
<!-- 3. Display the application -->
<body>
<my-app>Loading...</my-app>
</body>
</html>

View File

@@ -0,0 +1,29 @@
{
"name": "angular2-quickstart",
"version": "1.0.0",
"scripts": {
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
"lite": "lite-server",
"postinstall": "typings install",
"tsc": "tsc",
"tsc:w": "tsc -w",
"typings": "typings"
},
"license": "ISC",
"dependencies": {
"angular2": "2.0.0-beta.16",
"systemjs": "0.19.26",
"es6-shim": "^0.35.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "0.6.12",
"ng2-translate": "^1.11.2",
"material-design-lite": "^1.1.3"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.2.0",
"typescript": "^1.8.10",
"typings":"^0.8.1"
}
}

View File

@@ -0,0 +1,18 @@
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"declaration": true
},
"exclude": [
"node_modules",
"typings/main",
"typings/main.d.ts"
]
}

View File

@@ -0,0 +1,6 @@
{
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#5c182b9af717f73146399c2485f70f1e2ac0ff2b"
}
}