node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »

ibm-wch-sdk-ng

IBM Angular SDK for Watston Content Hub

NPM version

This module represents a software development kit (SDK) that can be used by Angular 4 based applications to build single page applications (SPA) against Watson Content Hub (WCH) managed pages.

Changes

CHANGELOG

Usage

npm install --save ibm-wch-sdk-ng

Class documentation

Refer to the documentation.

Components

The SDK defines one top level module module for use in the application component.

imports[
    ...
    WchNgModule.forRoot({ apiUrl: new URL(apiUrl), deliveryUrl: new URL(deliveryUrl) })
    ...
]

First steps

Building an application for WCH involves a client side and a server side step. During the server side step you create your content in WCH. During the client side step you build your Angular 4 application that consumers the content.

Prerequisites

Server Side

Please refer to the Server Side Setup instructions.

Client Side

First install angular-cli using

npm install -g @angular/cli

Bootstrap your angular application

ng new PROJECT-NAME
cd PROJECT-NAME

Install the WCH SDK and its peer dependencies:

npm install --save ibm-wch-sdk-ng

Create angular components for the layouts defined during the server setup.

ng g component layouts/MY_COMPONENT

Add a layout selector to your component. The selector creates the connection between the layout identifier and the angular component. In addition it is convenient (but not required) to subclass your new component from AbstractRenderingComponent. Make the following changes to the MY_COMPONENT.ts file created in the step before:

import { LayoutComponent, AbstractRenderingComponent } from 'ibm-wch-sdk-ng';
 
@LayoutComponent({
  selector: ['MY_COMPONENT_SELECTOR']
})
@Component({
    ...
})
export class MyComponent extends AbstractRenderingComponent {
 
    constructor() {
        super();
    }
}

Make sure to add your new layout to the set of entry components of the main module, because the component will be instantiated dynamically:

@NgModule({
  ...
  entryComponents[MyComponent, ...],
  ...
})
export class AppModule {
}

You will typically run your application in local development mode, first. Configure it to use the WCH server and tenant of your choice as the backend service. Do this by adding the configured WchModule to the main application module. A convenient way to configure this module is via the environment config file. The CLI will automatically select the correct file depending on your development environment (e.g. dev vs. production).

import { WchModule } from 'ibm-wch-sdk-ng';
import { environment } from '../environments/environment';
...
@NgModule({
...
  imports[
    ...
    WchNgModule.forRoot(environment)
    ...
  ]
})
export class AppModule {
}

The content of the environment file for local development might look like this:

const HOSTNAME = 'dch-dxcloud.rtp.raleigh.ibm.com';
const TENANT_ID = '7576818c-ca11-4b86-b03d-333313c4f0ad';
export const apiUrl = `http://${HOSTNAME}/api/${TENANT_ID}`;
export const deliveryUrl = `http://${HOSTNAME}/${TENANT_ID}`;
 
export const environment = {
  production: false,
  apiUrl: new URL(apiUrl),
  deliveryUrl: new URL(deliveryUrl)
};

In a last step you'll add routing to the application. The easiest way is to configure all routes to be served by WCH pages. For this create the following router config and add it to your main application module:

import { PageComponent } from 'ibm-wch-sdk-ng';
...
import { RouterModule, Routes } from '@angular/router';
...
 
const appRoutes: Routes = [
  {
    path: '',
    redirectTo: '/home',
    pathMatch: 'full'
  },
  {
    path: '**',
    component: PageComponent
  }
];
 
@NgModule({
    ...
  imports[
    RouterModule.forRoot(appRoutes),
    ...
  ]
})
export class AppModule {
}
 

Start your local development server and enjoy:

ng serve

Note

Using the development version of the NPM registry

Add the file .npmrc to your application folder:

registry = http://wats-repob.devlab.ibm.com
@request:registry=https://registry.npmjs.org/
@types:registry=https://registry.npmjs.org/
@angular:registry=https://registry.npmjs.org/
@ngtools:registry=https://registry.npmjs.org/

Changelog

Current

Added

  • New SearchService
  • New luceneEscapeTerm and luceneEscapeKeyValue methods to simplify the generation of search queries
  • Support for optionselection elements

Changed

  • Updated HTTP transport layer from deprecated Http to HttpClient. Requires minimum angular dependency of 4.3.0.

1.0.771 - 2018-01-16

Added

  • New WchLoggerService
  • New WchInfoService
  • Adding describeSetter in 'AbstractLifeCycleComponent'
  • Basic support for new [wchEditable] directive
  • Support for levels parameter in wch-contentref

Fixed

  • Compatibility to Angular 5

Index

External modules


WchNgModule

The main SDK module exposes the components and services to be used by the application. Have a look at development stories for an explanation of usecases.

Usage

imports[
    ...
    WchNgModule.forRoot({ apiUrl: new URL(apiUrl), deliveryUrl: new URL(deliveryUrl) })
    ...
]

Add the module to your main application module using the forRoot accessor method. The context passed to the accessor defines the entry URLs into WCH.

Tipps

For your convenience you can also keep the URLs as part of the environment properties. In this case pass the environment directly to the forRoot method and declare the urls as part of the environment object, e.g.

import { environment } from '../environments/environment';
...
  imports[
    ...
    WchNgModule.forRoot(environment)
  ],

with an environment properties file like this:

export const environment = {
  production: false,
  apiUrl: new URL(apiUrl),
  deliveryUrl: new URL(deliveryUrl)
};

LayoutDecorator

The layout decorator allow to assign a layout name to a component.

Usage

@LayoutComponent({
  selector: 'one-column'
})
@Component({
  selector: 'app-one-column',
  ...
})
export class OneColumnComponent extends AbstractRenderingComponent implements OnInit, OnDestroy {
 

or

@LayoutComponent()
@Component({
  selector: 'app-one-column',
  ...
})
export class OneColumnComponent extends AbstractRenderingComponent implements OnInit, OnDestroy {
 

Properties

  • selector: the name of the layout. This matches the controller field in the layout descriptor. If this property is missing, then the selector of the component will be used as a fallback. The type of this field can be string or string[]. In the array form, all selectors in the array will be associated with the component.
  • mappingId?: the optional mapping ID defines a fallback layout mapping, if no layout could be determined via WCH configuration. The ID carries either a content ID, a type ID or a type name.
  • layoutMode?: the optional layout mode defines the mode that the fallback mapping applies to.

Note

You can leave out the selector property on the LayoutComponent decorator. In this case the selector of the Component will be used as the name of the layout.

LayoutMappingDecorator

The layout mapping decorator allows to register fallback layout mappings as decorations of a class.

Parameters

  • id: defines a fallback layout mapping, if no layout could be determined via WCH configuration. The ID carries either a content ID, a type ID or a type name.
  • selector: the selector of the layout, either a string or a type. If the selector is missing, we use the attached class
  • layoutMode?: the optional layout mode defines the mode that the fallback mapping applies to.

Usage

The following example maps an ID of a content item to the HeroGridComponent layout in the default layout mode:

  @LayoutMapping('e2ab99d1-9f9c-49a3-a80e-ec45c7748820', HeroGridComponent)
  class ...

RenderingContextBinding

The context binding allows to attach a property of the rendering context to an instance variable of the component. This will often improve the readability of the template.

Usage

@LayoutComponent(...)
@Component(...)
export class OneColumnComponent extends AbstractRenderingComponent {
 
  @RenderingContextBinding('elements.text.value', 'defaultValue')
  textValue: string;
}

Properties

  • selector: the selector is a simple dot notation expresssion for the desired property, relative to the rendering context. Note that this does NOT support array expressions (yet). Optionally you may also pass a function that takes a rendering context as input and returns the desired value.
  • default: an optional default value that will be used if the rendering context does not contain the element

Note

The binding assumes the existence of a onRenderingContext observable on the class. This is automatically the case if the class inherits from AbstractRenderingComponent.

AbstractRenderingComponent

Component that can be used as a super class for custom components such as layouts. The component exposes a setter for the RenderingContext in a format that is expected by the ContentrefComponent.

Attributes

  • renderingContext: the current rendering context
  • layoutMode: the current layout mode

Methods

  • trackByComponentId: method to be used with the *ngFor directive when iterating over RenderingContext references. The method returns the ID of the rendering context, allowing Angular to correlate updates of the list.

Events

  • onRenderingContext: fires when the rendering context changes
  • onLayoutMode: fires when the layout mode changes

Both the onRenderingContext and the onLayoutMode observables will complete when the component is destroyed (i.e. in the course of processing the ngOnDestroy method). This implies that subscribers attached to theses observables do NOT need to unsubscribe explicitly, if they wish their subscription to last for the duration of the lifetime of the component (see section Subscribing and Unsubscribing in the observable contract).

AbstractLifeCycleComponent

Component that offers observables that will be fired when one of the lifecycle methods is invoked. This can be used as an alternative to override the respective method on the class. The mechanism is useful because:

  • the observables can already be accessed in the constructor of the components and can reference variables in the private closure of the constructor
  • it is a common pattern to setup observable chains in the constructor and to subscribe to them to keep application state up-to-date. These subscriptions however must be unsubscribed on in the ngOnDestroy method to avoid memory leaks. Using a life cycle callback this can be easily done inside the constructor.

Methods

  • ngXXX: the original life cycle method exposed by Angular. Subclasses that want to override these methods MUST call the super method.
  • onXXX: getter for an observable for this lifecycle method.
  • unsubscribeOnDestroy(subscription): registers a subscription to be unsubscribed for in ngOnDestroy
  • safeSubscribe(observable, handler): subscribes to an observable and registers the resulting subscription with ngOnDestroy. This is the most convenient way to handle subscriptions.

PageComponent

The page component resolves the current route to the component (or page) that is associated to this route in WCH. It can therefore be considered a proxy component that decouples the application at build time from the runtime artifacts.

Usage

The component does not require any specific configuration, it attaches itself to the routing logic via dependency injection.

Usage in HTML:

<wch-page></wch-page>

Usage in the router config:

const appRoutes: Routes = [
  {
    path: '**',
    component: PageComponent
  }
];

Attributes

  • layoutMode: optionally pass the layout mode to be used when rendering the page. If not specified, the system uses the default mode.

Events

  • onRenderingContext: the rendering context for the page as soon as it has been loaded
  • onLayoutMode: the layout mode used to render this page.

Error handling

If the page cannot be decoded, the system will look for a component mapped to the PAGE_NOT_FOUND_LAYOUT layout and instantiates this with an empty rendering context.

WCH Dependency

The page component uses the URL Slug managed in WCH with each page to decode the targeted page. The URL slugs form a hierarchical namespace that matches the URL namespace of the SPA. The component uses the url property of the ActivatedRoute. This property represents the sequence of path segments that will be matched against the defined URL slugs. The component will NOT interpret the parent router, so the SPA can decide to mount the WCH namespace at any location within its own namespace.

Components

This section lists the components exposed by the SDK:

Services

The SDK exposes the following services:

  • BoostrapService: used to register pre-built data records for a speedy first page experience
  • ComponentsService: used to register angular components as layouts
  • LayoutMappingService: used to register fallback layout mappings
  • HubInfoService: provides configuration data to the SDK, typically injected by the application
  • WchInfoService: exposes resolved configuration data as used by the SDK. Based on HubInfoService but after applying all necessary fallbacks.
  • ActivePageService: provides access to the currently rendered page
  • SDK Service: exposes selected functions of the SDK via the global window object, so these function can be used from non-Angular components or via cross-frame messaging.
  • SearchService: exposes a convenience API to search for pages and content.
  • RefreshService: service to refresh REST based data

Stories

Stories describing how to do interesting stuff with the ibm-wch-sdk-ng.

HubInfoService

The hub info service provides information about the entry URLs to WCH. It exposes the following information:

  • apiUrl: URL to access the API layer, e.g. 'https://my.digitalexperience.ibm.com/api/345563cf-a83c-40e5-a065-1d6ff36b05c1'
  • deliveryUrl: URL to access the delivery layer, e.g. 'https://my.digitalexperience.ibm.com/345563cf-a83c-40e5-a065-1d6ff36b05c1'
  • cycleHandlingStrategy?: Specifies how the SDK deals with cyclic data structures, one of BREAK or RESOLVE.
  • fetchLevels?: Number of levels to fetch per request to the rendering context. If missing all levels will be fetched.
  • httpOptions?: Configuration of the HTTP strategy for the live site. Of type HttpResourceOptions.
  • httpPreviewOptions?: Configuration of the HTTP strategy for the preview site. Of type HttpResourceOptions.

Note that the URLs may end with a slash, however this is not required.

HttpResourceOptions

  • pollTime?: The system will periodically poll for updates. This setting configures the polling interval in [ms]. Consider to configure a different value for the live site and the preview site.
  • pollTimeVariation?: In order to avoid fetching many request at the same time, this settings allows to introduce a time window from which the polling interval will be selected randomly. Sensible values are between 0 and 1, relative to the pollTime. Default is 0.15.
  • useLocalStorage?: If enabled the system will try to load data from local storage before making an HTTP call. Defaults to true.
  • useBootstrap?: If enabled the system will try to load inline data before making an HTTP call. Defaults to true. Use the [Bootstrapservice][./../bootstrap] to add this data.
  • useStaticResources?: If enabled the system will try to load prerendered data from the delivery site before making an API call. This can lead to 404 responses that are logged in some browsers, however this is not an error. Defaults to true.
  • useJsonP?: If enabled the system uses JSONP to load data. From a caching perspective this is more efficient than an XHR, because XHR requests are subject to CORS and as a consequence generate an origin specific cache entry. Defaults to true.

Usage

