Hi to all,
is there a guide indicating how to use webcomponents in angular (I need @openremote/core and @openremote/rest)?
I need to connect an app 8webapplication) written in angular with openremote rest api using webcomponent.
I try in this way but with no luck, the compiler show this error:
Error: Module not found: Error: Package path . is not exported from package /webc-test/node_modules/@openremote/core (see exports field in /webc-test/node_modules/@openremote/core/package.json)
I follow this steps to integrate or webcomponent
- npm install @openremote/core
- in app.modeule.ts insert this code
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
. . . . .
schemas: [
CUSTOM_ELEMENTS_SCHEMA // Tells Angular we will have custom tags in our templates
],
- in app.component.ts
import manager, {Auth, Manager} from "@openremote/core";
. . . . .
manager.init({
managerUrl: "http://localhost",
keycloakUrl: "http://localhost/auth",
auth: Auth.KEYCLOAK,
autoLogin: false,
realm: "main",
configureTranslationsOptions: (options) => {
options.lng = "it"; // Change initial language to italian
}
}).then((success) => {
if (success) {
if (manager.authenticated) {
console.log('Auth true');
}
}
});
Has anyone been successful with integrating webcomponents into angular?