@cobaltio/ngx-cobalt-legacy
v0.0.1-beta.1
Published
> Cobalt frontend SDK for Angular
Downloads
8
Readme
ngx-cobalt
Cobalt frontend SDK for Angular
Install
Install Cobalt SDK
npm install --save @cobaltio/cobalt-js @cobaltio/ngx-cobalt-legacy
Install Angular Material (with animations).
ng add @angular/material@16
Usage
Import CobaltConfig in your Angular Module
// app.module.ts
// ...
import { CobaltConfig } from '@cobaltio/ngx-cobalt-legacy';
@NgModule({
declarations: [
AppComponent
],
imports: [
CobaltConfig,
// ...
],
providers: [],
bootstrap: [AppComponent]
})
// ...
Or your Angular Component if you're not using Angular Module
// app.component.ts
// ...
import { CobaltConfig } from '@cobaltio/ngx-cobalt-legacy';
@Component({
selector: 'app-root',
standalone: true,
imports: [
CobaltConfig,
// ...
],
templateUrl: './app.component.html',
styleUrl: './app.component.css'
})
// ...
<!-- app.component.html -->
<!--
Pass the Cobalt session token (that you generated using the Cobalt backend SDK) to the component.
Ideally you'd render the Config component inside a modal.
`token` & `slug` are the only required attributes.
-->
<cobalt-config
id="OPTIONAL_UNIQUE_CONFIG_ID"
token="COBALT_TOKEN"
slug="APP_SLUG"
[labels]="LABELS"
[removeBranding]="false"
/>