    WchNgModule.forRoot({ apiUrl: new URL(apiUrl), deliveryUrl: new URL(deliveryUrl) })

alternative

    import { environment } from '../environments/environment';
 
    WchNgModule.forRoot(environment)

Assuming that the required settings are part of the environment settings and the build uses the Angular CLI environment concepts.

We recommend to define the apiUrl and the deliveryUrl only for development mode, assuming that the application in production mode will be served from WCH. In that case, the system will detect the apiUrl and the deliveryUrl automatically. In case the production mode application will be served from a different server than WCH, make sure to add an explicit configuration of the URLs.

Note

  • The naming of the fields was chosen such that it is consistent to the naming of the corresponding fields in the rendering context.
  • The type of the fields is compatible to a URL object.

Common Interfaces

RenderingContext

Refer to the design document or the documentation for more details about the structure.

The basic structure of elements is described in the Authoring content section.

Logger

The logger interface is an abstraction of the logging functionality. Applications can inject custom loggers via the WchLoggerFactory.

ContentrefComponent

The contentref component acts as a proxy component and renders that component that is referenced by the RenderingContext.

Usage

The component requires the rendering context to be injected.

Usage in HTML:

<wch-contentref [renderingContext]="..."></wch-contentref>

Attributes

  • renderingContext: the rendering context for the component
  • layoutMode: the layout mode used to render the component. If not specified the system uses a default.

Events

  • onComponent: the actual angular component instance that gets created
  • onComponentOutput: a proxied output event sent by the dynamically created component. This event will be wrapped into a ComponentOutput interface.

Note

The contentref component is similar to the PageComponent. The difference is that it receives its configuration information explicitly via a RenderingContext whereas the PageComponent gets the context via the indirection of the active route.

WCH Dependency

The component relies on the layouts element in the RenderingContext. Depending on the type the contentref component will select the correct component to instantiate:

  • Angular4: uses the controller field together with the ComponentService to locate a native Angular 4 component.
  • handlebars:

ComponentOutput

Interface that wraps an event emitted by a dynamically created component.

Properties

