
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
dotcms-js
Advanced tools
Set of components and services which allow you to connect to use data from a dotCMS installation
This is a library of services and components to interact with a DotCMS instance from Angular 2.
npm install dotcms-js --save
import {APP_CONFIG, DOT_CONFIG} from "dotcms-js/core/app.config";
import {FileSystemService} from "dotcms-js/core/util/filesystem.service";
import {HttpClient} from "dotcms-js/core/util/http.service";
import {JWTAuthService} from "dotcms-js/core/util/jwt-auth.service";
import {LocalStoreService} from "dotcms-js/core/util/local-store.service";
import {LoggerService} from "dotcms-js/core/util/logger.service";
import {NotificationService} from "dotcms-js/core/util/notification.service";
import {SettingsStorageService} from "dotcms-js/core/util/settings-storage.service";
import {SiteBrowserService} from "dotcms-js/core/util/site-browser.service";
import {SiteBrowserState} from "dotcms-js/core/util/site-browser.state";
@NgModule({
providers: [
{provide: APP_CONFIG, useValue: DOT_CONFIG},
{provide: FileSystemService, useClass: FileSystemService},
{provide: HttpClient, useClass: HttpClient},
{provide: JWTAuthService, useClass: JWTAuthService},
{provide: LocalStoreService, useClass: LocalStoreService},
{provide: LoggerService, useClass: LoggerService},
{provide: NotificationService, useClass: NotificationService},
{provide: SettingsStorageService, useClass: SettingsStorageService},
{provide: SiteBrowserService, useClass: SiteBrowserService},
{provide: SiteBrowserState, useClass: SiteBrowserState}
],
})
In order to start using the components you need to make sure you have a Auth Token. To get it we provide a login
method in the JWTAuthService
class.
If the login it's succefull the login
method will save an Auth Token to the localStorage in the browser so other services can use it, more info in our documentation.
In this example we are doing the login from the app.component.ts
but you can do it from aywhere you need.
import {Component, ViewEncapsulation} from '@angular/core';
import {JWTAuthService} from "dotcms-js/core/util/jwt-auth.service";
@Component({
selector: 'my-app',
template: '<h1>My App Component</h1>',
})
export class AppComponent {
constructor(authService: JWTAuthService) {
authService.login("http://demo.dotcms.com", "admin@dotcms.com", "admin").subscribe(token => {
console.log('Login successfully');
}, (err) => {
console.log('Error on login', err);
});
}
}
import {BreadcrumbComponent} from "dotcms-js/components/breadcrumb/breadcrumb.componet";
@NgModule({
declarations: [
BreadcrumbComponent
],
})
<breadcrumb></breadcrumb>
Initial commit
After you clone the repo
npm i
typings install
npm run build
FAQs
DotCMS UI Angular App
The npm package dotcms-js receives a total of 15 weekly downloads. As such, dotcms-js popularity was classified as not popular.
We found that dotcms-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.