mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Fix documentation with Rc1 changes and route
This commit is contained in:
@@ -92,31 +92,26 @@ Example of an App that use Alfresco login component :
|
|||||||
main.ts
|
main.ts
|
||||||
```ts
|
```ts
|
||||||
|
|
||||||
import { bootstrap } from 'angular2/platform/browser';
|
import { Component } from '@angular/core';
|
||||||
import { Component } from 'angular2/core';
|
import { bootstrap } from '@angular/platform-browser-dynamic';
|
||||||
import { Router, RouteConfig, ROUTER_DIRECTIVES } from 'angular2/router';
|
import { AlfrescoLoginComponent } from 'ng2-alfresco-login';
|
||||||
import { AlfrescoSettingsService, AlfrescoAuthenticationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
import { HTTP_PROVIDERS } from '@angular/http';
|
||||||
import { AlfrescoLoginComponent } from 'ng2-alfresco-login/dist/ng2-alfresco-login';
|
import {
|
||||||
import { ROUTER_PROVIDERS } from 'angular2/router';
|
ALFRESCO_CORE_PROVIDERS,
|
||||||
import { HTTP_PROVIDERS } from 'angular2/http';
|
AlfrescoSettingsService,
|
||||||
import { ALFRESCO_CORE_PROVIDERS, AlfrescoTranslationService, AlfrescoTranslationLoader } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
AlfrescoAuthenticationService
|
||||||
|
} from 'ng2-alfresco-core';
|
||||||
|
|
||||||
|
|
||||||
@RouteConfig([
|
|
||||||
{path: '/', name: 'Login', component: AlfrescoLoginComponent, useAsDefault: true}
|
|
||||||
])
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-app',
|
selector: 'my-app',
|
||||||
template: '<alfresco-login method="POST" (onSuccess)="mySuccessMethod($event)" (onError)="myErrorMethod($event)"></alfresco-login>',
|
template: '<alfresco-login (onSuccess)="mySuccessMethod($event)" (onError)="myErrorMethod($event)"></alfresco-login>',
|
||||||
directives: [ROUTER_DIRECTIVES, AlfrescoLoginComponent]
|
directives: [AlfrescoLoginComponent]
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
|
|
||||||
constructor(public auth: AlfrescoAuthenticationService,
|
constructor(public auth: AlfrescoAuthenticationService,
|
||||||
public router: Router,
|
|
||||||
alfrescoSettingsService: AlfrescoSettingsService) {
|
alfrescoSettingsService: AlfrescoSettingsService) {
|
||||||
alfrescoSettingsService.host = 'http://192.168.99.100:8080';
|
alfrescoSettingsService.host = 'http://192.168.99.100:8080';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mySuccessMethod($event) {
|
mySuccessMethod($event) {
|
||||||
@@ -130,11 +125,7 @@ export class AppComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bootstrap(AppComponent, [
|
bootstrap(AppComponent, [
|
||||||
ROUTER_PROVIDERS,
|
|
||||||
HTTP_PROVIDERS,
|
HTTP_PROVIDERS,
|
||||||
AlfrescoTranslationLoader,
|
|
||||||
AlfrescoTranslationService,
|
|
||||||
AlfrescoAuthenticationService,
|
|
||||||
ALFRESCO_CORE_PROVIDERS
|
ALFRESCO_CORE_PROVIDERS
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user