  • renderingContext: rendering context of the component emitting the event
  • layoutMode: layout mode of the component emitting the event
  • component: the actual component instance that emitted the event
  • output: the output declaration representing the event
  • event: the emitted event

ComponentsService

This service allow to register components with layout IDs. Consider to use the inline form of the @LayoutComponent instead.

Constants

External module: "src/components/content/content.component"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/components/contentquery/contentquery.component"

External module: "src/components/contentquery/contentquery.component"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/components/contentref/contentref.component"

External module: "src/components/contentref/contentref.component"

Index

Classes

Interfaces


IBM Angular SDK for Watston Content Hub > "src/components/default/default.component"

External module: "src/components/default/default.component"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/components/page/page.component"

External module: "src/components/page/page.component"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/components/path/content.path.component"

External module: "src/components/path/content.path.component"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/components/rendering/abstract-base.component"

External module: "src/components/rendering/abstract-base.component"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/components/rendering/abstract-rendering.component"

External module: "src/components/rendering/abstract-rendering.component"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/components/rendering/abstract.lifecycle.component"

External module: "src/components/rendering/abstract.lifecycle.component"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/components/site/site.component"

External module: "src/components/site/site.component"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/decorators/bootstrap/rendering.context.bootstrap.decorator"

External module: "src/decorators/bootstrap/rendering.context.bootstrap.decorator"

Index

Functions


Functions

ContentWithLayoutBootstrap

ContentWithLayoutBootstrap(aDirective?: ContentWithLayoutBootstrapDirective): function

Defined in src/decorators/bootstrap/rendering.context.bootstrap.decorator.ts:11

Parameters:

Param Type Description
aDirective ContentWithLayoutBootstrapDirective -

Returns: function


IBM Angular SDK for Watston Content Hub > "src/decorators/bootstrap/rendering.context.bootstrap.directive"

External module: "src/decorators/bootstrap/rendering.context.bootstrap.directive"

Index

Interfaces


IBM Angular SDK for Watston Content Hub > "src/decorators/bootstrap/site.bootstrap.decorator"

External module: "src/decorators/bootstrap/site.bootstrap.decorator"

Index

Functions


Functions

SiteBootstrap

SiteBootstrap(aDirective?: SiteBootstrapDirective): function

Defined in src/decorators/bootstrap/site.bootstrap.decorator.ts:11

Parameters:

Param Type Description
aDirective SiteBootstrapDirective -

Returns: function


IBM Angular SDK for Watston Content Hub > "src/decorators/bootstrap/site.bootstrap.directive"

External module: "src/decorators/bootstrap/site.bootstrap.directive"

Index

Interfaces


IBM Angular SDK for Watston Content Hub > "src/decorators/layout/layout.decorator"

External module: "src/decorators/layout/layout.decorator"

Index

Functions


Functions

LayoutComponent

LayoutComponent(aDirective?: LayoutComponentDirective): function

Defined in src/decorators/layout/layout.decorator.ts:438

Parameters:

Param Type Description
aDirective LayoutComponentDirective -

Returns: function


LayoutMapping

LayoutMapping(aID: stringstring[], aSelector?: stringstring[]⎮Type.<any>, aLayoutMode?: stringstring[]): function

Defined in src/decorators/layout/layout.decorator.ts:474

Parameters:

Param Type Description
aID stringstring[] -
aSelector stringstring[]⎮Type.<any> -
aLayoutMode stringstring[] -

Returns: function


RenderingContextBinding

RenderingContextBindingT(aBinding?: stringRenderingContextDirectiveT, aDefault?: T): function

Defined in src/decorators/layout/layout.decorator.ts:460

Type parameters:

T

Parameters:

Param Type Description
aBinding stringRenderingContextDirectiveT -
aDefault T -

Returns: function


IBM Angular SDK for Watston Content Hub > "src/decorators/layout/layout.directive"

External module: "src/decorators/layout/layout.directive"

Index

Interfaces

Type aliases


Type aliases

RenderingContextDirective

Τ RenderingContextDirective: function

Defined in src/decorators/layout/layout.directive.ts:31

Type declaration

►(ctx: RenderingContext): T

Parameters:

Param Type Description
ctx RenderingContext -

Returns: T


IBM Angular SDK for Watston Content Hub > "src/directives/contentref.directive"

External module: "src/directives/contentref.directive"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/interfaces/content"

External module: "src/interfaces/content"

Index

Interfaces


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces"

External module: "src/interfaces/elements.ifaces"

Index

Interfaces

Type aliases


Type aliases

ELEMENT_TYPE

Τ ELEMENT_TYPE: "text"⎮"number"⎮"toggle"⎮"formattedtext"⎮"link"⎮"datetime"⎮"file"⎮"video"⎮"image"⎮"reference"⎮"category"⎮"location"⎮"optionselection"

Defined in src/interfaces/elements.ifaces.ts:4


Element

Τ Element: LocationElementSingleReferenceElementMultiReferenceElementSingleImageElementMultiImageElementSingleVideoElementMultiVideoElementSingleFileElementMultiFileElementSingleToggleElementMultiToggleElementSingleTextElementMultiToggleElementSingleNumberElementMultiNumberElementSingleLinkElementMultiLinkElementSingleFormattedTextElementMultiFormattedTextElementSingleOptionSelectionElementMultiOptionSelectionElement

Defined in src/interfaces/elements.ifaces.ts:350


IBM Angular SDK for Watston Content Hub > "src/interfaces/extended-context"

External module: "src/interfaces/extended-context"

Index

Interfaces


IBM Angular SDK for Watston Content Hub > "src/interfaces/hub-context"

External module: "src/interfaces/hub-context"

Index

Interfaces


IBM Angular SDK for Watston Content Hub > "src/interfaces/layout"

External module: "src/interfaces/layout"

Index

Interfaces

Variables

Object literals


Variables

DEFAULT_LAYOUT_MAPPING

● DEFAULT_LAYOUT_MAPPING: object

Defined in src/interfaces/layout.ts:40

Type declaration


DEFAULT_LAYOUT_MODE

● DEFAULT_LAYOUT_MODE: "default" = "default"

Defined in src/interfaces/layout.ts:2


LAYOUT_MODE_ERROR

● LAYOUT_MODE_ERROR: "wch-error" = "wch-error"

Defined in src/interfaces/layout.ts:8


LAYOUT_MODE_FOOTER

● LAYOUT_MODE_FOOTER: "wch-footer" = "wch-footer"

Defined in src/interfaces/layout.ts:7


LAYOUT_MODE_HEADER

● LAYOUT_MODE_HEADER: "wch-header" = "wch-header"

Defined in src/interfaces/layout.ts:6


LAYOUT_MODE_NAVIGATION

● LAYOUT_MODE_NAVIGATION: "wch-navigation" = "wch-navigation"

Defined in src/interfaces/layout.ts:5


LAYOUT_TEMPLATE_ERROR

● LAYOUT_TEMPLATE_ERROR: "wch-error" = "wch-error"

Defined in src/interfaces/layout.ts:13


LAYOUT_TEMPLATE_FOOTER

● LAYOUT_TEMPLATE_FOOTER: "wch-footer" = "wch-footer"

Defined in src/interfaces/layout.ts:12


LAYOUT_TEMPLATE_HEADER

● LAYOUT_TEMPLATE_HEADER: "wch-header" = "wch-header"

Defined in src/interfaces/layout.ts:11


LAYOUT_TEMPLATE_NAVIGATION

● LAYOUT_TEMPLATE_NAVIGATION: "wch-navigation" = "wch-navigation"

Defined in src/interfaces/layout.ts:10


LAYOUT_TYPE_ANGULAR

● LAYOUT_TYPE_ANGULAR: "angular" = "angular"

Defined in src/interfaces/layout.ts:3


Object literal: LAYOUT_ERROR

template

● template: string = LAYOUT_TEMPLATE_ERROR

Defined in src/interfaces/layout.ts:37


templateType

● templateType: string = LAYOUT_TYPE_ANGULAR

Defined in src/interfaces/layout.ts:36


Object literal: LAYOUT_FOOTER

template

● template: string = LAYOUT_TEMPLATE_FOOTER

Defined in src/interfaces/layout.ts:32


templateType

● templateType: string = LAYOUT_TYPE_ANGULAR

Defined in src/interfaces/layout.ts:31


Object literal: LAYOUT_HEADER

template

● template: string = LAYOUT_TEMPLATE_HEADER

Defined in src/interfaces/layout.ts:27


templateType

● templateType: string = LAYOUT_TYPE_ANGULAR

Defined in src/interfaces/layout.ts:26


Object literal: LAYOUT_NAVIGATION

template

● template: string = LAYOUT_TEMPLATE_NAVIGATION

Defined in src/interfaces/layout.ts:22


templateType

● templateType: string = LAYOUT_TYPE_ANGULAR

Defined in src/interfaces/layout.ts:21


IBM Angular SDK for Watston Content Hub > "src/interfaces/logger"

External module: "src/interfaces/logger"

Index

Interfaces


IBM Angular SDK for Watston Content Hub > "src/interfaces/rendering-context"

External module: "src/interfaces/rendering-context"

Index

Interfaces


IBM Angular SDK for Watston Content Hub > "src/internal/assert"

External module: "src/internal/assert"

Index

Variables

Functions


Variables

DEV_MODE_SUBJECT

● DEV_MODE_SUBJECT: BehaviorSubject.<boolean> = new _BehaviorSubject(DEV_MODE_ENABLED)

Defined in src/internal/assert.ts:15


Functions

assertDefined

assertDefined(aValue: any, aMessage?: string): void

Defined in src/internal/assert.ts:78

Parameters:

Param Type Description
aValue any -
aMessage string -

Returns: void


assertDependency

assertDependency(aValue: any, aName: string): void

Defined in src/internal/assert.ts:30

Parameters:

Param Type Description
aValue any -
aName string -

Returns: void


assertIsArray

assertIsArray(aValue: any, aMessage?: string): void

Defined in src/internal/assert.ts:60

Parameters:

Param Type Description
aValue any -
aMessage string -

Returns: void


assertIsFunction

assertIsFunction(aValue: any, aMessage?: string): void

Defined in src/internal/assert.ts:48

Parameters:

Param Type Description
aValue any -
aMessage string -

Returns: void


assertIsObservable

assertIsObservable(aValue: any, aMessage?: string): void

Defined in src/internal/assert.ts:36

Parameters:

Param Type Description
aValue any -
aMessage string -

Returns: void


assertIsPlainObject

assertIsPlainObject(aValue: any, aMessage?: string): void

Defined in src/internal/assert.ts:42

Parameters:

Param Type Description
aValue any -
aMessage string -

Returns: void


assertIsString

assertIsString(aValue: any, aMessage?: string): void

Defined in src/internal/assert.ts:54

Parameters:

Param Type Description
aValue any -
aMessage string -

Returns: void


assertNil

assertNil(aValue: any, aMessage?: string): void

Defined in src/internal/assert.ts:66

Parameters:

Param Type Description
aValue any -
aMessage string -

Returns: void


assertNotNil

assertNotNil(aValue: any, aMessage?: string): void

Defined in src/internal/assert.ts:72

Parameters:

Param Type Description
aValue any -
aMessage string -

Returns: void


assertNull

assertNull(aValue: any, aMessage?: string): void

Defined in src/internal/assert.ts:90

Parameters:

Param Type Description
aValue any -
aMessage string -

Returns: void


assertTrue

assertTrue(aValue: any, aMessage?: string): void

Defined in src/internal/assert.ts:96

Parameters:

Param Type Description
aValue any -
aMessage string -

Returns: void


assertUndefined

assertUndefined(aValue: any, aMessage?: string): void

Defined in src/internal/assert.ts:84

Parameters:

Param Type Description
aValue any -
aMessage string -

Returns: void


isAssertOn

isAssertOn(): boolean

Defined in src/internal/assert.ts:26

Returns: boolean


isDevModeOn

isDevModeOn(): boolean

Defined in src/internal/assert.ts:22

Returns: boolean


IBM Angular SDK for Watston Content Hub > "src/internal/search"

External module: "src/internal/search"

Index

Interfaces


IBM Angular SDK for Watston Content Hub > "src/internal/sites"

External module: "src/internal/sites"

Index

Interfaces


IBM Angular SDK for Watston Content Hub > "src/module"

External module: "src/module"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/services/bootstrap/bootstrap.service"

External module: "src/services/bootstrap/bootstrap.service"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/services/components/components.service"

External module: "src/services/components/components.service"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/services/config/application.config"

External module: "src/services/config/application.config"

Index

Interfaces


IBM Angular SDK for Watston Content Hub > "src/services/config/application.config.service"

External module: "src/services/config/application.config.service"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/services/config/empty.application.config"

External module: "src/services/config/empty.application.config"

Index

Object literals


Object literal: EMPTY_APPLICATION_CONFIG

classification

● classification: string = "content"

Defined in src/services/config/empty.application.config.ts:7


elements

● elements: object

Defined in src/services/config/empty.application.config.ts:10

Type declaration


id

● id: null = null

Defined in src/services/config/empty.application.config.ts:5


name

● name: null = null

Defined in src/services/config/empty.application.config.ts:6


type

● type: null = null

Defined in src/services/config/empty.application.config.ts:8


typeId

● typeId: null = null

Defined in src/services/config/empty.application.config.ts:9


IBM Angular SDK for Watston Content Hub > "src/services/dependency/dependency.service"

External module: "src/services/dependency/dependency.service"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/services/dependency/sdk/jsonp/jsonp"

External module: "src/services/dependency/sdk/jsonp/jsonp"

Index

Classes

Interfaces

Type aliases


Type aliases

JsonpCallback

Τ JsonpCallback: function

Defined in src/services/dependency/sdk/jsonp/jsonp.ts:19

Type declaration

►(data: Json): void

Parameters:

Param Type Description
data Json -

Returns: void


IBM Angular SDK for Watston Content Hub > "src/services/dependency/sdk/router/router"

External module: "src/services/dependency/sdk/router/router"

Index

Classes

Interfaces


IBM Angular SDK for Watston Content Hub > "src/services/dependency/sdk/sdk"

External module: "src/services/dependency/sdk/sdk"

Index

Classes

Interfaces

Variables


Variables

SDK_ACTIVE_ROUTE_EVENT_TYPE

● SDK_ACTIVE_ROUTE_EVENT_TYPE: "WchSdk.router.activeRoute" = "WchSdk.router.activeRoute"

Defined in src/services/dependency/sdk/sdk.ts:100


SDK_NAVIGATE_BY_PATH_EVENT_TYPE

● SDK_NAVIGATE_BY_PATH_EVENT_TYPE: "WchSdk.router.navigateByPath" = "WchSdk.router.navigateByPath"

Defined in src/services/dependency/sdk/sdk.ts:80


SDK_REFRESH_EVENT_TYPE

● SDK_REFRESH_EVENT_TYPE: "WchSdk.refresh" = "WchSdk.refresh"

Defined in src/services/dependency/sdk/sdk.ts:60


SDK_ROUTE_EVENT_TYPE

● SDK_ROUTE_EVENT_TYPE: "WchSdk.router.route" = "WchSdk.router.route"

Defined in src/services/dependency/sdk/sdk.ts:128


SDK_SUBSCRIBE_ACTIVE_ROUTE_EVENT_TYPE

● SDK_SUBSCRIBE_ACTIVE_ROUTE_EVENT_TYPE: "WchSdk.router.activeRoute.subscribe" = "WchSdk.router.activeRoute.subscribe"

Defined in src/services/dependency/sdk/sdk.ts:91


SDK_SUBSCRIBE_ROUTE_EVENT_TYPE

● SDK_SUBSCRIBE_ROUTE_EVENT_TYPE: "WchSdk.router.route.subscribe" = "WchSdk.router.route.subscribe"

Defined in src/services/dependency/sdk/sdk.ts:114


SDK_UNSUBSCRIBE_EVENT_TYPE

● SDK_UNSUBSCRIBE_EVENT_TYPE: "WchSdk.unsubscribe" = "WchSdk.unsubscribe"

Defined in src/services/dependency/sdk/sdk.ts:144


IBM Angular SDK for Watston Content Hub > "src/services/dependency/sdk/version"

External module: "src/services/dependency/sdk/version"

Index

Interfaces

Object literals


Object literal: SDK_VERSION

build

● build: Date = new Date(VERSION.build)

Defined in src/services/dependency/sdk/version.ts:15


version

● version: Version = new Version(VERSION.version)

Defined in src/services/dependency/sdk/version.ts:14


IBM Angular SDK for Watston Content Hub > "src/services/dependency/window.service"

External module: "src/services/dependency/window.service"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/services/hub-info/hub-info"

External module: "src/services/hub-info/hub-info"

Index

Interfaces


IBM Angular SDK for Watston Content Hub > "src/services/hub-info/hub-info.service"

External module: "src/services/hub-info/hub-info.service"

Index

Enumerations

Classes


IBM Angular SDK for Watston Content Hub > "src/services/info/wch.info.service"

External module: "src/services/info/wch.info.service"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/services/jsonp/wch.jsonp.service"

External module: "src/services/jsonp/wch.jsonp.service"

Index

Classes

Variables

Functions


Variables

WCH_JSONP_PROVIDERS

● WCH_JSONP_PROVIDERS: Provider[] = [ { provide: WchJsonp, useFactory: wchJsonpFactory, deps: [WchJsonpBackend, RequestOptions] }, { provide: WchJsonpBackend, useClass: WchJsonpBackend } ]

Defined in src/services/jsonp/wch.jsonp.service.ts:357


Functions

wchJsonpFactory

wchJsonpFactory(jsonpBackend: WchJsonpBackend, requestOptions: RequestOptions): WchJsonp

Defined in src/services/jsonp/wch.jsonp.service.ts:343

Parameters:

Param Type Description
jsonpBackend WchJsonpBackend -
requestOptions RequestOptions -

Returns: WchJsonp


IBM Angular SDK for Watston Content Hub > "src/services/logger/logger.service"

External module: "src/services/logger/logger.service"

Index

Classes

Variables


Variables

WchLoggerFactory

● WchLoggerFactory: InjectionToken.<LoggerFactory> = new InjectionToken('WchLoggerFactory')

Defined in src/services/logger/logger.service.ts:12


IBM Angular SDK for Watston Content Hub > "src/services/logger/wch.logger.service"

External module: "src/services/logger/wch.logger.service"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/services/mappings/mappings.service"

External module: "src/services/mappings/mappings.service"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/services/markup/markup.service"

External module: "src/services/markup/markup.service"

Index

Classes

Interfaces

Type aliases


Type aliases

MarkupGenerator

Τ MarkupGenerator: function

Defined in src/services/markup/markup.service.ts:5

Type declaration

►(context: RenderingContext, options?: any): string

Parameters:

Param Type Description
context RenderingContext -
options any -

Returns: string


IBM Angular SDK for Watston Content Hub > "src/services/page/active.page.service"

External module: "src/services/page/active.page.service"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/services/refresh/refresh.service"

External module: "src/services/refresh/refresh.service"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/services/storage/storage.service"

External module: "src/services/storage/storage.service"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/services/wch.service"

External module: "src/services/wch.service"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/utils/cache.utils"

External module: "src/utils/cache.utils"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/utils/clientstorage"

External module: "src/utils/clientstorage"

Index

Classes

Interfaces

Functions


Functions

clientStorageFromStorage

clientStorageFromStorage(aStorage: Storagenullundefined, aScope: string): ClientStorage

Defined in src/utils/clientstorage.ts:112

Parameters:

Param Type Description
aStorage Storagenullundefined -
aScope string -

Returns: ClientStorage


clientStorageFromWindow

clientStorageFromWindow(aWindow: Windownullundefined, aScope: string): ClientStorage

Defined in src/utils/clientstorage.ts:122

Parameters:

Param Type Description
aWindow Windownullundefined -
aScope string -

Returns: ClientStorage


IBM Angular SDK for Watston Content Hub > "src/utils/component.mapping.utils"

External module: "src/utils/component.mapping.utils"

Index

Interfaces


IBM Angular SDK for Watston Content Hub > "src/utils/component.utils"

External module: "src/utils/component.utils"

Index

Interfaces


IBM Angular SDK for Watston Content Hub > "src/utils/cors.utils"

External module: "src/utils/cors.utils"

Index

Variables


Variables

NULL_ORIGIN

● NULL_ORIGIN: "null" = "null"

Defined in src/utils/cors.utils.ts:9


IBM Angular SDK for Watston Content Hub > "src/utils/http.utils"

External module: "src/utils/http.utils"

Index

Interfaces

Object literals


Object literal: DEFAULT_HTTP_RESOURCE_OPTIONS

pollTime

● pollTime: number = DEFAULT_POLL_TIME

Defined in src/utils/http.utils.ts:105


pollTimeVariation

● pollTimeVariation: number = DEFAULT_POLL_TIME_VARIATION

Defined in src/utils/http.utils.ts:104


retries

● retries: number = DEFAULT_RETRIES

Defined in src/utils/http.utils.ts:106


useBootstrap

● useBootstrap: boolean = DEFAULT_USE_BOOTSTRAP

Defined in src/utils/http.utils.ts:108


useJsonP

● useJsonP: boolean = DEFAULT_USE_JSONP

Defined in src/utils/http.utils.ts:110


useLocalStorage

● useLocalStorage: boolean = DEFAULT_USE_LOCAL_STORAGE

Defined in src/utils/http.utils.ts:107


useStaticResources

● useStaticResources: boolean = DEFAULT_USE_STATIC_RESOURCES

Defined in src/utils/http.utils.ts:109


IBM Angular SDK for Watston Content Hub > "src/utils/js.utils"

External module: "src/utils/js.utils"

Index

Type aliases

Variables

Functions


Type aliases

Generator

Τ Generator: function

Defined in src/utils/js.utils.ts:257

Type declaration

►(): Tnullundefined

Returns: Tnullundefined


Json

Τ Json: any

Defined in src/utils/js.utils.ts:9


Variables

EMPTY_JSON_OBSERVABLE

● EMPTY_JSON_OBSERVABLE: Observable.<Json> = _Observable.empty()

Defined in src/utils/js.utils.ts:228


EMPTY_STRING_OBSERVABLE

● EMPTY_STRING_OBSERVABLE: Observable.<string> = _Observable.empty()

Defined in src/utils/js.utils.ts:223


Functions

anyToString

anyToString(aValue: any): string

Defined in src/utils/js.utils.ts:253

Parameters:

Param Type Description
aValue any -

Returns: string


assertArray

assertArray(aKey: numberstringsymbol, aObject: any): any[]

Defined in src/utils/js.utils.ts:248

Parameters:

Param Type Description
aKey numberstringsymbol -
aObject any -

Returns: any[]


assertObject

assertObject(aKey: numberstringsymbol, aObject: any): any

Defined in src/utils/js.utils.ts:243

Parameters:

Param Type Description
aKey numberstringsymbol -
aObject any -

Returns: any


generateItem

generateItemT(aGenerator: GeneratorT): Observable.<T>

Defined in src/utils/js.utils.ts:266

Type parameters:

T

Parameters:

Param Type Description
aGenerator GeneratorT -

Returns: Observable.<T>


objectAssign

objectAssignT,V(aKey: string, aValue: V, aObject: T): T

Defined in src/utils/js.utils.ts:238

Type parameters:

T

V

Parameters:

Param Type Description
aKey string -
aValue V -
aObject T -

Returns: T


IBM Angular SDK for Watston Content Hub > "src/utils/lazy.map"

External module: "src/utils/lazy.map"

Index

Interfaces

Type aliases


Type aliases

CacheCallback

Τ CacheCallback: function

Defined in src/utils/lazy.map.ts:2

Type declaration

►(key: string): V

Parameters:

Param Type Description
key string -

Returns: V


IBM Angular SDK for Watston Content Hub > "src/utils/markup.utils"

External module: "src/utils/markup.utils"

Index

Interfaces


IBM Angular SDK for Watston Content Hub > "src/utils/rx.utils"

External module: "src/utils/rx.utils"

Index

Interfaces


IBM Angular SDK for Watston Content Hub > "src/utils/site.utils"

External module: "src/utils/site.utils"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/utils/static.resources"

External module: "src/utils/static.resources"

Index

Classes


IBM Angular SDK for Watston Content Hub > "src/utils/url.utils.ifaces"

External module: "src/utils/url.utils.ifaces"

Index

Interfaces

Type aliases


Type aliases

QueryInput

Τ QueryInput: stringstring[]⎮nullundefinedURLSearchParamsQuery

Defined in src/utils/url.utils.ifaces.ts:6


IBM Angular SDK for Watston Content Hub > "src/utils/urls"

External module: "src/utils/urls"

Index

Variables


Variables

BFF_BASE_URL

● BFF_BASE_URL: Observable.<string> = USE_PUBLIC_URL.map(bFlag => bFlag ? BFF_PUBLIC_URL : BFF_SECURE_URL) .distinctUntilChanged() .shareReplay(1)

Defined in src/utils/urls.ts:16

observable that exposes the current base URL for the BFF. The URL does NOT start with a slash but ends with a slash


USE_PUBLIC_URL

● USE_PUBLIC_URL: BehaviorSubject.<boolean> = new BehaviorSubject(DEFAULT_PUBLIC_URL)

Defined in src/utils/urls.ts:12


IBM Angular SDK for Watston Content Hub > "src/utils/wch.utils"

External module: "src/utils/wch.utils"

Index

Interfaces

Type aliases

Variables

Object literals


Type aliases

RenderingContextCallback

Τ RenderingContextCallback: function

Defined in src/utils/wch.utils.ts:58

Type declaration

►(rc: RenderingContext, parent?: RenderingContext, path?: string): void

Parameters:

Param Type Description
rc RenderingContext -
parent RenderingContext -
path string -

Returns: void


Variables

DEFAULT_FETCH_LEVELS

● DEFAULT_FETCH_LEVELS: -1 = _DEFAULT_FETCH_LEVELS

Defined in src/utils/wch.utils.ts:691


KEY_CYCLE

● KEY_CYCLE: "$$CYCLE" = "$$CYCLE"

Defined in src/utils/wch.utils.ts:44


KEY_DEBUG

● KEY_DEBUG: "$$DEBUG" = "$$DEBUG"

Defined in src/utils/wch.utils.ts:43


KEY_REFERENCE

● KEY_REFERENCE: "$$REF" = "$$REF"

Defined in src/utils/wch.utils.ts:45


KEY_RENDERING_CONTEXT_MAP

● KEY_RENDERING_CONTEXT_MAP: symbol = Symbol('RenderingContextMap')

Defined in src/utils/wch.utils.ts:52


Object literal: EMPTY_RENDERING_CONTEXT

context

● context: SiteContext = EMPTY_SITE_CONTEXT

Defined in src/utils/wch.utils.ts:65


elements

● elements: object

Defined in src/utils/wch.utils.ts:62

Type declaration


id

● id: null = null

Defined in src/utils/wch.utils.ts:61


layouts

● layouts: object = DEFAULT_LAYOUT_MAPPING

Defined in src/utils/wch.utils.ts:63

Type declaration


markups

● markups: object

Defined in src/utils/wch.utils.ts:64

Type declaration


Object literal: UNDEFINED_RENDERING_CONTEXT

context

● context: SiteContext = EMPTY_SITE_CONTEXT

Defined in src/utils/wch.utils.ts:73


elements

● elements: object

Defined in src/utils/wch.utils.ts:70

Type declaration


id

● id: undefined = undefined

Defined in src/utils/wch.utils.ts:69


layouts

● layouts: object = DEFAULT_LAYOUT_MAPPING

Defined in src/utils/wch.utils.ts:71

Type declaration


markups

● markups: object

Defined in src/utils/wch.utils.ts:72

Type declaration


IBM Angular SDK for Watston Content Hub > "src/version"

External module: "src/version"

Index

Object literals


Object literal: VERSION

build

● build: string = (new Date()).toUTCString()

Defined in src/version.ts:3


version

● version: string = "development"

Defined in src/version.ts:2


SiteComponent

The page component provides the rendering context for the default configuration content item for the site. You can use this e.g. to render a site navigation.

Usage

The component does not require any specific configuration, it attaches itself to the site configuration

Usage in HTML:

<wch-site></wch-site>

Attributes

