0.0.10 • Published 1 year ago
spatial-web-component v0.0.10
Spatial-Frontend
Angular
Install
$ npm install spatial-web-component
How to import the spatial map web component
In the app.module import the spatial-frontend and CUSTOM_ELEMENTS_SCHEMA from the @angular/core
app.module.ts
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
In the app.component.ts import the webcomponent from the package and define it in the customElements.define function which takes in two parameters ,the web-component-tag name and the second one is the name of the web-component
main.ts
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { defineCustomElements } from 'spatial-web-component/loader';
import { AppModule } from './app/app.module';
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
defineCustomElements(window);
app.component.html
<br-map height="100vh" width="100vw"></br-map>