@samuelphung
Please follow the given steps to extend Angular UI for Annotation:
-
Download annotation sample project https://github.com/groupdocs-annotation/GroupDocs.Annotation-for-.NET-WebForms/archive/master.zip
-
Open WebForms solution
-
Navigate to folder .\GroupDocs.Annotation-for-.NET-WebForms-master\src\client\apps\annotation\src\app
-
Copy content from https://github.com/groupdocs-total/GroupDocs.Total-Angular/blob/master/libs/annotation/src/lib/annotation-app.component.html to app.component.html
-
Copy content from https://github.com/groupdocs-total/GroupDocs.Total-Angular/blob/master/libs/annotation/src/lib/annotation-app.component.less to app.component.less
-
Create variables.less with this content (https://github.com/groupdocs-total/GroupDocs.Total-Angular/blob/master/libs/common-components/src/styles/variables.less) in project and update link to the newly create file from in app.component.less line:2
-
Update app.component.ts with the following code
import { Component } from '@angular/core';
import { ActiveAnnotationService, AnnotationAppComponent, AnnotationConfigService, AnnotationService, CommentAnnotationService, RemoveAnnotationService } from '@groupdocs.examples.angular/annotation';
import {
AddDynamicComponentService,
HostingDynamicComponentService,
ModalService,
NavigateService, PagePreloadService, PasswordService,
TopTabActivatorService, UploadFilesService,
WindowService,
ZoomService
} from "@groupdocs.examples.angular/common-components";
@Component({
selector: 'client-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.less']
})
export class AppComponent extends AnnotationAppComponent {
title = 'annotation';
constructor(_annotationService: AnnotationService,
_modalService: ModalService,
_navigateService: NavigateService,
_tabActivatorService: TopTabActivatorService,
_hostingComponentsService: HostingDynamicComponentService,
_addDynamicComponentService: AddDynamicComponentService,
_activeAnnotationService: ActiveAnnotationService,
_removeAnnotationService: RemoveAnnotationService,
_commentAnnotationService: CommentAnnotationService,
uploadFilesService: UploadFilesService,
pagePreloadService: PagePreloadService,
passwordService: PasswordService,
_windowService: WindowService,
_zoomService: ZoomService,
configService: AnnotationConfigService) {
super(_annotationService,
_modalService,
_navigateService,
_tabActivatorService,
_hostingComponentsService,
_addDynamicComponentService,
_activeAnnotationService,
_removeAnnotationService,
_commentAnnotationService,
uploadFilesService,
pagePreloadService,
passwordService,
_windowService,
_zoomService,
configService
)
}
}
- Update app.module.ts with the following code
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AnnotationModule } from "@groupdocs.examples.angular/annotation";
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
AnnotationModule,
FontAwesomeModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}
-
Open terminal and move to this folder .\GroupDocs.Annotation-for-.NET-WebForms-master\src\client
-
Run ‘npm install’ command
-
Run ‘npm run build’ command
-
Build and run WebForms solution (from step 2)
Note Every time you make changes to Angular app project, you must run ‘npm run build’ command in order to see your changes on the Web page.
That’s how you can setup annotation project locally and update it however you want. You can check source code in this repo. This may help you understand project better.