  • layoutMode: optionally pass the layout mode to be used when rendering the page. If not specified, the system uses the default mode.

Events

  • onRenderingContext: the rendering context for the page as soon as it has been loaded
  • onLayoutMode: the layout mode used to render this page.

Error handling

If the site cannot be decoded, the system will look for a component mapped to the PAGE_NOT_FOUND_LAYOUT layout and instantiates this with an empty rendering context.

WCH Dependency

The site component uses the default site confiuration content item to construct its rendering context.

ContentComponent

The content component acts as a proxy component and renders that component that is referenced by the id element that identifies the component by its ID.

Usage

Usage in HTML:

<wch-content [id]="..." (onRenderingContext)="..."></wch-content>

Attributes

  • id: the UUID of the selected component
  • layoutMode: the layout mode used to render the component. If not specified the system uses a default.

Events

  • onRenderingContext: fired when the rendering context has changed
  • onComponent: the actual angular component instance that gets created
  • onComponentOutput: a proxied output event sent by the dynamically created component. This event will be wrapped into a ComponentOutput interface.

Notice

This component is closely related to wch-contentref.

ContentQueryComponent

The content query component is meant to render components that are referenced as the result of a WCH search query.

Usage

Usage in HTML:

<!-- assign the instance a local name, so we can reference its properties inside the content projection -->
<wch-contentquery [query]='...' #q>
    <!-- use the local name to access the list -->
    <wch-contentref *ngFor="let rc of q.onRenderingContexts | async" [renderingContext]="rc"></wch-contentref>
</wch-contentquery>

Attributes

  • query: the search query. This is the query string part as passed to the search REST service, e.g. fq=type:("habitat%5C-voyeur%5C-profile%5C-page")&rows=50&start=0. The component requires that the search returns only documents classified as components and and that it includes the document as a JSON object. The relevant query parameters will be added automatically to the provided query and will potentially override existing parameters. Also if the q parameters is missing, it will be filled in with *:* automatically. Recommendation: do not include a fl parameter nor a fq parameters that filters on classification. The attribute can be a string (in which case it has to be a correctly escaped query string), a plain JSON object with string keys and string or string[] as values or an implementation of URLSearchParams.

Events

  • onRenderingContexts: an observable of the RenderingContext array for the search results

Note

The component relies on content projection to render the result of the query. Assign a local identifier to the wch-contentquery component and access the async query result inside the content (e.g. via a ngFor loop).

The query attribute must be a correctly escaped query string if the string version is used. Each parameter in that query has to be escaped according to Solr Query Syntax rules. Since this can be relatively tedious, developers might want to use a library such as lucene-query-string-builder to build the lucene query strings. The following example illustrates this. Note that the sample constructs a query POJO object to have the SDK to the proper URL escaping. The values of the POJO only have to be escaped in Solr Query Syntax.

import { Query } from 'ibm-wch-sdk-ng';
import * as lucene from 'lucene-query-string-builder';
 
export class TypeCarouselComponent extends AbstractCarouselComponent {
 
    // contains the correctly escaped query object based on a tags field
    onQuery: Observable<Query>;
 
    constructor() {
 
        // builds the lucene query for tags
        const queryBuilder: (string) => string = lucene.builder((tagString: string) => {
            // shortcut
            const _ = lucene;
            // split and map
            return _.group(_.and(
                _.field('type', _.term('Story')),
                _.field('tags', _.group(_.or(...tagString.split(',').map(s => s.trim()).map(_.term))))
            ));
        });
 
        // construct the query string object
        this.onQuery = this.onQueryTags.filter(Boolean)
            .map(queryBuilder)
            .map(q => ({
                'q': q,
                'sort': 'lastModified desc'
            }));
    }
}

In the HTML template then use:

<wch-contentquery [query]="onQuery | async" #q>
    ...
</wch-contentquery>

ContentPathComponent

The content component acts as a proxy component and renders that component that is referenced by its route (the URL path).

Usage

Usage in HTML:

<wch-contentpath [path]="..." (onRenderingContext)="..."></wch-contentpath>

Attributes

  • path: the (escaped) path to the component
  • layoutMode: the layout mode used to render the component. If not specified the system uses a default.

Events

  • onRenderingContext: fired when the rendering context has changed
  • onComponent: the actual angular component instance that gets created
  • onComponentOutput: a proxied output event sent by the dynamically created component. This event will be wrapped into a ComponentOutput interface.

Notice

This component is closely related to wch-contentref.

Default Component

Default component that is displayed if the layout could not be resolved. The component shows per design empty content.

BootstrapService

This service allows to register data records that are compiled into the application. These records are used to bootstrap the application loading. Whenever a rendering context or the site is requested from WCH, data registered with this service will be used as a placeholder, first (if available). As soon as the real data becomes available, the new data replace the placeholder.

Consider also the the inline form of the @RenderingContextBootstrap or @SiteBootstrap instead.

Methods

  • put(key, value): adds a data record, the key is the path used to fetch the data, the value the data record as string or JSON

LayoutMappingService

This service allow to register layout mappings. Consider to use the inline form of the @LayoutComponent instead.

Methods

  • registerMapping(id, sel, mode?): registers a new layout mapping. The id is a content node ID, content type ID or content type name. The sel selector is either the name of the layout or the type object. In case the type object is given, the mapping will be registered with the selector attached to the type. The mode identifies the layout mode to register the mapping for. If missing the default mode will be assumed.

Note

When the ContentRefComponent tries to locale an Angular component for a RenderingContext it will use the layouts field in the context. If this field is missing or if the specified layout cannot be located, it consults the LayoutMappingService to find a default mapping for the context. This allows the application developer to define application level fallbacks for these mappings, that can however be overridden by the business user.

WchInfoService

The service provides access to global, unmodifiable configuration data when accessing the WCH backend.

The URL information is obtained as follows:

  • The services uses the HubInfoService provided by the application. If this service defines and apiUrl or a deliveryUrl, this configuration is used as a baseline.
  • Without configuration in the HubInfoService, the service detects the baseUrl of the currently rendered document. This is either determined from the DOCUMENT token or from the window, if the document is not available.

URLs from Configuration

If both the apiUrl and the deliveryUrl variables are defined on the HubInfoService, the configured values are used. If only one is configured, the other is derived from the configured setting.

URLs from BaseURL

If the apiUrl and the deliveryUrl are decoded from the baseUrl, then the baseUrl is parsed to decide if it represents a URL with a tenant identifier or a custom hostname. The URLs are then built depending on the result.

Members

  • apiUrl: the URL object representing the API entry point. The URL ends with a trailing slash.
  • deliveryUrl: the URL object representing the delivery entry point. The URL ends with a trailing slash.
  • isPreviewMode: true if the application runs in preview mode, else false.

Note

  • This service is related to the HubInfoService but differs by the fact that the WchInfoService represents the confiuration data after all fallbacks have been applied, this is the data actually used by other SDK services. The HubInfoService however represents input data from the application, this data can be incomplete and would be filled in with defaults.
  • There is not special check for localhost. In local development mode make sure to define the apiUrl and/or the deliveryUrl to point to your WCH instance.

ActivePageService

The service provides access to the RenderingContext of the currently selected page.

Methods

  • onRenderingContext: an observable of the context of the selected page. If no page is selected, the context will be null, so make sure to protect access to members.

SDK

The SDK implements the plain JS WCH SDK APIs based on the Angular framwork.

Properties

  • router
  • jsonp
  • [version] the current version of the SDK, including a version number and the build date

Methods

  • refresh(): causes the currently displayed data to be refreshed

The SDK is available on the global window object

window.WchSdk

Cross Origin Eventing

The SDK supports WebMessaging to allow communication across frames via the postMessage functionality. Each message sent to the SDK needs to contain a type and an id field. The type is used to identify the meaning of the message, the id to allow the caller to correlate potential responses.

Responses to messages sent to the iframe (e.g. messages back from the SDK to the parent frame) can optionally use channelMessaging. If the first element of the transfer object contains a messagePort, this will be used for reply messages or notifications. Else these replies will be sent against the parent window, directly.

Supported Message Types

  • WchSdk.refresh: refreshes the data currently displayed by the application. The message has no response.
  • WchSdk.router.navigateByPath: navigates to the specified path. Responds with a WchSdk.router.navigateByPathResponse response. Takes:
    • path: path to navigate to
  • WchSdk.router.activeRoute.subscribe: subscribes a listener for changes in the active route (i.e. navigations). The event will be responsed by a response containing a handle that can be used to unsubscribe. Whenever a navigation occurs, the SDK will send a WchSdk.router.activeRoute message to the caller.
  • WchSdk.router.route.subscribe: subscribes a listener for changes for a given route. The event will be responsed by a response containing a handle that can be used to unsubscribe. Whenever the route changes, comes into existence or is deleted, the SDK will send a WchSdk.router.route message to the caller. Takes:
    • route: a string or string array that describes the route to listen to. If the value is a string, then it must be the escaped path, starting with a slash but not ending with a slash. If it is a string array, each value represents the unescaped path segment, the segments to not contain slashes.
  • WchSdk.unsubscribe: unsubscribes from a subscription given the subscription handle
    • handle: the subscription handle

Supported Response Types

  • WchSdk.router.navigateByPathResponse: sent as a response to a WchSdk.router.navigateByPath message from the SDK to the caller. Replicates the caller message fields and in addition:
    • success: true if the navigation completed, else false
    • error: an optional error object
  • WchSdk.router.activeRoute.subscribeResponse: sent as a response to WchSdk.router.activeRoute.subscribe.
    • handle: handle to the subscription, can be used to unsubscribe
  • WchSdk.router.route.subscribeResponse: sent as a response to WchSdk.router.route.subscribe.
    • handle: handle to the subscription, can be used to unsubscribe
  • WchSdk.router.activeRoute: sent from the SDK to the subscriber for modifications in the navigation.
    • page: The selected page. Will be null if this is the last event (e.g. because of an application shutdown)

Examples

Listen for Navigation Events

This example shows how a parent frame can listen for navigation events of an SPA. The example uses channelMessaging to establish a direct communication channel from the SDK to the parent frame. Navigation events will be sent via this channel.

Note that the use of a channel is not required. If no channel is passed in, the navigation events will be sent directly to the parent window via postMessage.

The example doe NOT show how to unsubscribe.

/**
 * Message sent to the SDK to subscribe for navigation notifications
*/
var msg = {
    type: 'WchSdk.router.activeRoute.subscribe',
    id: 'someid'
};
 
// use a message channel to receive the responses
var channel = new MessageChannel();
 
/** Perform  the subscription, transfer one end of the channel to the SDK.
 * Note that the second parameter is the origin of the iframe.
*/
myframe.contentWindow.postMessage(msg, "http://localhost:4200", [channel.port2]);
 
/**
 * Listen for changes in the navigation
 * We expect two types of callbacks here, one for each navigation event
 * and a response sending the subscription handle, so we can unsubscribe later.
 */
channel.port1.addEventListener('message', msg => {
  // check for the message type
  const data = msg.data;
  if (data.type === 'WchSdk.router.activeRoute') {
    // log the active route
    console.log('navigation in iframe', data.page.route);
  } else
  if (data.type === 'WchSdk.router.activeRoute.subscribeResponse') {
    console.log('subscription handle', data.handle);
  }
 
});
// start the bi-directional communication
channel.port1.start();

SearchService

The search service allows to perform searches against the WCH index for rendering contexts or pages. The search results are kepts in active, automatically, based on the configured refresh interval.

Methods

  • getRenderingContexts(query, levels?): an observable of rendering contexts. The query must be a query against content items and will be resolved by the rendering contexts for these content items. The query will automatically be limited to content items and will ignore any field list options.
  • getSitePages(query): an observable of site pages. The query must be a query against pages and will be resolved by an array of page instances. The query will automatically be limited to pages and will ignore any field list options.

RefreshService

The refresh service allows to trigger a refresh of all data records that are managed by the SDK and that are based on REST request against the SDK, e.g. the rendering context, site structure or search results. Call this service to force an update after server side information has changed.

Methods

  • refresh(): Triggers the refresh call.

Reactive Stream

Angular leverages the power of Reactive Streams across its APIs and applying this pattern for custom applications will make them faster and easier to maintain. In this chapter we discuss how to combine Reactive Streams with the ibm-wch-sdk-ng.

WchLoggerFactory

The logger factory represents a dependency that can be injected by the application into the SDK. It has to be of type LoggerFactory and will be used by the SDK to instantiate logger objects. If this dependency is not injected, then the SDK uses console based logging.

Example

@NgModule({
  ...
  providers[{provide: WchLoggerFactory, useClass: Ng2LoggerFactory}],
  ...
})
 
...
 
import { Log } from 'ng2-logger';
import { Logger, LoggerFactory } from './../../lib/index';
 
export class Ng2LoggerFactory implements LoggerFactory {
    create = Log.create
}

Index

External modules


IBM Angular SDK for Watston Content Hub > "src/components/default/default.component" > DefaultComponent

Class: DefaultComponent

Implements

  • OnInit

Index

Constructors

Methods


Constructors

new DefaultComponent(): DefaultComponent

Defined in src/components/default/default.component.ts:9

Returns: DefaultComponent


Methods

ngOnInit

ngOnInit(): void

Defined in src/components/default/default.component.ts:13

Returns: void


IBM Angular SDK for Watston Content Hub > "src/components/page/page.component" > PageComponent

Class: PageComponent

Hierarchy

AbstractBaseComponent

↳ PageComponent

Implements

  • OnInit
  • OnDestroy

Index

Constructors

Properties

Accessors

Methods


Constructors

new PageComponent(aRoute: ActivatedRoute, aWchService: WchService, aTitleService: Title, aMetaService: Meta): PageComponent

Overrides AbstractBaseComponent.constructor

Defined in src/components/page/page.component.ts:149

Parameters:

Param Type Description
aRoute ActivatedRoute -
aWchService WchService -
aTitleService Title -
aMetaService Meta -

Returns: PageComponent


Properties

onComponent

● onComponent: EventEmitter.<any> = new EventEmitter()

Defined in src/components/page/page.component.ts:149


onComponentOutput

● onComponentOutput: EventEmitter.<ComponentOutput> = new EventEmitter()

Defined in src/components/page/page.component.ts:143


onLayoutMode

● onLayoutMode: Observable.<string>

Overrides AbstractBaseComponent.onLayoutMode

Defined in src/components/page/page.component.ts:130


onRenderingContext

● onRenderingContext: Observable.<RenderingContext>

Overrides AbstractBaseComponent.onRenderingContext

Defined in src/components/page/page.component.ts:137


Accessors

layoutMode

setlayoutMode(aValue: string): void

Inherited from AbstractBaseComponent.layoutMode

Defined in src/components/rendering/abstract-base.component.ts:39

Parameters:

Param Type Description
aValue string -

Returns: void


Methods

ngOnDestroy

ngOnDestroy(): void

Inherited from AbstractBaseComponent.ngOnDestroy

Defined in src/components/rendering/abstract-base.component.ts:62

Returns: void


ngOnInit

ngOnInit(): void

Inherited from AbstractBaseComponent.ngOnInit

Defined in src/components/rendering/abstract-base.component.ts:54

Returns: void


IBM Angular SDK for Watston Content Hub > "src/components/content/content.component" > ContentComponent

Class: ContentComponent

Implements

  • OnDestroy

Index

Constructors

Properties

Accessors

Methods


Constructors

new ContentComponent(aWchService: WchService): ContentComponent

Defined in src/components/content/content.component.ts:86

Parameters:

Param Type Description
aWchService WchService -

Returns: ContentComponent


Properties

onComponent

● onComponent: EventEmitter.<any> = new EventEmitter()

Defined in src/components/content/content.component.ts:65


onComponentOutput

● onComponentOutput: EventEmitter.<ComponentOutput> = new EventEmitter()

Defined in src/components/content/content.component.ts:59


onLayoutMode

● onLayoutMode: Observable.<string>

Defined in src/components/content/content.component.ts:86


onRenderingContext

● onRenderingContext: Observable.<RenderingContext>

Defined in src/components/content/content.component.ts:53


Accessors

id

setid(aValue: string): void

Defined in src/components/content/content.component.ts:35

Parameters:

Param Type Description
aValue string -

Returns: void


layoutMode

setlayoutMode(aValue: string): void

Defined in src/components/content/content.component.ts:114

Parameters:

Param Type Description
aValue string -

Returns: void


levels

setlevels(aValue: stringnumbernullundefined): void

Defined in src/components/content/content.component.ts:44

Parameters:

Param Type Description
aValue stringnumbernullundefined -

Returns: void


Methods

ngOnDestroy

ngOnDestroy(): void

Defined in src/components/content/content.component.ts:122

Returns: void


IBM Angular SDK for Watston Content Hub > "src/components/contentref/contentref.component" > ContentrefComponent

Class: ContentrefComponent

Hierarchy

AbstractRenderingComponent

↳ ContentrefComponent

Implements

  • OnInit
  • OnDestroy
  • OnChanges
  • DoCheck
  • AfterContentInit
  • AfterContentChecked
  • AfterViewInit
  • AfterViewChecked
  • OnDestroy

Index

Constructors

Properties

Accessors

Methods


Constructors

new ContentrefComponent(fctResolver: ComponentFactoryResolver, cmp: ComponentsService, _mapping: LayoutMappingService, aWchService: WchService): ContentrefComponent

Overrides AbstractRenderingComponent.constructor

Defined in src/components/contentref/contentref.component.ts:218

Parameters:

Param Type Description
fctResolver ComponentFactoryResolver -
cmp ComponentsService -
_mapping LayoutMappingService -
aWchService WchService -

Returns: ContentrefComponent


Properties

«Protected» _id

● _id: string

Inherited from AbstractRenderingComponent._id

Defined in src/components/rendering/abstract-rendering.component.ts:44


contentrefHost

● contentrefHost: ContentrefDirective

Defined in src/components/contentref/contentref.component.ts:218


«Optional» cycleHandlingStrategy

● cycleHandlingStrategy: CYCLE_HANDLING.BREAKCYCLE_HANDLING.RESOLVEstring

Defined in src/components/contentref/contentref.component.ts:189


layoutMode

● layoutMode: string

Overrides AbstractRenderingComponent.layoutMode

Defined in src/components/contentref/contentref.component.ts:201


onComponent

● onComponent: EventEmitter.<any> = new EventEmitter()

Defined in src/components/contentref/contentref.component.ts:216


onComponentOutput

● onComponentOutput: EventEmitter.<ComponentOutput> = new EventEmitter()

Defined in src/components/contentref/contentref.component.ts:207


onLayoutMode

● onLayoutMode: Observable.<string>

Inherited from AbstractRenderingComponent.onLayoutMode

Defined in src/components/rendering/abstract-rendering.component.ts:82


onRenderingContext

● onRenderingContext: Observable.<RenderingContext>

Inherited from AbstractRenderingComponent.onRenderingContext

Defined in src/components/rendering/abstract-rendering.component.ts:69


renderingContext

● renderingContext: RenderingContext

Overrides AbstractRenderingComponent.renderingContext

Defined in src/components/contentref/contentref.component.ts:195


Accessors

«Protected» context

getcontext(): Observable.<RenderingContext>

Inherited from AbstractRenderingComponent.context

Defined in src/components/rendering/abstract-rendering.component.ts:152

Returns: Observable.<RenderingContext>


«Protected» onAfterContentChecked

getonAfterContentChecked(): Observable.<void>

Inherited from AbstractLifeCycleComponent.onAfterContentChecked

Defined in src/components/rendering/abstract.lifecycle.component.ts:263

Returns: Observable.<void>


«Protected» onAfterContentInit

getonAfterContentInit(): Observable.<void>

Inherited from AbstractLifeCycleComponent.onAfterContentInit

Defined in src/components/rendering/abstract.lifecycle.component.ts:271

Returns: Observable.<void>


«Protected» onAfterViewChecked

getonAfterViewChecked(): Observable.<void>

Inherited from AbstractLifeCycleComponent.onAfterViewChecked

Defined in src/components/rendering/abstract.lifecycle.component.ts:247

Returns: Observable.<void>


«Protected» onAfterViewInit

getonAfterViewInit(): Observable.<void>

Inherited from AbstractLifeCycleComponent.onAfterViewInit

Defined in src/components/rendering/abstract.lifecycle.component.ts:255

Returns: Observable.<void>


«Protected» onDoCheck

getonDoCheck(): Observable.<void>

Inherited from AbstractLifeCycleComponent.onDoCheck

Defined in src/components/rendering/abstract.lifecycle.component.ts:279

Returns: Observable.<void>


«Protected» onOnChanges

getonOnChanges(): Observable.<SimpleChanges>

Inherited from AbstractLifeCycleComponent.onOnChanges

Defined in src/components/rendering/abstract.lifecycle.component.ts:287

Returns: Observable.<SimpleChanges>


«Protected» onOnDestroy

getonOnDestroy(): Observable.<void>

Inherited from AbstractLifeCycleComponent.onOnDestroy

Defined in src/components/rendering/abstract.lifecycle.component.ts:303

Returns: Observable.<void>


«Protected» onOnInit

getonOnInit(): Observable.<void>

Inherited from AbstractLifeCycleComponent.onOnInit

Defined in src/components/rendering/abstract.lifecycle.component.ts:295

Returns: Observable.<void>


Methods

«Protected» describeSetter

describeSetterT(aSubject: Subject.<T>): PropertyDescriptor

Inherited from AbstractLifeCycleComponent.describeSetter

Defined in src/components/rendering/abstract.lifecycle.component.ts:328

Returns a property descriptor for a setter that dispatches to the given subject. The subject will automatically be completed and unsubscribed on the onDestroy method. The resulting descriptor may be used to define input properties in the closure of the constructor of a component.

Type parameters:

T

Parameters:

Param Type Description
aSubject Subject.<T> the subject

Returns: PropertyDescriptor the property descriptor


ngAfterContentChecked

ngAfterContentChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentChecked

Defined in src/components/rendering/abstract.lifecycle.component.ts:198

Returns: void


ngAfterContentInit

ngAfterContentInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentInit

Defined in src/components/rendering/abstract.lifecycle.component.ts:206

Returns: void


ngAfterViewChecked

ngAfterViewChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewChecked

Defined in src/components/rendering/abstract.lifecycle.component.ts:182

Returns: void


ngAfterViewInit

ngAfterViewInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewInit

Defined in src/components/rendering/abstract.lifecycle.component.ts:190

Returns: void


ngDoCheck

ngDoCheck(): void

Inherited from AbstractLifeCycleComponent.ngDoCheck

Defined in src/components/rendering/abstract.lifecycle.component.ts:214

Returns: void


ngOnChanges

ngOnChanges(changes: SimpleChanges): void

Inherited from AbstractLifeCycleComponent.ngOnChanges

Defined in src/components/rendering/abstract.lifecycle.component.ts:222

Parameters:

Param Type Description
changes SimpleChanges -

Returns: void


ngOnDestroy

ngOnDestroy(): void

Overrides AbstractLifeCycleComponent.ngOnDestroy

Defined in src/components/contentref/contentref.component.ts:235

Returns: void


ngOnInit

ngOnInit(): void

Inherited from AbstractLifeCycleComponent.ngOnInit

Defined in src/components/rendering/abstract.lifecycle.component.ts:230

Returns: void


safeSubscribe

safeSubscribeT(aObservable: Subscribable.<T>, aObserver?: PartialObserver.<T>⎮functionstring, error?: function, complete?: function): void

Inherited from AbstractLifeCycleComponent.safeSubscribe

Defined in src/components/rendering/abstract.lifecycle.component.ts:347

Type parameters:

T

Parameters:

Param Type Description
aObservable Subscribable.<T> -
aObserver PartialObserver.<T>⎮functionstring -
error function -
complete function -

Returns: void


trackByComponentId

trackByComponentId(aIndex: number, aRenderingContext: RenderingContext): string

Inherited from AbstractRenderingComponent.trackByComponentId

Defined in src/components/rendering/abstract-rendering.component.ts:164

Parameters:

Param Type Description
aIndex number -
aRenderingContext RenderingContext -

Returns: string


«Protected» unsubscribeOnDestroy

unsubscribeOnDestroy(aSubscription: Subscription): void

Inherited from AbstractLifeCycleComponent.unsubscribeOnDestroy

Defined in src/components/rendering/abstract.lifecycle.component.ts:315

Parameters:

Param Type Description
aSubscription Subscription -

Returns: void


IBM Angular SDK for Watston Content Hub > "src/components/contentref/contentref.component" > ComponentOutput

Interface: ComponentOutput

Properties

component

● component: any

Defined in src/components/contentref/contentref.component.ts:55


event

● event: any

Defined in src/components/contentref/contentref.component.ts:65


layoutMode

● layoutMode: string

Defined in src/components/contentref/contentref.component.ts:50


output

● output: OutputDefinition

Defined in src/components/contentref/contentref.component.ts:60


renderingContext

● renderingContext: RenderingContext

Defined in src/components/contentref/contentref.component.ts:45


IBM Angular SDK for Watston Content Hub > "src/components/contentref/contentref.component" > OutputDefinition

Interface: OutputDefinition

Properties

propName

● propName: string

Defined in src/components/contentref/contentref.component.ts:37


templateName

● templateName: string

Defined in src/components/contentref/contentref.component.ts:38


IBM Angular SDK for Watston Content Hub > "src/components/path/content.path.component" > ContentPathComponent

Class: ContentPathComponent

Hierarchy

AbstractBaseComponent

↳ ContentPathComponent

Implements

  • OnInit
  • OnDestroy
  • OnDestroy

Index

Constructors

Properties

Accessors

Methods


Constructors

new ContentPathComponent(wchService: WchService): ContentPathComponent

Overrides AbstractBaseComponent.constructor

Defined in src/components/path/content.path.component.ts:79

Parameters:

Param Type Description
wchService WchService -

Returns: ContentPathComponent


Properties

onComponent

● onComponent: EventEmitter.<any> = new EventEmitter()

Defined in src/components/path/content.path.component.ts:54


onComponentOutput

● onComponentOutput: EventEmitter.<ComponentOutput> = new EventEmitter()

Defined in src/components/path/content.path.component.ts:48


onLayoutMode

● onLayoutMode: Observable.<string>

Overrides AbstractBaseComponent.onLayoutMode

Defined in src/components/path/content.path.component.ts:35


onPath

● onPath: Observable.<string>

Defined in src/components/path/content.path.component.ts:79


onRenderingContext

● onRenderingContext: Observable.<RenderingContext>

Overrides AbstractBaseComponent.onRenderingContext

Defined in src/components/path/content.path.component.ts:42


Accessors

layoutMode

setlayoutMode(aValue: string): void

Inherited from AbstractBaseComponent.layoutMode

Defined in src/components/rendering/abstract-base.component.ts:39

Parameters:

Param Type Description
aValue string -

Returns: void


levels

setlevels(aValue: stringnumbernullundefined): void

Defined in src/components/path/content.path.component.ts:70

Parameters:

Param Type Description
aValue stringnumbernullundefined -

Returns: void


path

setpath(aValue: string): void

Defined in src/components/path/content.path.component.ts:103

Parameters:

Param Type Description
aValue string -

Returns: void


Methods

ngOnDestroy

ngOnDestroy(): void

Overrides AbstractBaseComponent.ngOnDestroy

Defined in src/components/path/content.path.component.ts:111

Returns: void


ngOnInit

ngOnInit(): void

Inherited from AbstractBaseComponent.ngOnInit

Defined in src/components/rendering/abstract-base.component.ts:54

Returns: void


IBM Angular SDK for Watston Content Hub > "src/components/rendering/abstract-base.component" > AbstractBaseComponent

Class: AbstractBaseComponent

Hierarchy

AbstractBaseComponent

PageComponent

SiteComponent

ContentPathComponent

Implements

  • OnInit
  • OnDestroy

Index

Constructors

Properties

Accessors

Methods


Constructors

new AbstractBaseComponent(): AbstractBaseComponent

Defined in src/components/rendering/abstract-base.component.ts:42

Returns: AbstractBaseComponent


Properties

onLayoutMode

● onLayoutMode: Observable.<string>

Defined in src/components/rendering/abstract-base.component.ts:31


onRenderingContext

● onRenderingContext: Observable.<RenderingContext>

Defined in src/components/rendering/abstract-base.component.ts:20


Accessors

layoutMode

setlayoutMode(aValue: string): void

Defined in src/components/rendering/abstract-base.component.ts:39

Parameters:

Param Type Description
aValue string -

Returns: void


Methods

ngOnDestroy

ngOnDestroy(): void

Defined in src/components/rendering/abstract-base.component.ts:62

Returns: void


ngOnInit

ngOnInit(): void

Defined in src/components/rendering/abstract-base.component.ts:54

Returns: void


IBM Angular SDK for Watston Content Hub > "src/components/rendering/abstract.lifecycle.component" > AbstractLifeCycleComponent

Class: AbstractLifeCycleComponent

Hierarchy

AbstractLifeCycleComponent

AbstractRenderingComponent

Implements

  • OnInit
  • OnDestroy
  • OnChanges
  • DoCheck
  • AfterContentInit
  • AfterContentChecked
  • AfterViewInit
  • AfterViewChecked

Index

Accessors

Methods


Accessors

«Protected» onAfterContentChecked

getonAfterContentChecked(): Observable.<void>

Defined in src/components/rendering/abstract.lifecycle.component.ts:263

Returns: Observable.<void>


«Protected» onAfterContentInit

getonAfterContentInit(): Observable.<void>

Defined in src/components/rendering/abstract.lifecycle.component.ts:271

Returns: Observable.<void>


«Protected» onAfterViewChecked

getonAfterViewChecked(): Observable.<void>

Defined in src/components/rendering/abstract.lifecycle.component.ts:247

Returns: Observable.<void>


«Protected» onAfterViewInit

getonAfterViewInit(): Observable.<void>

Defined in src/components/rendering/abstract.lifecycle.component.ts:255

Returns: Observable.<void>


«Protected» onDoCheck

getonDoCheck(): Observable.<void>

Defined in src/components/rendering/abstract.lifecycle.component.ts:279

Returns: Observable.<void>


«Protected» onOnChanges

getonOnChanges(): Observable.<SimpleChanges>

Defined in src/components/rendering/abstract.lifecycle.component.ts:287

Returns: Observable.<SimpleChanges>


«Protected» onOnDestroy

getonOnDestroy(): Observable.<void>

Defined in src/components/rendering/abstract.lifecycle.component.ts:303

Returns: Observable.<void>


«Protected» onOnInit

getonOnInit(): Observable.<void>

Defined in src/components/rendering/abstract.lifecycle.component.ts:295

Returns: Observable.<void>


Methods

«Protected» describeSetter

describeSetterT(aSubject: Subject.<T>): PropertyDescriptor

Defined in src/components/rendering/abstract.lifecycle.component.ts:328

Returns a property descriptor for a setter that dispatches to the given subject. The subject will automatically be completed and unsubscribed on the onDestroy method. The resulting descriptor may be used to define input properties in the closure of the constructor of a component.

Type parameters:

T

Parameters:

Param Type Description
aSubject Subject.<T> the subject

Returns: PropertyDescriptor the property descriptor


ngAfterContentChecked

ngAfterContentChecked(): void

Defined in src/components/rendering/abstract.lifecycle.component.ts:198

Returns: void


ngAfterContentInit

ngAfterContentInit(): void

Defined in src/components/rendering/abstract.lifecycle.component.ts:206

Returns: void


ngAfterViewChecked

ngAfterViewChecked(): void

Defined in src/components/rendering/abstract.lifecycle.component.ts:182

Returns: void


ngAfterViewInit

ngAfterViewInit(): void

Defined in src/components/rendering/abstract.lifecycle.component.ts:190

Returns: void


ngDoCheck

ngDoCheck(): void

Defined in src/components/rendering/abstract.lifecycle.component.ts:214

Returns: void


ngOnChanges

ngOnChanges(changes: SimpleChanges): void

Defined in src/components/rendering/abstract.lifecycle.component.ts:222

Parameters:

Param Type Description
changes SimpleChanges -

Returns: void


ngOnDestroy

ngOnDestroy(): void

Defined in src/components/rendering/abstract.lifecycle.component.ts:238

Returns: void


ngOnInit

ngOnInit(): void

Defined in src/components/rendering/abstract.lifecycle.component.ts:230

Returns: void


safeSubscribe

safeSubscribeT(aObservable: Subscribable.<T>, aObserver?: PartialObserver.<T>⎮functionstring, error?: function, complete?: function): void

Defined in src/components/rendering/abstract.lifecycle.component.ts:347

Type parameters:

T

Parameters:

Param Type Description
aObservable Subscribable.<T> -
aObserver PartialObserver.<T>⎮functionstring -
error function -
complete function -

Returns: void


«Protected» unsubscribeOnDestroy

unsubscribeOnDestroy(aSubscription: Subscription): void

Defined in src/components/rendering/abstract.lifecycle.component.ts:315

Parameters:

Param Type Description
aSubscription Subscription -

Returns: void


IBM Angular SDK for Watston Content Hub > "src/components/rendering/abstract-rendering.component" > AbstractRenderingComponent

Class: AbstractRenderingComponent

Hierarchy

AbstractLifeCycleComponent

↳ AbstractRenderingComponent

ContentrefComponent

Implements

  • OnInit
  • OnDestroy
  • OnChanges
  • DoCheck
  • AfterContentInit
  • AfterContentChecked
  • AfterViewInit
  • AfterViewChecked

Index

Constructors

Properties

Accessors

Methods


Constructors

new AbstractRenderingComponent(): AbstractRenderingComponent

Defined in src/components/rendering/abstract-rendering.component.ts:82

Returns: AbstractRenderingComponent


Properties

«Protected» _id

● _id: string

Defined in src/components/rendering/abstract-rendering.component.ts:44


onLayoutMode

● onLayoutMode: Observable.<string>

Defined in src/components/rendering/abstract-rendering.component.ts:82


onRenderingContext

● onRenderingContext: Observable.<RenderingContext>

Defined in src/components/rendering/abstract-rendering.component.ts:69


Accessors

«Protected» context

getcontext(): Observable.<RenderingContext>

Defined in src/components/rendering/abstract-rendering.component.ts:152

Returns: Observable.<RenderingContext>


layoutMode

getlayoutMode(): stringsetlayoutMode(aValue: string): void

Defined in src/components/rendering/abstract-rendering.component.ts:143

Returns: string

Defined in src/components/rendering/abstract-rendering.component.ts:126

Parameters:

Param Type Description
aValue string -

Returns: void


«Protected» onAfterContentChecked

getonAfterContentChecked(): Observable.<void>

Inherited from AbstractLifeCycleComponent.onAfterContentChecked

Defined in src/components/rendering/abstract.lifecycle.component.ts:263

Returns: Observable.<void>


«Protected» onAfterContentInit

getonAfterContentInit(): Observable.<void>

Inherited from AbstractLifeCycleComponent.onAfterContentInit

Defined in src/components/rendering/abstract.lifecycle.component.ts:271

Returns: Observable.<void>


«Protected» onAfterViewChecked

getonAfterViewChecked(): Observable.<void>

Inherited from AbstractLifeCycleComponent.onAfterViewChecked

Defined in src/components/rendering/abstract.lifecycle.component.ts:247

Returns: Observable.<void>


«Protected» onAfterViewInit

getonAfterViewInit(): Observable.<void>

Inherited from AbstractLifeCycleComponent.onAfterViewInit

Defined in src/components/rendering/abstract.lifecycle.component.ts:255

Returns: Observable.<void>


«Protected» onDoCheck

getonDoCheck(): Observable.<void>

Inherited from AbstractLifeCycleComponent.onDoCheck

Defined in src/components/rendering/abstract.lifecycle.component.ts:279

Returns: Observable.<void>


«Protected» onOnChanges

getonOnChanges(): Observable.<SimpleChanges>

Inherited from AbstractLifeCycleComponent.onOnChanges

Defined in src/components/rendering/abstract.lifecycle.component.ts:287

Returns: Observable.<SimpleChanges>


«Protected» onOnDestroy

getonOnDestroy(): Observable.<void>

Inherited from AbstractLifeCycleComponent.onOnDestroy

Defined in src/components/rendering/abstract.lifecycle.component.ts:303

Returns: Observable.<void>


«Protected» onOnInit

getonOnInit(): Observable.<void>

Inherited from AbstractLifeCycleComponent.onOnInit

Defined in src/components/rendering/abstract.lifecycle.component.ts:295

Returns: Observable.<void>


renderingContext

getrenderingContext(): RenderingContextsetrenderingContext(aValue: RenderingContext): void

Defined in src/components/rendering/abstract-rendering.component.ts:136

Returns: RenderingContext

Defined in src/components/rendering/abstract-rendering.component.ts:115

Parameters:

Param Type Description
aValue RenderingContext -

Returns: void


Methods

«Protected» describeSetter

describeSetterT(aSubject: Subject.<T>): PropertyDescriptor

Inherited from AbstractLifeCycleComponent.describeSetter

Defined in src/components/rendering/abstract.lifecycle.component.ts:328

Returns a property descriptor for a setter that dispatches to the given subject. The subject will automatically be completed and unsubscribed on the onDestroy method. The resulting descriptor may be used to define input properties in the closure of the constructor of a component.

Type parameters:

T

Parameters:

Param Type Description
aSubject Subject.<T> the subject

Returns: PropertyDescriptor the property descriptor


ngAfterContentChecked

ngAfterContentChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentChecked

Defined in src/components/rendering/abstract.lifecycle.component.ts:198

Returns: void


ngAfterContentInit

ngAfterContentInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentInit

Defined in src/components/rendering/abstract.lifecycle.component.ts:206

Returns: void


ngAfterViewChecked

ngAfterViewChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewChecked

Defined in src/components/rendering/abstract.lifecycle.component.ts:182

Returns: void


ngAfterViewInit

ngAfterViewInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewInit

Defined in src/components/rendering/abstract.lifecycle.component.ts:190

Returns: void


ngDoCheck

ngDoCheck(): void

Inherited from AbstractLifeCycleComponent.ngDoCheck

Defined in src/components/rendering/abstract.lifecycle.component.ts:214

Returns: void


ngOnChanges

ngOnChanges(changes: SimpleChanges): void

Inherited from AbstractLifeCycleComponent.ngOnChanges

Defined in src/components/rendering/abstract.lifecycle.component.ts:222

Parameters:

Param Type Description
changes SimpleChanges -

Returns: void


ngOnDestroy

ngOnDestroy(): void

Inherited from AbstractLifeCycleComponent.ngOnDestroy

Defined in src/components/rendering/abstract.lifecycle.component.ts:238

Returns: void


ngOnInit

ngOnInit(): void

Inherited from AbstractLifeCycleComponent.ngOnInit

Defined in src/components/rendering/abstract.lifecycle.component.ts:230

Returns: void


safeSubscribe

safeSubscribeT(aObservable: Subscribable.<T>, aObserver?: PartialObserver.<T>⎮functionstring, error?: function, complete?: function): void

Inherited from AbstractLifeCycleComponent.safeSubscribe

Defined in src/components/rendering/abstract.lifecycle.component.ts:347

Type parameters:

T

Parameters:

Param Type Description
aObservable Subscribable.<T> -
aObserver PartialObserver.<T>⎮functionstring -
error function -
complete function -

Returns: void


trackByComponentId

trackByComponentId(aIndex: number, aRenderingContext: RenderingContext): string

Defined in src/components/rendering/abstract-rendering.component.ts:164

Parameters:

Param Type Description
aIndex number -
aRenderingContext RenderingContext -

Returns: string


«Protected» unsubscribeOnDestroy

unsubscribeOnDestroy(aSubscription: Subscription): void

Inherited from AbstractLifeCycleComponent.unsubscribeOnDestroy

Defined in src/components/rendering/abstract.lifecycle.component.ts:315

Parameters:

Param Type Description
aSubscription Subscription -

Returns: void


IBM Angular SDK for Watston Content Hub > "src/decorators/bootstrap/rendering.context.bootstrap.directive" > ContentWithLayoutBootstrapDirective

Interface: ContentWithLayoutBootstrapDirective

IBM Angular SDK for Watston Content Hub > "src/decorators/bootstrap/site.bootstrap.directive" > SiteBootstrapDirective

Interface: SiteBootstrapDirective

IBM Angular SDK for Watston Content Hub > "src/components/site/site.component" > SiteComponent

Class: SiteComponent

Hierarchy

AbstractBaseComponent

↳ SiteComponent

Implements

  • OnInit
  • OnDestroy
  • OnInit

Index

Constructors

Properties

Accessors

Methods


Constructors

new SiteComponent(wchService: WchService): SiteComponent

Overrides AbstractBaseComponent.constructor

Defined in src/components/site/site.component.ts:43

Parameters:

Param Type Description
wchService WchService -

Returns: SiteComponent


Properties

onComponent

● onComponent: EventEmitter.<any> = new EventEmitter()

Defined in src/components/site/site.component.ts:43


onComponentOutput

● onComponentOutput: EventEmitter.<ComponentOutput> = new EventEmitter()

Defined in src/components/site/site.component.ts:37


onLayoutMode

● onLayoutMode: Observable.<string>

Overrides AbstractBaseComponent.onLayoutMode

Defined in src/components/site/site.component.ts:24


onRenderingContext

● onRenderingContext: Observable.<RenderingContext>

Overrides AbstractBaseComponent.onRenderingContext

Defined in src/components/site/site.component.ts:31


Accessors

layoutMode

setlayoutMode(aValue: string): void

Inherited from AbstractBaseComponent.layoutMode

Defined in src/components/rendering/abstract-base.component.ts:39

Parameters:

Param Type Description
aValue string -

Returns: void


Methods

ngOnDestroy

ngOnDestroy(): void

Inherited from AbstractBaseComponent.ngOnDestroy

Defined in src/components/rendering/abstract-base.component.ts:62

Returns: void


ngOnInit

ngOnInit(): void

Overrides AbstractBaseComponent.ngOnInit

Defined in src/components/site/site.component.ts:49

Returns: void


IBM Angular SDK for Watston Content Hub > "src/decorators/layout/layout.directive" > LayoutComponentDirective

Interface: LayoutComponentDirective

Properties

«Optional» layoutMode

● layoutMode: stringstring[]

Defined in src/decorators/layout/layout.directive.ts:25


«Optional» mappingId

● mappingId: stringstring[]

Defined in src/decorators/layout/layout.directive.ts:20


«Optional» selector

● selector: stringstring[]

Defined in src/decorators/layout/layout.directive.ts:13


IBM Angular SDK for Watston Content Hub > "src/directives/contentref.directive" > ContentrefDirective

Class: ContentrefDirective

Index

Constructors

Properties


Constructors

new ContentrefDirective(viewContainerRef: ViewContainerRef): ContentrefDirective

Defined in src/directives/contentref.directive.ts:9

Parameters:

Param Type Description
viewContainerRef ViewContainerRef -

Returns: ContentrefDirective


Properties

appContentRef

● appContentRef: string

Defined in src/directives/contentref.directive.ts:9


viewContainerRef

● viewContainerRef: ViewContainerRef

Defined in src/directives/contentref.directive.ts:11


IBM Angular SDK for Watston Content Hub > "src/interfaces/content" > Content

Interface: Content

Hierarchy

Content

ContentWithLayout

Properties

«Optional» classification

● classification: string

Defined in src/interfaces/content.ts:25


«Optional» created

● created: string

Defined in src/interfaces/content.ts:50


«Optional» creatorId

● creatorId: string

Defined in src/interfaces/content.ts:52


«Optional» description

● description: string

Defined in src/interfaces/content.ts:73


elements

● elements: object

Defined in src/interfaces/content.ts:66

Type declaration


«Optional» id

● id: string

Defined in src/interfaces/content.ts:10


«Optional» lastModified

● lastModified: string

Defined in src/interfaces/content.ts:40


«Optional» lastModifierId

● lastModifierId: string

Defined in src/interfaces/content.ts:45


«Optional» locale

● locale: string

Defined in src/interfaces/content.ts:35


«Optional» name

● name: string

Defined in src/interfaces/content.ts:20


«Optional» rev

● rev: string

Defined in src/interfaces/content.ts:15


«Optional» tags

● tags: Array.<string>

Defined in src/interfaces/content.ts:57


«Optional» type

● type: string

Defined in src/interfaces/content.ts:78


«Optional» typeId

● typeId: string

Defined in src/interfaces/content.ts:30


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > AbstractElement

Interface: AbstractElement

Hierarchy

AbstractElement

TextElement

OptionSelectionElement

FormattedTextElement

NumberElement

ToggleElement

LinkElement

DateElement

CategoryElement

FileElement

VideoElement

ImageElement

ReferenceElement

LocationElement

Properties

elementType

● elementType: ELEMENT_TYPE

Defined in src/interfaces/elements.ifaces.ts:9


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > Asset

Interface: Asset

Properties

fileName

● fileName: string

Defined in src/interfaces/elements.ifaces.ts:209


fileSize

● fileSize: number

Defined in src/interfaces/elements.ifaces.ts:208


height

● height: number

Defined in src/interfaces/elements.ifaces.ts:213


id

● id: string

Defined in src/interfaces/elements.ifaces.ts:206


mediaType

● mediaType: string

Defined in src/interfaces/elements.ifaces.ts:210


resourceUri

● resourceUri: string

Defined in src/interfaces/elements.ifaces.ts:207


width

● width: number

Defined in src/interfaces/elements.ifaces.ts:212


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > Category

Interface: Category

Hierarchy

Category

CategoryElement

Properties

«Optional» categories

● categories: string[]

Defined in src/interfaces/elements.ifaces.ts:185


«Optional» categoryIds

● categoryIds: string[]

Defined in src/interfaces/elements.ifaces.ts:184


«Optional» categoryPaths

● categoryPaths: string[][]

Defined in src/interfaces/elements.ifaces.ts:187


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > CategoryElement

Interface: CategoryElement

Hierarchy

AbstractElement

Category

↳ CategoryElement

Properties

«Optional» categories

● categories: string[]

Inherited from Category.categories

Defined in src/interfaces/elements.ifaces.ts:185


«Optional» categoryIds

● categoryIds: string[]

Inherited from Category.categoryIds

Defined in src/interfaces/elements.ifaces.ts:184


«Optional» categoryPaths

● categoryPaths: string[][]

Inherited from Category.categoryPaths

Defined in src/interfaces/elements.ifaces.ts:187


elementType

● elementType: "category"

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:202


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > DateElement

Interface: DateElement

Hierarchy

AbstractElement

↳ DateElement

SingleDateElement

MultiDateElement

Properties

elementType

● elementType: "datetime"

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:155


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > File

Interface: File

Hierarchy

File

SingleFileElement

Properties

«Optional» asset

● asset: Asset

Defined in src/interfaces/elements.ifaces.ts:223


«Optional» url

● url: string

Defined in src/interfaces/elements.ifaces.ts:224


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > FileElement

Interface: FileElement

Hierarchy

AbstractElement

↳ FileElement

SingleFileElement

MultiFileElement

Properties

elementType

● elementType: "file"

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:231


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > FormattedTextElement

Interface: FormattedTextElement

Hierarchy

AbstractElement

↳ FormattedTextElement

SingleFormattedTextElement

MultiFormattedTextElement

Properties

elementType

● elementType: "formattedtext"

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:66


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > Image

Interface: Image

Hierarchy

Image

SingleImageElement

Properties

«Optional» altText

● altText: string

Defined in src/interfaces/elements.ifaces.ts:294


«Optional» asset

● asset: Asset

Defined in src/interfaces/elements.ifaces.ts:293


«Optional» renditions

● renditions: object

Defined in src/interfaces/elements.ifaces.ts:292

Type declaration


«Optional» url

● url: string

Defined in src/interfaces/elements.ifaces.ts:295


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > ImageElement

Interface: ImageElement

Hierarchy

AbstractElement

↳ ImageElement

SingleImageElement

MultiImageElement

Properties

elementType

● elementType: "image"

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:302


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > Link

Interface: Link

Hierarchy

Link

SingleLinkElement

Properties

«Optional» linkText

● linkText: string

Defined in src/interfaces/elements.ifaces.ts:127


«Optional» linkTitle

● linkTitle: string

Defined in src/interfaces/elements.ifaces.ts:128


«Optional» linkURL

● linkURL: string

Defined in src/interfaces/elements.ifaces.ts:126


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > LinkElement

Interface: LinkElement

Hierarchy

AbstractElement

↳ LinkElement

SingleLinkElement

MultiLinkElement

Properties

elementType

● elementType: "link"

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:135


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > Location

Interface: Location

Hierarchy

Location

LocationElement

Properties

«Optional» latitude

● latitude: number

Defined in src/interfaces/elements.ifaces.ts:339


«Optional» longitude

● longitude: number

Defined in src/interfaces/elements.ifaces.ts:340


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > LocationElement

Interface: LocationElement

Hierarchy

AbstractElement

Location

↳ LocationElement

Properties

elementType

● elementType: "location"

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:344


«Optional» latitude

● latitude: number

Inherited from Location.latitude

Defined in src/interfaces/elements.ifaces.ts:339


«Optional» longitude

● longitude: number

Inherited from Location.longitude

Defined in src/interfaces/elements.ifaces.ts:340


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > MultiDateElement

Interface: MultiDateElement

Hierarchy

DateElement

↳ MultiDateElement

Properties

elementType

● elementType: "datetime"

Inherited from DateElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:155


values

● values: string[]

Defined in src/interfaces/elements.ifaces.ts:169


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > MultiFileElement

Interface: MultiFileElement

Hierarchy

FileElement

↳ MultiFileElement

Properties

elementType

● elementType: "file"

Inherited from FileElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:231


values

● values: File[]

Defined in src/interfaces/elements.ifaces.ts:248


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > MultiFormattedTextElement

Interface: MultiFormattedTextElement

Hierarchy

FormattedTextElement

↳ MultiFormattedTextElement

Properties

elementType

● elementType: "formattedtext"

Inherited from FormattedTextElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:66


values

● values: string[]

Defined in src/interfaces/elements.ifaces.ts:80


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > MultiImageElement

Interface: MultiImageElement

Hierarchy

ImageElement

↳ MultiImageElement

Properties

elementType

● elementType: "image"

Inherited from ImageElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:302


values

● values: Image[]

Defined in src/interfaces/elements.ifaces.ts:320


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > MultiLinkElement

Interface: MultiLinkElement

Hierarchy

LinkElement

↳ MultiLinkElement

Properties

elementType

● elementType: "link"

Inherited from LinkElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:135


values

● values: Link[]

Defined in src/interfaces/elements.ifaces.ts:148


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > MultiNumberElement

Interface: MultiNumberElement

Hierarchy

NumberElement

↳ MultiNumberElement

Properties

elementType

● elementType: "number"

Inherited from NumberElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:87


values

● values: number[]

Defined in src/interfaces/elements.ifaces.ts:101


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > MultiOptionSelectionElement

Interface: MultiOptionSelectionElement

Hierarchy

OptionSelectionElement

↳ MultiOptionSelectionElement

Properties

elementType

● elementType: "optionselection"

Inherited from OptionSelectionElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:45


values

● values: OptionSelection[]

Defined in src/interfaces/elements.ifaces.ts:59


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > MultiReferenceElement

Interface: MultiReferenceElement

Hierarchy

ReferenceElement

↳ MultiReferenceElement

Properties

elementType

● elementType: "reference"

Inherited from ReferenceElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:327


values

● values: RenderingContext[]

Defined in src/interfaces/elements.ifaces.ts:335


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > MultiTextElement

Interface: MultiTextElement

Hierarchy

TextElement

↳ MultiTextElement

Properties

elementType

● elementType: "text"

Inherited from TextElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:16


values

● values: string[]

Defined in src/interfaces/elements.ifaces.ts:30


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > MultiToggleElement

Interface: MultiToggleElement

Hierarchy

ToggleElement

↳ MultiToggleElement

Properties

elementType

● elementType: "toggle"

Inherited from ToggleElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:108


values

● values: boolean[]

Defined in src/interfaces/elements.ifaces.ts:122


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > MultiVideoElement

Interface: MultiVideoElement

Hierarchy

VideoElement

↳ MultiVideoElement

Properties

elementType

● elementType: "video"

Inherited from VideoElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:262


values

● values: Video[]

Defined in src/interfaces/elements.ifaces.ts:279


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > NumberElement

Interface: NumberElement

Hierarchy

AbstractElement

↳ NumberElement

SingleNumberElement

MultiNumberElement

Properties

elementType

● elementType: "number"

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:87


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > OptionSelection

Interface: OptionSelection

Representation of a selection

Properties

«Optional» label

● label: string

Defined in src/interfaces/elements.ifaces.ts:37


selection

● selection: string

Defined in src/interfaces/elements.ifaces.ts:38


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > OptionSelectionElement

Interface: OptionSelectionElement

Hierarchy

AbstractElement

↳ OptionSelectionElement

SingleOptionSelectionElement

MultiOptionSelectionElement

Properties

elementType

● elementType: "optionselection"

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:45


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > ReferenceElement

Interface: ReferenceElement

Hierarchy

AbstractElement

↳ ReferenceElement

SingleReferenceElement

MultiReferenceElement

Properties

elementType

● elementType: "reference"

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:327


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > Rendition

Interface: Rendition

Properties

height

● height: number

Defined in src/interfaces/elements.ifaces.ts:288


renditionId

● renditionId: string

Defined in src/interfaces/elements.ifaces.ts:283


source

● source: string

Defined in src/interfaces/elements.ifaces.ts:284


url

● url: string

Defined in src/interfaces/elements.ifaces.ts:286


width

● width: number

Defined in src/interfaces/elements.ifaces.ts:287


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > Resource

Interface: Resource

Properties

fileName

● fileName: string

Defined in src/interfaces/elements.ifaces.ts:219


resourceId

● resourceId: string

Defined in src/interfaces/elements.ifaces.ts:217


resourceUri

● resourceUri: string

Defined in src/interfaces/elements.ifaces.ts:218


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > SingleDateElement

Interface: SingleDateElement

Hierarchy

DateElement

↳ SingleDateElement

Properties

elementType

● elementType: "datetime"

Inherited from DateElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:155


value

● value: string

Defined in src/interfaces/elements.ifaces.ts:162


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > SingleFileElement

Interface: SingleFileElement

Hierarchy

FileElement

File

↳ SingleFileElement

Properties

«Optional» asset

● asset: Asset

Inherited from File.asset

Defined in src/interfaces/elements.ifaces.ts:223


elementType

● elementType: "file"

Inherited from FileElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:231


«Optional» url

● url: string

Inherited from File.url

Defined in src/interfaces/elements.ifaces.ts:224


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > SingleFormattedTextElement

Interface: SingleFormattedTextElement

Hierarchy

FormattedTextElement

↳ SingleFormattedTextElement

Properties

elementType

● elementType: "formattedtext"

Inherited from FormattedTextElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:66


value

● value: string

Defined in src/interfaces/elements.ifaces.ts:73


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > SingleImageElement

Interface: SingleImageElement

Hierarchy

ImageElement

Image

↳ SingleImageElement

Properties

«Optional» altText

● altText: string

Inherited from Image.altText

Defined in src/interfaces/elements.ifaces.ts:294


«Optional» asset

● asset: Asset

Inherited from Image.asset

Defined in src/interfaces/elements.ifaces.ts:293


elementType

● elementType: "image"

Inherited from ImageElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:302


«Optional» renditions

● renditions: object

Inherited from Image.renditions

Defined in src/interfaces/elements.ifaces.ts:292

Type declaration


«Optional» url

● url: string

Inherited from Image.url

Defined in src/interfaces/elements.ifaces.ts:295


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > SingleLinkElement

Interface: SingleLinkElement

Hierarchy

LinkElement

Link

↳ SingleLinkElement

Properties

elementType

● elementType: "link"

Inherited from LinkElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:135


«Optional» linkText

● linkText: string

Inherited from Link.linkText

Defined in src/interfaces/elements.ifaces.ts:127


«Optional» linkTitle

● linkTitle: string

Inherited from Link.linkTitle

Defined in src/interfaces/elements.ifaces.ts:128


«Optional» linkURL

● linkURL: string

Inherited from Link.linkURL

Defined in src/interfaces/elements.ifaces.ts:126


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > SingleNumberElement

Interface: SingleNumberElement

Hierarchy

NumberElement

↳ SingleNumberElement

Properties

elementType

● elementType: "number"

Inherited from NumberElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:87


value

● value: number

Defined in src/interfaces/elements.ifaces.ts:94


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > SingleOptionSelectionElement

Interface: SingleOptionSelectionElement

Hierarchy

OptionSelectionElement

↳ SingleOptionSelectionElement

Properties

elementType

● elementType: "optionselection"

Inherited from OptionSelectionElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:45


value

● value: OptionSelection

Defined in src/interfaces/elements.ifaces.ts:52


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > SingleReferenceElement

Interface: SingleReferenceElement

Hierarchy

ReferenceElement

↳ SingleReferenceElement

Properties

elementType

● elementType: "reference"

Inherited from ReferenceElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:327


value

● value: RenderingContext

Defined in src/interfaces/elements.ifaces.ts:331


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > SingleTextElement

Interface: SingleTextElement

Hierarchy

TextElement

↳ SingleTextElement

Properties

elementType

● elementType: "text"

Inherited from TextElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:16


value

● value: string

Defined in src/interfaces/elements.ifaces.ts:23


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > SingleToggleElement

Interface: SingleToggleElement

Hierarchy

ToggleElement

↳ SingleToggleElement

Properties

elementType

● elementType: "toggle"

Inherited from ToggleElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:108


value

● value: boolean

Defined in src/interfaces/elements.ifaces.ts:115


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > SingleVideoElement

Interface: SingleVideoElement

Hierarchy

VideoElement

Video

↳ SingleVideoElement

Properties

«Optional» asset

● asset: Asset

Inherited from Video.asset

Defined in src/interfaces/elements.ifaces.ts:254


«Optional» caption

● caption: Resource

Inherited from Video.caption

Defined in src/interfaces/elements.ifaces.ts:252


elementType

● elementType: "video"

Inherited from VideoElement.elementType

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:262


«Optional» thumbnail

● thumbnail: Resource

Inherited from Video.thumbnail

Defined in src/interfaces/elements.ifaces.ts:253


«Optional» url

● url: string

Inherited from Video.url

Defined in src/interfaces/elements.ifaces.ts:255


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > TextElement

Interface: TextElement

Hierarchy

AbstractElement

↳ TextElement

SingleTextElement

MultiTextElement

Properties

elementType

● elementType: "text"

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:16


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > ToggleElement

Interface: ToggleElement

Hierarchy

AbstractElement

↳ ToggleElement

SingleToggleElement

MultiToggleElement

Properties

elementType

● elementType: "toggle"

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:108


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > Video

Interface: Video

Hierarchy

Video

SingleVideoElement

Properties

«Optional» asset

● asset: Asset

Defined in src/interfaces/elements.ifaces.ts:254


«Optional» caption

● caption: Resource

Defined in src/interfaces/elements.ifaces.ts:252


«Optional» thumbnail

● thumbnail: Resource

Defined in src/interfaces/elements.ifaces.ts:253


«Optional» url

● url: string

Defined in src/interfaces/elements.ifaces.ts:255


IBM Angular SDK for Watston Content Hub > "src/interfaces/elements.ifaces" > VideoElement

Interface: VideoElement

Hierarchy

AbstractElement

↳ VideoElement

SingleVideoElement

MultiVideoElement

Properties

elementType

● elementType: "video"

Overrides AbstractElement.elementType

Defined in src/interfaces/elements.ifaces.ts:262


IBM Angular SDK for Watston Content Hub > "src/interfaces/extended-context" > ExtendedContext

Interface: ExtendedContext

Hierarchy

SiteContext

↳ ExtendedContext

Properties

breadcrumb

● breadcrumb: SitePage[]

Inherited from SiteContext.breadcrumb

Defined in src/internal/sites.ts:28


children

● children: SitePage[]

Inherited from SiteContext.children

Defined in src/internal/sites.ts:29


«Optional» hub

● hub: HubContext

Defined in src/interfaces/extended-context.ts:6


«Optional» parent

● parent: SitePage

Inherited from SiteContext.parent

Defined in src/internal/sites.ts:26


sibling

● sibling: SitePage[]

Inherited from SiteContext.sibling

Defined in src/internal/sites.ts:27


site

● site: Site

Inherited from SiteContext.site

Defined in src/internal/sites.ts:30


IBM Angular SDK for Watston Content Hub > "src/interfaces/rendering-context" > RenderingContext

Interface: RenderingContext

Hierarchy

ContentWithLayout

↳ RenderingContext

Properties

«Optional» category

● category: ElementMapCategoryElement

Defined in src/interfaces/rendering-context.ts:58


«Optional» classification

● classification: string

Inherited from Content.classification

Defined in src/interfaces/content.ts:25


context

● context: ExtendedContext

Defined in src/interfaces/rendering-context.ts:63


«Optional» created

● created: string

Inherited from Content.created

Defined in src/interfaces/content.ts:50


«Optional» creatorId

● creatorId: string

Inherited from Content.creatorId

Defined in src/interfaces/content.ts:52


«Optional» date

● date: ElementMapDate

Defined in src/interfaces/rendering-context.ts:44


«Optional» dates

● dates: ElementMapDate[]

Defined in src/interfaces/rendering-context.ts:45


«Optional» description

● description: string

Inherited from Content.description

Defined in src/interfaces/content.ts:73


elements

● elements: object

Inherited from Content.elements

Defined in src/interfaces/content.ts:66

Type declaration


«Optional» file

● file: ElementMapSingleFileElement

Defined in src/interfaces/rendering-context.ts:48


«Optional» files

● files: ElementMapFile[]

Defined in src/interfaces/rendering-context.ts:49


«Optional» formattedtext

● formattedtext: ElementMapstring

Defined in src/interfaces/rendering-context.ts:40