Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@ibm-wch-sdk/ng

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ibm-wch-sdk/ng

Software development kit to simplify the development of Angular based single page applications against Watson Content Hub.

latest
npmnpm
Version
6.0.524
Version published
Maintainers
2
Created
Source

IBM Angular SDK for Watson 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 environment = {
  production: false,
  apiUrl
};

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

  • support for registering a layout per layout mode

Changes

  • the life cycle observables onOnInit and onOnDestroy have replay semantics, i.e. they fire for each consumer that attaches to the hooks.

Breaking Changes

  • Removed the ComponentOutput events. Use the component events and subscribe to the component instance, instead.

6.0.69

Breaking Changes

  • Migrated to rxjs 6.x, all rx related code has to use the new imports
  • Changes the SDK coordinates to use the @ibm-wch-sdk/ namespace
  • Removed InjectorService since dependency injection should NOT be done via Injector classes, directly

Changes

  • Layout components are now created synchronously, instead of asynchronously to prevent flickering

Added

  • Support for tree-shakeable services
  • New ContentResolver service to support manual resolution of lazy loaded content
  • Support for lazy loading using the Router component
  • Support for dynamic pages
  • Support for group elements
  • Support for Angular 6

5.0.107 - 2018-02-28

Breaking Changes

  • Renamed ContentWithLayout to ContentItemWithLayout.

Changes

  • Split the module into the API module ibm-wch-sdk-api and the implementation module ibm-wch-sdk-ng. No breaking change expected, since the API is re-exported by the implementation module. I recommend however to reference the exports from the API module rather than those from the implementation module.

1.0.830 - 2018-01-16

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

@ibm-wch-sdk/ng

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)
};

Developing modules based on the SDK

When developing modules that use the SDK, make sure to import the WchNgComponentsModule to have access to the components and directives exposed by the SDK.

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. @ibm-wch-sdk/ng > "components/content/content.component"

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

Index

Classes

Type aliases

Variables

Type aliases

ComponentState

Ƭ ComponentState: [RenderingContext, string]

Defined in components/content/content.component.ts:30

Combines the active pieces of the state into one single object

Variables

<Const> LOGGER

● LOGGER: "ContentComponent" = "ContentComponent"

Defined in components/content/content.component.ts:25

@ibm-wch-sdk/ng > "components/contentquery/contentquery.component"

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

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "ContentQueryComponent" = "ContentQueryComponent"

Defined in components/contentquery/contentquery.component.ts:42

@ibm-wch-sdk/ng > "components/contentref/contentref.component"

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

Index

Classes

Type aliases

Variables

Functions

Object literals

Type aliases

ComponentState

Ƭ ComponentState: [ComponentTypeRef<any>, RenderingContext, string]

Defined in components/contentref/contentref.component.ts:80

Combines the active pieces of the state into one single object

Variables

<Const> LOGGER

● LOGGER: "ContentrefComponent" = "ContentrefComponent"

Defined in components/contentref/contentref.component.ts:27

Functions

getType

getType(aId: string, aLayoutMode: string | undefined, aRenderingContext: RenderingContext, aCmp: ComponentsService, aMapping: LayoutMappingService): Observable<ComponentTypeRef<any>>

Defined in components/contentref/contentref.component.ts:48

Parameters:

NameType
aIdstring
aLayoutModestring | undefined
aRenderingContextRenderingContext
aCmpComponentsService
aMappingLayoutMappingService

Returns: Observable<ComponentTypeRef<any>>

Object literals

<Const> LAYOUT_NOT_FOUND_LAYOUT

LAYOUT_NOT_FOUND_LAYOUT: object

Defined in components/contentref/contentref.component.ts:33

template

● template: string = ComponentsService.DEFAULT_LAYOUT

Defined in components/contentref/contentref.component.ts:35

templateType

● templateType: string = LAYOUT_TYPE_ANGULAR

Defined in components/contentref/contentref.component.ts:34

<Const> PAGE_NOT_FOUND_LAYOUT

PAGE_NOT_FOUND_LAYOUT: object

Defined in components/contentref/contentref.component.ts:29

template

● template: string = ComponentsService.PAGE_NOT_FOUND_LAYOUT

Defined in components/contentref/contentref.component.ts:31

templateType

● templateType: string = LAYOUT_TYPE_ANGULAR

Defined in components/contentref/contentref.component.ts:30

@ibm-wch-sdk/ng > "components/default/default.component"

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

Index

Classes

@ibm-wch-sdk/ng > "components/page/page.component"

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

Index

Classes

Type aliases

Variables

Functions

Type aliases

ComponentState

Ƭ ComponentState: [RenderingContext, string]

Defined in components/page/page.component.ts:139

Combines the active pieces of the state into one single object

Variables

<Const> LOGGER

● LOGGER: "PageComponent" = "PageComponent"

Defined in components/page/page.component.ts:23

<Const> _EMPTY_VALUE

● _EMPTY_VALUE: "" = ""

Defined in components/page/page.component.ts:27

<Const> _META_NAME_DESCRIPTION

● _META_NAME_DESCRIPTION: "description" = "description"

Defined in components/page/page.component.ts:26

<Const> _META_NAME_ID

● _META_NAME_ID: "id" = "id"

Defined in components/page/page.component.ts:25

Functions

_boxValue

_boxValue(aValue?: string): string

Defined in components/page/page.component.ts:34

Parameters:

NameType
Optional aValuestring

Returns: string

_getDescription

_getDescription(aSitePage: SitePage, aRenderingContext: RenderingContext): string

Defined in components/page/page.component.ts:92

Parameters:

NameType
aSitePageSitePage
aRenderingContextRenderingContext

Returns: string

_getTitle

_getTitle(aSitePage: SitePage, aRenderingContext: RenderingContext): string

Defined in components/page/page.component.ts:69

Parameters:

NameType
aSitePageSitePage
aRenderingContextRenderingContext

Returns: string

_setMetaTag

_setMetaTag(aMetaService: Meta, aId: string, aValue?: string): void

Defined in components/page/page.component.ts:45

Parameters:

NameType
aMetaServiceMeta
aIdstring
Optional aValuestring

Returns: void

_setTitleTag

_setTitleTag(aTitle: Title, aValue?: string): void

Defined in components/page/page.component.ts:56

Parameters:

NameType
aTitleTitle
Optional aValuestring

Returns: void

_updateMetaData

_updateMetaData(aContext: RenderingContext, aTitleService: Title, aMetaService: Meta): void

Defined in components/page/page.component.ts:110

Parameters:

NameType
aContextRenderingContext
aTitleServiceTitle
aMetaServiceMeta

Returns: void

@ibm-wch-sdk/ng > "components/pageref/pageref.component"

External module: "components/pageref/pageref.component"

Index

Classes

Type aliases

Variables

Type aliases

ComponentState

Ƭ ComponentState: [RenderingContext, string]

Defined in components/pageref/pageref.component.ts:28

Combines the active pieces of the state into one single object

Variables

<Const> LOGGER

● LOGGER: "PagerefComponent" = "PagerefComponent"

Defined in components/pageref/pageref.component.ts:23

@ibm-wch-sdk/ng > "components/path/content.path.component"

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

Index

Classes

Type aliases

Variables

Type aliases

ComponentState

Ƭ ComponentState: [RenderingContext, string]

Defined in components/path/content.path.component.ts:20

Combines the active pieces of the state into one single object

Variables

<Const> LOGGER

● LOGGER: "ContentPathComponent" = "ContentPathComponent"

Defined in components/path/content.path.component.ts:15

@ibm-wch-sdk/ng > "components/rendering/abstract-base.component"

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

Index

Classes

Variables

Variables

<Let> ID

● ID: number = 0

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

<Const> LOGGER

● LOGGER: "AbstractBaseComponent" = "AbstractBaseComponent"

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

@ibm-wch-sdk/ng > "components/rendering/abstract-rendering.component"

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

Index

Classes

Variables

Variables

<Let> ID

● ID: number = 0

Defined in components/rendering/abstract-rendering.component.ts:25

<Const> LOGGER

● LOGGER: "AbstractRenderingComponent" = "AbstractRenderingComponent"

Defined in components/rendering/abstract-rendering.component.ts:23

@ibm-wch-sdk/ng > "components/rendering/abstract.lifecycle.component"

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

Index

Classes

Type aliases

Variables

Functions

Type aliases

Registry

Ƭ Registry: any[][]

Defined in components/rendering/abstract.lifecycle.component.ts:49

Variables

<Const> FIELD_CALLBACKS

● FIELD_CALLBACKS: 1 = 1

Defined in components/rendering/abstract.lifecycle.component.ts:46

<Const> FIELD_OBSERVABLE

● FIELD_OBSERVABLE: 2 = 2

Defined in components/rendering/abstract.lifecycle.component.ts:47

<Const> HOOK_AFTERCONTENTCHECKED

● HOOK_AFTERCONTENTCHECKED: 2 = 2

Defined in components/rendering/abstract.lifecycle.component.ts:39

<Const> HOOK_AFTERCONTENTINIT

● HOOK_AFTERCONTENTINIT: 3 = 3

Defined in components/rendering/abstract.lifecycle.component.ts:40

<Const> HOOK_AFTERVIEWCHECKED

● HOOK_AFTERVIEWCHECKED: 0 = 0

Defined in components/rendering/abstract.lifecycle.component.ts:37

Enumeration of the possible hooks

<Const> HOOK_AFTERVIEWINIT

● HOOK_AFTERVIEWINIT: 1 = 1

Defined in components/rendering/abstract.lifecycle.component.ts:38

<Const> HOOK_CHANGES

● HOOK_CHANGES: 6 = 6

Defined in components/rendering/abstract.lifecycle.component.ts:43

<Const> HOOK_DESTROY

● HOOK_DESTROY: 7 = 7

Defined in components/rendering/abstract.lifecycle.component.ts:44

<Const> HOOK_DOCHECK

● HOOK_DOCHECK: 4 = 4

Defined in components/rendering/abstract.lifecycle.component.ts:41

<Const> HOOK_INIT

● HOOK_INIT: 5 = 5

Defined in components/rendering/abstract.lifecycle.component.ts:42

<Const> KEY_REGISTRY

● KEY_REGISTRY: string | symbol = createSymbol()

Defined in components/rendering/abstract.lifecycle.component.ts:52

Functions

_addHook

_addHook(aHookIdentifier: number, aThis: AbstractLifeCycleComponent, aHook: Function): void

Defined in components/rendering/abstract.lifecycle.component.ts:154

Registers a life cycle hook with the component

Parameters:

NameType
aHookIdentifiernumber
aThisAbstractLifeCycleComponent
aHookFunction

Returns: void

_assertCallbacks

_assertCallbacks(aHook: any[]): Function[]

Defined in components/rendering/abstract.lifecycle.component.ts:84

Makes sure we have a callbacks array defined

Parameters:

NameTypeDescription
aHookany[]the hook structure

Returns: Function[] the callback field

_assertHook

_assertHook(aHookIdentifier: number, aThis: AbstractLifeCycleComponent): any[]

Defined in components/rendering/abstract.lifecycle.component.ts:70

Makes sure we have a hook data structure for the identifier

Parameters:

NameTypeDescription
aHookIdentifiernumberthe hook identifier
aThisAbstractLifeCycleComponentthe instance

Returns: any[] the hook structure

_createObservable

_createObservable(aHookIdentifier: number, aHook: any[], aShared: boolean, aThis: AbstractLifeCycleComponent): Observable<any>

Defined in components/rendering/abstract.lifecycle.component.ts:97

Construct the desired observable

Parameters:

NameTypeDescription
aHookIdentifiernumberthe hook
aHookany[]
aSharedboolean
aThisAbstractLifeCycleComponentthe life cycle component

Returns: Observable<any> the observable

_getObservable

_getObservable(aHookIdentifier: number, aShared: boolean, aThis: AbstractLifeCycleComponent): Observable<any>

Defined in components/rendering/abstract.lifecycle.component.ts:132

Registers an observable for a hook

Parameters:

NameTypeDescription
aHookIdentifiernumberthe identifier for the hook
aSharedboolean
aThisAbstractLifeCycleComponentthe instance of the component

Returns: Observable<any> the observable

_invokeHooks

_invokeHooks(aHookIdentifier: number, aThis: AbstractLifeCycleComponent, aArgs: IArguments): void

Defined in components/rendering/abstract.lifecycle.component.ts:171

Invokes the lifecycle hooks for the component

Parameters:

NameTypeDescription
aHookIdentifiernumber
aThisAbstractLifeCycleComponentthe this pointer
aArgsIArgumentsthe arguments

Returns: void

_removeRegistry

_removeRegistry(aThis: AbstractLifeCycleComponent): void

Defined in components/rendering/abstract.lifecycle.component.ts:59

Clears the registry from the component

Parameters:

NameTypeDescription
aThisAbstractLifeCycleComponentthe instance

Returns: void

createGetter

createGetter<T>(aObservable: Observable<T>, aThis: AbstractLifeCycleComponent, aInitial?: T): PropertyDescriptor

Defined in components/rendering/abstract.lifecycle.component.ts:451

Constructs a getter that subscribes to a value

Type parameters:

T

Parameters:

NameTypeDescription
aObservableObservable<T>the observable
aThisAbstractLifeCycleComponentthe component
Optional aInitialTthe optional initial value

Returns: PropertyDescriptor the descriptor

createSetter

createSetter<T>(aSubject: Subject<T>, aThis: AbstractLifeCycleComponent): PropertyDescriptor

Defined in components/rendering/abstract.lifecycle.component.ts:432

Constructs a setter that is unregistered automatically in onDestroy

Type parameters:

T

Parameters:

NameTypeDescription
aSubjectSubject<T>the subject
aThisAbstractLifeCycleComponentthe component

Returns: PropertyDescriptor the descriptor

@ibm-wch-sdk/ng > "components/site/site.component"

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

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "SiteComponent" = "SiteComponent"

Defined in components/site/site.component.ts:11

@ibm-wch-sdk/ng > "decorators/bootstrap/rendering.context.bootstrap.decorator"

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

Index

Functions

Functions

ContentWithLayoutBootstrap

ContentWithLayoutBootstrap(aDirective?: ContentWithLayoutBootstrapDirective): function

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

Parameters:

NameType
Optional aDirectiveContentWithLayoutBootstrapDirective

Returns: function

@ibm-wch-sdk/ng > "decorators/bootstrap/rendering.context.bootstrap.directive"

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

Index

Interfaces

@ibm-wch-sdk/ng > "decorators/bootstrap/site.bootstrap.decorator"

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

Index

Variables

Functions

Variables

<Const> LOGGER

● LOGGER: "SiteBootstrap" = "SiteBootstrap"

Defined in decorators/bootstrap/site.bootstrap.decorator.ts:8

Functions

SiteBootstrap

SiteBootstrap(aDirective?: SiteBootstrapDirective): function

Defined in decorators/bootstrap/site.bootstrap.decorator.ts:15

Parameters:

NameType
Optional aDirectiveSiteBootstrapDirective

Returns: function

@ibm-wch-sdk/ng > "decorators/bootstrap/site.bootstrap.directive"

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

Index

Interfaces

@ibm-wch-sdk/ng > "decorators/layout/layout.decorator"

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

Index

Interfaces

Type aliases

Variables

Functions

Type aliases

ExpressionGetter

Ƭ ExpressionGetter: function

Defined in decorators/layout/layout.decorator.ts:355

Type declaration

▸(): string

Returns: string

Subscriptions

Ƭ Subscriptions: Subscription[]

Defined in decorators/layout/layout.decorator.ts:54

Variables

<Const> KEY_EXPRESSION

● KEY_EXPRESSION: "45b01348-de92-44a0-8103-7b7dc471ad8c" = "45b01348-de92-44a0-8103-7b7dc471ad8c"

Defined in decorators/layout/layout.decorator.ts:52

<Const> KEY_OBSERVABLE_PREFIX

● KEY_OBSERVABLE_PREFIX: "on" = "on"

Defined in decorators/layout/layout.decorator.ts:47

<Const> KEY_ON_DESTROY

● KEY_ON_DESTROY: "ngOnDestroy" = "ngOnDestroy"

Defined in decorators/layout/layout.decorator.ts:48

<Const> KEY_SUBSCRIPTIONS

● KEY_SUBSCRIPTIONS: string | symbol = createSymbol()

Defined in decorators/layout/layout.decorator.ts:49

<Const> LOGGER

● LOGGER: "LayoutDecorator" = "LayoutDecorator"

Defined in decorators/layout/layout.decorator.ts:44

<Const> UNDEFINED_RENDERING_CONTEXT_SUBJECT

● UNDEFINED_RENDERING_CONTEXT_SUBJECT: BehaviorSubject<RenderingContext> = new _BehaviorSubject( UNDEFINED_RENDERING_CONTEXT )

Defined in decorators/layout/layout.decorator.ts:165

<Const> _BehaviorSubject

● _BehaviorSubject: BehaviorSubject = BehaviorSubject

Defined in decorators/layout/layout.decorator.ts:45

<Const> _SYMBOLS

● _SYMBOLS: Record<string, symbol | string>

Defined in decorators/layout/layout.decorator.ts:63

<Const> _expressionCache

● _expressionCache: object

Defined in decorators/layout/layout.decorator.ts:78

Type declaration

Functions

LayoutComponent

LayoutComponent(aDirective?: LayoutComponentDirective): function

Defined in decorators/layout/layout.decorator.ts:535

Parameters:

NameType
Optional aDirectiveLayoutComponentDirective

Returns: function

LayoutMapping

LayoutMapping(aID: string | string[] | LayoutMappingDirective, aSelector?: string | string[] | Type<any>, aLayoutMode?: string | string[]): function

Defined in decorators/layout/layout.decorator.ts:594

Parameters:

NameType
aIDstring | string[] | LayoutMappingDirective
Optional aSelectorstring | string[] | Type<any>
Optional aLayoutModestring | string[]

Returns: function

RenderingContextBinding

RenderingContextBinding<T>(aBinding?: string | RenderingContextDirective<T>, aDefault?: T): function

Defined in decorators/layout/layout.decorator.ts:565

Type parameters:

T

Parameters:

NameType
Optional aBindingstring | RenderingContextDirective<T>
Optional aDefaultT

Returns: function

_assertBinding

_assertBinding<T>(aInstance: any, aSymbol: symbol | string, aName: string): Binding<T>

Defined in decorators/layout/layout.decorator.ts:156

Makes sure we have a binding

Type parameters:

T

Parameters:

NameTypeDescription
aInstanceanythe instance to attach the binding to
aSymbolsymbol | stringthe symbol
aNamestringname of the object

Returns: Binding<T> the binding

_baseExpressionFromObservableExpression

_baseExpressionFromObservableExpression(aKey: string): string

Defined in decorators/layout/layout.decorator.ts:337

Parameters:

NameType
aKeystring

Returns: string

_getExpressionFromDescriptor

_getExpressionFromDescriptor(aPrototype: any, aOtherKey: string): string | null | undefined

Defined in decorators/layout/layout.decorator.ts:365

Returns an expression from its descriptor

Parameters:

NameTypeDescription
aPrototypeanythe prototype
aOtherKeystringthe key

Returns: string | null | undefined the expression, null if no expression exists and undefined if we need to fallback

_getExpressionFromPrototype

_getExpressionFromPrototype(aPrototype: any, aOtherKey: string): string | null | undefined

Defined in decorators/layout/layout.decorator.ts:394

Checks if we can find an expression from the other property

Parameters:

NameTypeDescription
aPrototypeanythe prototype
aOtherKeystringthe other key

Returns: string | null | undefined the expression, null if no expression exists and undefined if we need to fallback

_getExpressionGetter

_getExpressionGetter(aPrototype: any, aExpression: string | null | undefined, aKey: string, aOtherKey: string): ExpressionGetter

Defined in decorators/layout/layout.decorator.ts:422

Returns a getter method that computes the expression associated with a property

Parameters:

NameTypeDescription
aPrototypeanycurrent prototype
aExpressionstring | null | undefinedthe expression, may be null or undefined
aKeystring
aOtherKeystringthe alternative key

Returns: ExpressionGetter the getter. The getter returns the expression or null

_getObservableExpression

_getObservableExpression<T>(aInstance: any, aSymbol: symbol | string, aName: string, aHandler: RenderingContextDirective<T>): Observable<T>

Defined in decorators/layout/layout.decorator.ts:198

Type parameters:

T

Parameters:

NameType
aInstanceany
aSymbolsymbol | string
aNamestring
aHandlerRenderingContextDirective<T>

Returns: Observable<T>

_getOnRenderingContext

_getOnRenderingContext(aInstance: any): Observable<RenderingContext>

Defined in decorators/layout/layout.decorator.ts:169

Parameters:

NameType
aInstanceany

Returns: Observable<RenderingContext>

_getResolvedExpression

_getResolvedExpression<T>(aInstance: any, aSymbol: symbol | string, aBaseName: string, aObserableName: string, aHandler?: RenderingContextDirective<T>): T

Defined in decorators/layout/layout.decorator.ts:267

Type parameters:

T

Parameters:

NameType
aInstanceany
aSymbolsymbol | string
aBaseNamestring
aObserableNamestring
Optional aHandlerRenderingContextDirective<T>

Returns: T

_getSymbol

_getSymbol(aName: string): symbol | string

Defined in decorators/layout/layout.decorator.ts:71

Parameters:

NameType
aNamestring

Returns: symbol | string

_isObservableExpression

_isObservableExpression(aKey: string): boolean

Defined in decorators/layout/layout.decorator.ts:321

Parameters:

NameType
aKeystring

Returns: boolean

_isStringOrArray

_isStringOrArray(aValue: any): boolean

Defined in decorators/layout/layout.decorator.ts:585

Tests if a value is a string or a string array

Parameters:

NameType
aValueany

Returns: boolean

_isUpperCase

_isUpperCase(aValue: string): boolean

Defined in decorators/layout/layout.decorator.ts:311

Parameters:

NameType
aValuestring

Returns: boolean

_observableExpressionFromBaseExpression

_observableExpressionFromBaseExpression(aKey: string): string

Defined in decorators/layout/layout.decorator.ts:350

Parameters:

NameType
aKeystring

Returns: string

_parseExpression

_parseExpression(aExpression: string): RenderingContextDirective<any>

Defined in decorators/layout/layout.decorator.ts:86

Parameters:

NameType
aExpressionstring

Returns: RenderingContextDirective<any>

_registerExpression

_registerExpression<T>(aPrototype: any, aPropertyKey: string, aExpression: string, aDefault?: T): void

Defined in decorators/layout/layout.decorator.ts:131

Type parameters:

T

Parameters:

NameType
aPrototypeany
aPropertyKeystring
aExpressionstring
Optional aDefaultT

Returns: void

_registerRenderingContextDirective

_registerRenderingContextDirective<T>(aPrototype: any, aPropertyKey: string, aExpression: string | null, aHandler?: RenderingContextDirective<T>, aDefault?: T): void

Defined in decorators/layout/layout.decorator.ts:459

Type parameters:

T

Parameters:

NameType
aPrototypeany
aPropertyKeystring
aExpressionstring | null
Optional aHandlerRenderingContextDirective<T>
Optional aDefaultT

Returns: void

_registerSubscription

_registerSubscription(aInstance: any, aSubscription: Subscription): void

Defined in decorators/layout/layout.decorator.ts:230

Parameters:

NameType
aInstanceany
aSubscriptionSubscription

Returns: void

@ibm-wch-sdk/ng > "decorators/layout/layout.directive"

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

Index

Interfaces

Type aliases

Type aliases

RenderingContextDirective

Ƭ RenderingContextDirective: function

Defined in decorators/layout/layout.directive.ts:37

Type declaration

▸(ctx: RenderingContext): T

Parameters:

NameType
ctxRenderingContext

Returns: T

@ibm-wch-sdk/ng > "directives/contentref.directive"

External module: "directives/contentref.directive"

Index

Classes

Variables

Functions

Variables

<Const> KEYS

● KEYS: string[] = [KEY_LAYOUT_MODE, KEY_RENDERING_CONTEXT]

Defined in directives/contentref.directive.ts:41

<Const> LOGGER

● LOGGER: "ContentRefDirective" = "ContentRefDirective"

Defined in directives/contentref.directive.ts:43

Functions

_getComponentFactoryResolver

_getComponentFactoryResolver(aConfig?: Route): ComponentFactoryResolver

Defined in directives/contentref.directive.ts:21

Parameters:

NameType
Optional aConfigRoute

Returns: ComponentFactoryResolver

@ibm-wch-sdk/ng > "guards/root.page.guard"

External module: "guards/root.page.guard"

Index

Classes

@ibm-wch-sdk/ng > "index"

External module: "index"

Index

@ibm-wch-sdk/ng > "interfaces"

External module: "interfaces"

Index

@ibm-wch-sdk/ng > "interfaces/hub-context"

External module: "interfaces/hub-context"

Index

Interfaces

@ibm-wch-sdk/ng > "internal/assert"

External module: "internal/assert"

Index

Variables

Functions

Variables

<Let> DEV_MODE_ENABLED

● DEV_MODE_ENABLED: boolean = true

Defined in internal/assert.ts:21

<Const> DEV_MODE_SUBJECT

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

Defined in internal/assert.ts:26

<Const> _BehaviorSubject

● _BehaviorSubject: BehaviorSubject = BehaviorSubject

Defined in internal/assert.ts:16

Functions

assertDefined

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

Defined in internal/assert.ts:91

Parameters:

NameType
aValueany
Optional aMessagestring

Returns: void

assertDependency

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

Defined in internal/assert.ts:41

Parameters:

NameType
aValueany
aNamestring

Returns: void

assertIsAbsoluteURL

assertIsAbsoluteURL(aValue: URL | string, aMessage?: string): void

Defined in internal/assert.ts:115

Parameters:

NameType
aValueURL | string
Optional aMessagestring

Returns: void

assertIsArray

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

Defined in internal/assert.ts:71

Parameters:

NameType
aValueany
Optional aMessagestring

Returns: void

assertIsFunction

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

Defined in internal/assert.ts:59

Parameters:

NameType
aValueany
Optional aMessagestring

Returns: void

assertIsObservable

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

Defined in internal/assert.ts:47

Parameters:

NameType
aValueany
Optional aMessagestring

Returns: void

assertIsPlainObject

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

Defined in internal/assert.ts:53

Parameters:

NameType
aValueany
Optional aMessagestring

Returns: void

assertIsString

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

Defined in internal/assert.ts:65

Parameters:

NameType
aValueany
Optional aMessagestring

Returns: void

assertNil

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

Defined in internal/assert.ts:77

Parameters:

NameType
aValueany
Optional aMessagestring

Returns: void

assertNotNil

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

Defined in internal/assert.ts:83

Parameters:

NameType
aValueany
Optional aMessagestring

Returns: void

assertNull

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

Defined in internal/assert.ts:103

Parameters:

NameType
aValueany
Optional aMessagestring

Returns: void

assertTrue

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

Defined in internal/assert.ts:109

Parameters:

NameType
aValueany
Optional aMessagestring

Returns: void

assertUndefined

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

Defined in internal/assert.ts:97

Parameters:

NameType
aValueany
Optional aMessagestring

Returns: void

isAssertOn

isAssertOn(): boolean

Defined in internal/assert.ts:37

Returns: boolean

isDevModeOn

isDevModeOn(): boolean

Defined in internal/assert.ts:33

Returns: boolean

@ibm-wch-sdk/ng > "module"

External module: "module"

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "WchNgModule" = "WchNgModule"

Defined in module.ts:44

@ibm-wch-sdk/ng > "modules/components.module"

External module: "modules/components.module"

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "WchNgComponentsModule" = "WchNgComponentsModule"

Defined in modules/components.module.ts:15

@ibm-wch-sdk/ng > "modules/services.module"

External module: "modules/services.module"

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "WchNgServicesModule" = "WchNgServicesModule"

Defined in modules/services.module.ts:11

@ibm-wch-sdk/ng > "routing/default.routes"

External module: "routing/default.routes"

Index

Variables

Variables

<Const> DEFAULT_ROUTES

● DEFAULT_ROUTES: Routes = freezeDeep([ { path: '**', component: PageComponent } ])

Defined in routing/default.routes.ts:6

@ibm-wch-sdk/ng > "services/bootstrap/bootstrap.service"

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

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "BootstrapService" = "BootstrapService"

Defined in services/bootstrap/bootstrap.service.ts:15

@ibm-wch-sdk/ng > "services/components/components.service"

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

Index

Classes

Interfaces

Variables

Functions

Variables

<Const> LOGGER

● LOGGER: "ComponentsService" = "ComponentsService"

Defined in services/components/components.service.ts:26

<Const> _DEFAULT_LAYOUT

● _DEFAULT_LAYOUT: "wch-default-layout" = "wch-default-layout"

Defined in services/components/components.service.ts:29

<Const> _DEFAULT_LAYOUT_MODES

● _DEFAULT_LAYOUT_MODES: string[] = [DEFAULT_LAYOUT_MODE]

Defined in services/components/components.service.ts:96

<Const> _PAGE_NOT_FOUND_LAYOUT

● _PAGE_NOT_FOUND_LAYOUT: "wch-404" = "wch-404"

Defined in services/components/components.service.ts:31

Functions

_createMappingEntry

_createMappingEntry(aKey: string, aLayoutMode: string): MappingEntry

Defined in services/components/components.service.ts:63

Constructs an entry in the mapping table

Parameters:

NameTypeDescription
aKeystringthe layout key
aLayoutModestringthe layout mode for debugging purposes

Returns: MappingEntry the entry

_getEntry

_getEntry(aController: string, aLayoutMode: string, aMapByLayoutMode: ByLayoutModeMapping): MappingEntry

Defined in services/components/components.service.ts:182

Makes sure to get a subject

Parameters:

NameTypeDescription
aControllerstringthe controller ID
aLayoutModestringthe layout mode
aMapByLayoutModeByLayoutModeMappingthe mapping from layout mode to controller mapping

Returns: MappingEntry the subject

_getLayoutModesFromComponent

_getLayoutModesFromComponent(aComponent: RegisteredComponent): string[]

Defined in services/components/components.service.ts:119

Returns the layout modes for the component

Parameters:

NameTypeDescription
aComponentRegisteredComponentthe layout component descriptor

Returns: string[] the modes

_getLayoutModesFromConfig

_getLayoutModesFromConfig(aModes?: string | string[]): string[]

Defined in services/components/components.service.ts:104

Returns the layout modes for the component

Parameters:

NameTypeDescription
Optional aModesstring | string[]the layout component descriptor

Returns: string[] the modes

_getSelectorsFromComponent

_getSelectorsFromComponent(aComponent: RegisteredComponent): string[]

Defined in services/components/components.service.ts:82

Parameters:

NameType
aComponentRegisteredComponent

Returns: string[]

_getTypeByLayout

_getTypeByLayout(aLayout: Layout, aLayoutMode: string, aMapping: ByLayoutModeMapping, aMarkupService: MarkupService): Observable<ComponentTypeRef<any>>

Defined in services/components/components.service.ts:258

Parameters:

NameType
aLayoutLayout
aLayoutModestring
aMappingByLayoutModeMapping
aMarkupServiceMarkupService

Returns: Observable<ComponentTypeRef<any>>

_getTypeBySelector

_getTypeBySelector(aSelector: string, aLayoutMode: string, aMapping: ByLayoutModeMapping): Observable<ComponentTypeRef<any>>

Defined in services/components/components.service.ts:233

Parameters:

NameType
aSelectorstring
aLayoutModestring
aMappingByLayoutModeMapping

Returns: Observable<ComponentTypeRef<any>>

_getTypeByTemplateType

_getTypeByTemplateType(aType: string, aLayoutMode: string, aMarkupService: MarkupService): Observable<ComponentTypeRef<any>>

Defined in services/components/components.service.ts:217

Parameters:

NameType
aTypestring
aLayoutModestring
aMarkupServiceMarkupService

Returns: Observable<ComponentTypeRef<any>>

_getTypeName

_getTypeName(aType: Type<any>): string

Defined in services/components/components.service.ts:52

Tries to decode the name from the type

Parameters:

NameTypeDescription
aTypeType<any>the type

Returns: string the name

_onRegisterComponent

_onRegisterComponent(aController: string, aLayoutMode: string, aTypeRef: ComponentTypeRef<any>, aMap: ByLayoutModeMapping): void

Defined in services/components/components.service.ts:202

Parameters:

NameType
aControllerstring
aLayoutModestring
aTypeRefComponentTypeRef<any>
aMapByLayoutModeMapping

Returns: void

_onRegisteredComponent

_onRegisteredComponent(aComponent: RegisteredComponent, aMap: ByLayoutModeMapping): void

Defined in services/components/components.service.ts:149

Parameters:

NameType
aComponentRegisteredComponent
aMapByLayoutModeMapping

Returns: void

_registerByLayoutModesAndSelectors

_registerByLayoutModesAndSelectors(aTypeRef: ComponentTypeRef<any>, aLayoutModes: string[], aSelectors: string[], aMap: ByLayoutModeMapping): void

Defined in services/components/components.service.ts:125

Parameters:

NameType
aTypeRefComponentTypeRef<any>
aLayoutModesstring[]
aSelectorsstring[]
aMapByLayoutModeMapping

Returns: void

@ibm-wch-sdk/ng > "services/config/application.config"

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

Index

Interfaces

@ibm-wch-sdk/ng > "services/config/application.config.service"

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

Index

Classes

@ibm-wch-sdk/ng > "services/config/empty.application.config"

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

Index

Object literals

Object literals

<Const> EMPTY_APPLICATION_CONFIG

EMPTY_APPLICATION_CONFIG: object

Defined in services/config/empty.application.config.ts:4

classification

● classification: string = "content"

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

elements

● elements: object

Defined in services/config/empty.application.config.ts:11

Type declaration

id

● id: null = null

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

kind

● kind: undefined[] = []

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

name

● name: null = null

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

type

● type: null = null

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

typeId

● typeId: null = null

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

@ibm-wch-sdk/ng > "services/dependency/dependency.service"

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

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "DependencyService" = "DependencyService"

Defined in services/dependency/dependency.service.ts:15

@ibm-wch-sdk/ng > "services/dependency/message"

External module: "services/dependency/message"

Index

Variables

Variables

<Const> LOGGER

● LOGGER: "SdkMessages" = "SdkMessages"

Defined in services/dependency/message.ts:6

<Const> SDK_MESSAGE_HANDLER

● SDK_MESSAGE_HANDLER: InjectionToken<SdkMessageHandler> = new InjectionToken('SdkMessageHandler')

Defined in services/dependency/message.ts:9

@ibm-wch-sdk/ng > "services/dependency/message/sdk.navigate.by.path.message"

External module: "services/dependency/message/sdk.navigate.by.path.message"

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "SdkNavigateByPathHandler" = "SdkNavigateByPathHandler"

Defined in services/dependency/message/sdk.navigate.by.path.message.ts:9

@ibm-wch-sdk/ng > "services/dependency/message/sdk.refresh.message"

External module: "services/dependency/message/sdk.refresh.message"

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "SdkRefreshHandler" = "SdkRefreshHandler"

Defined in services/dependency/message/sdk.refresh.message.ts:9

@ibm-wch-sdk/ng > "services/dependency/message/sdk.set.mode.message"

External module: "services/dependency/message/sdk.set.mode.message"

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "SdkSetModeHandler" = "SdkSetModeHandler"

Defined in services/dependency/message/sdk.set.mode.message.ts:9

@ibm-wch-sdk/ng > "services/dependency/message/sdk.subscribe.active.route.message"

External module: "services/dependency/message/sdk.subscribe.active.route.message"

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "SdkSubscribeActiveRouteHandler" = "SdkSubscribeActiveRouteHandler"

Defined in services/dependency/message/sdk.subscribe.active.route.message.ts:9

@ibm-wch-sdk/ng > "services/dependency/message/sdk.subscribe.message"

External module: "services/dependency/message/sdk.subscribe.message"

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "SdkUnsubscribeHandler" = "SdkUnsubscribeHandler"

Defined in services/dependency/message/sdk.subscribe.message.ts:8

@ibm-wch-sdk/ng > "services/dependency/message/sdk.subscribe.mode.message"

External module: "services/dependency/message/sdk.subscribe.mode.message"

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "SdkSubscribeModeHandler" = "SdkSubscribeModeHandler"

Defined in services/dependency/message/sdk.subscribe.mode.message.ts:9

@ibm-wch-sdk/ng > "services/dependency/message/sdk.subscribe.route.message"

External module: "services/dependency/message/sdk.subscribe.route.message"

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "SdkSubscribeRouteHandler" = "SdkSubscribeRouteHandler"

Defined in services/dependency/message/sdk.subscribe.route.message.ts:9

@ibm-wch-sdk/ng > "services/dependency/sdk/jsonp/jsonp"

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

Index

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

JsonpCallback

Ƭ JsonpCallback: Consumer<AnyJson>

Defined in services/dependency/sdk/jsonp/jsonp.ts:22

Variables

<Const> LOGGER

● LOGGER: "SdkJsonp" = "SdkJsonp"

Defined in services/dependency/sdk/jsonp/jsonp.ts:15

<Const> _digestCache

● _digestCache: function = createCache()

Defined in services/dependency/sdk/jsonp/jsonp.ts:31

Type declaration

▸(aKey: string, aCallback: CacheCallback<V>, aLogger?: Logger): V

Parameters:

NameType
aKeystring
aCallbackCacheCallback<V>
Optional aLoggerLogger

Returns: V

Functions

<Const> _createDigest

_createDigest(aToken: string): string

Defined in services/dependency/sdk/jsonp/jsonp.ts:39

Parameters:

NameType
aTokenstring

Returns: string

<Const> _getHash

_getHash(aToken: string): string

Defined in services/dependency/sdk/jsonp/jsonp.ts:47

Parameters:

NameType
aTokenstring

Returns: string

_registerCallback

_registerCallback(aApiRoot: string, aUrl: string, aCallback: JsonpCallback, aCallbacks: JsonpCallbacks): string

Defined in services/dependency/sdk/jsonp/jsonp.ts:57

Parameters:

NameType
aApiRootstring
aUrlstring
aCallbackJsonpCallback
aCallbacksJsonpCallbacks

Returns: string

<Const> _removeCallback

_removeCallback(aDigest: string, aCallbacks: JsonpCallbacks): boolean

Defined in services/dependency/sdk/jsonp/jsonp.ts:79

Parameters:

NameType
aDigeststring
aCallbacksJsonpCallbacks

Returns: boolean

@ibm-wch-sdk/ng > "services/dependency/sdk/router/router"

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

Index

Classes

Interfaces

Variables

Variables

<Const> LOGGER

● LOGGER: "SdkRouter" = "SdkRouter"

Defined in services/dependency/sdk/router/router.ts:11

@ibm-wch-sdk/ng > "services/dependency/sdk/sdk"

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

Index

Classes

Interfaces

Variables

Variables

<Const> LOGGER

● LOGGER: "Sdk" = "Sdk"

Defined in services/dependency/sdk/sdk.ts:26

<Const> _MESSAGE_EVENT

● _MESSAGE_EVENT: "message" = "message"

Defined in services/dependency/sdk/sdk.ts:13

<Const> _MODULE_NAME

● _MODULE_NAME: "WchSdk" = WCH_SDK_MODULE_NAME

Defined in services/dependency/sdk/sdk.ts:28

<Const> bHasHandlers

● bHasHandlers: boolean = (typeof addEventListener === FUNCTION_TYPE) && (typeof removeEventListener === FUNCTION_TYPE)

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

@ibm-wch-sdk/ng > "services/dependency/sdk/search/search"

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

Index

Classes

Interfaces

@ibm-wch-sdk/ng > "services/dependency/sdk/version"

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

Index

Interfaces

Object literals

Object literals

<Const> SDK_VERSION

SDK_VERSION: object

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

build

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

Defined in services/dependency/sdk/version.ts:17

version

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

Defined in services/dependency/sdk/version.ts:16

@ibm-wch-sdk/ng > "services/http/http.service"

External module: "services/http/http.service"

Index

Classes

@ibm-wch-sdk/ng > "services/http/http.service.on.http.client"

External module: "services/http/http.service.on.http.client"

Index

Classes

@ibm-wch-sdk/ng > "services/http/http.service.on.jsonp"

External module: "services/http/http.service.on.jsonp"

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "HttpServiceOnJsonp" = "HttpServiceOnJsonp"

Defined in services/http/http.service.on.jsonp.ts:17

@ibm-wch-sdk/ng > "services/hub-info/hub-info.service"

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

Index

Classes

Functions

Functions

selectApiURL

selectApiURL(aService?: HubInfoConfig): HubInfoUrlProvider

Defined in services/hub-info/hub-info.service.ts:105

Parameters:

NameType
Optional aServiceHubInfoConfig

Returns: HubInfoUrlProvider

selectBaseURL

selectBaseURL(aService?: HubInfoConfig): HubInfoUrlProvider

Defined in services/hub-info/hub-info.service.ts:115

Parameters:

NameType
Optional aServiceHubInfoConfig

Returns: HubInfoUrlProvider

selectCycleHandlingStrategy

selectCycleHandlingStrategy(aService?: HubInfoConfig): CYCLE_HANDLING | string

Defined in services/hub-info/hub-info.service.ts:131

Parameters:

NameType
Optional aServiceHubInfoConfig

Returns: CYCLE_HANDLING | string

selectDeliveryURL

selectDeliveryURL(aService?: HubInfoConfig): HubInfoUrlProvider

Defined in services/hub-info/hub-info.service.ts:109

Parameters:

NameType
Optional aServiceHubInfoConfig

Returns: HubInfoUrlProvider

selectFetchLevels

selectFetchLevels(aService?: HubInfoConfig): number

Defined in services/hub-info/hub-info.service.ts:137

Parameters:

NameType
Optional aServiceHubInfoConfig

Returns: number

selectHttpOptions

selectHttpOptions(aService?: HubInfoConfig): HttpResourceOptions

Defined in services/hub-info/hub-info.service.ts:119

Parameters:

NameType
Optional aServiceHubInfoConfig

Returns: HttpResourceOptions

selectHttpPreviewOptions

selectHttpPreviewOptions(aService?: HubInfoConfig): HttpResourceOptions

Defined in services/hub-info/hub-info.service.ts:125

Parameters:

NameType
Optional aServiceHubInfoConfig

Returns: HttpResourceOptions

@ibm-wch-sdk/ng > "services/hub-info/tokens"

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

Index

Variables

Variables

<Const> WCH_HUB_INFO_CONFIG

● WCH_HUB_INFO_CONFIG: InjectionToken<HubInfoConfig> = new InjectionToken( 'HubInfoConfig' )

Defined in services/hub-info/tokens.ts:83

<Const> WCH_TOKEN_API_URL

● WCH_TOKEN_API_URL: "D86BA418-5252-45BB-938C-E17BBE044D0F" = "D86BA418-5252-45BB-938C-E17BBE044D0F"

Defined in services/hub-info/tokens.ts:15

URL to access the API layer

Naming of this field according to the field in the rendering context

example: 'https://my.digitalexperience.ibm.com/api/345563cf-a83c-40e5-a065-1d6ff36b05c1'

example: 'https://my.digitalexperience.ibm.com/api/345563cf-a83c-40e5-a065-1d6ff36b05c1/dxsites/mysite'

see: [[HubInfoConfig]]

<Const> WCH_TOKEN_BASE_URL

● WCH_TOKEN_BASE_URL: "F5EBA2A4-2C6F-4FEF-B3D5-3C801CB1F2EB" = "F5EBA2A4-2C6F-4FEF-B3D5-3C801CB1F2EB"

Defined in services/hub-info/tokens.ts:40

URL that represents the base URL of the path based routing of the application. This prefix will be preserved when generating and recognizing URLs. If this property is not configured, then it will be decoded from the window location.

example: 'https://my.digitalexperience.ibm.com/345563cf-a83c-40e5-a065-1d6ff36b05c1'

example: 'https://my.digitalexperience.ibm.com/345563cf-a83c-40e5-a065-1d6ff36b05c1/dxsites/mysite'

example: 'https://my.external.example.com/'

see: [[HubInfoConfig]]

<Const> WCH_TOKEN_CYCLE_HANDLING_STRATEGY

● WCH_TOKEN_CYCLE_HANDLING_STRATEGY: "FAB70C09-F04A-4702-A8CC-87D3A3CED224" = "FAB70C09-F04A-4702-A8CC-87D3A3CED224"

Defined in services/hub-info/tokens.ts:72

Optionally specify how the SDK is supposed to deal with cyclic references in the content data structure. Per default the rendering context will break cycles by representing the duplicate element in a reference path by an unresolved reference. When configuring the strategy to {@link CYCLE_HANDLING.RESOLVE}, the ContentrefComponent will use a resolved refence when rendering the context, instead of the unresolved reference. This bears the risk of an infinite loop during rendering. The actual rendering context objects will still not have cycles, so a JSON serialization of these objects will produce a valid result.

Default is {@link CYCLE_HANDLING.BREAK}

see: [[HubInfoConfig]]

<Const> WCH_TOKEN_DELIVERY_URL

● WCH_TOKEN_DELIVERY_URL: "4BEFD6AD-FA4C-42D7-8C4C-2DCA38CDB499" = "4BEFD6AD-FA4C-42D7-8C4C-2DCA38CDB499"

Defined in services/hub-info/tokens.ts:27

URL to access the delivery

Naming of this field according to the field in the rendering context

example: 'https://my.digitalexperience.ibm.com/345563cf-a83c-40e5-a065-1d6ff36b05c1'

example: 'https://my.digitalexperience.ibm.com/345563cf-a83c-40e5-a065-1d6ff36b05c1/dxsites/mysite'

see: [[HubInfoConfig]]

<Const> WCH_TOKEN_FETCH_LEVELS

● WCH_TOKEN_FETCH_LEVELS: "62906A7D-0DE3-4404-AE7C-89E5FD91C72D" = "62906A7D-0DE3-4404-AE7C-89E5FD91C72D"

Defined in services/hub-info/tokens.ts:81

Number of levels to fetch per request to the rendering context. If missing all levels will be fetched.

see: [[HubInfoConfig]]

<Const> WCH_TOKEN_HTTP_OPTIONS

● WCH_TOKEN_HTTP_OPTIONS: "536C2178-F41A-4F56-AF89-83B52E5274D9" = "536C2178-F41A-4F56-AF89-83B52E5274D9"

Defined in services/hub-info/tokens.ts:47

Optionally specify how the SDK makes outbound requests

see: [[HubInfoConfig]]

<Const> WCH_TOKEN_HTTP_PREVIEW_OPTIONS

● WCH_TOKEN_HTTP_PREVIEW_OPTIONS: "3AC667BA-FBAE-426D-BE7C-00DF1364280D" = "3AC667BA-FBAE-426D-BE7C-00DF1364280D"

Defined in services/hub-info/tokens.ts:54

Optionally specify how the SDK makes outbound requests for the preview case

see: [[HubInfoConfig]]

@ibm-wch-sdk/ng > "services/info/wch.info.service"

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

Index

Classes

@ibm-wch-sdk/ng > "services/logger/logger.service"

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

Index

Classes

Variables

Functions

Variables

<Const> CREATE_CONSOLE_LOGGER

● CREATE_CONSOLE_LOGGER: UnaryFunction<string, Logger> = createConsoleLogger

Defined in services/logger/logger.service.ts:21

<Const> CREATE_EMPTY_LOGGER

● CREATE_EMPTY_LOGGER: UnaryFunction<string, Logger> = createEmptyLogger

Defined in services/logger/logger.service.ts:23

<Const> _LOGGERS

● _LOGGERS: object

Defined in services/logger/logger.service.ts:18

Type declaration

<Let> _hasLoggerDelegateOverride

● _hasLoggerDelegateOverride: boolean = false

Defined in services/logger/logger.service.ts:29

<Let> _loggerDelegateOverride

● _loggerDelegateOverride: any

Defined in services/logger/logger.service.ts:26

<Const> _modeSubscription

● _modeSubscription: Subscription = DEV_MODE_SUBJECT.subscribe(mode => { // we only need to refresh if there was not explicit override if (_hasLoggerDelegateOverride) { _refreshLoggers(); } })

Defined in services/logger/logger.service.ts:110

Functions

_getLogger

_getLogger(aName: any): any

Defined in services/logger/logger.service.ts:38

Parameters:

NameType
aNameany

Returns: any

_getLoggerDelegate

_getLoggerDelegate(): any

Defined in services/logger/logger.service.ts:31

Returns: any

_isLogging

_isLogging(): boolean

Defined in services/logger/logger.service.ts:47

Tests if logging is enabled

Returns: boolean true if logging is enabled, else false

_logDeferred

_logDeferred(aFunction: Function, aArgs: IArguments): void

Defined in services/logger/logger.service.ts:76

Parameters:

NameType
aFunctionFunction
aArgsIArguments

Returns: void

_logError

_logError(aType: string, ...aArgs: any[]): void

Defined in services/logger/logger.service.ts:61

Parameters:

NameType
aTypestring
Rest aArgsany[]

Returns: void

_logErrorDeferred

_logErrorDeferred(aType: string, ...aArgs: any[]): void

Defined in services/logger/logger.service.ts:89

Parameters:

NameType
aTypestring
Rest aArgsany[]

Returns: void

_logInfo

_logInfo(aType: string, ...aArgs: any[]): void

Defined in services/logger/logger.service.ts:52

Parameters:

NameType
aTypestring
Rest aArgsany[]

Returns: void

_logInfoDeferred

_logInfoDeferred(aType: string, ...aArgs: any[]): void

Defined in services/logger/logger.service.ts:84

Parameters:

NameType
aTypestring
Rest aArgsany[]

Returns: void

_logWarn

_logWarn(aType: string, ...aArgs: any[]): void

Defined in services/logger/logger.service.ts:67

Parameters:

NameType
aTypestring
Rest aArgsany[]

Returns: void

_logWarnDeferred

_logWarnDeferred(aType: string, ...aArgs: any[]): void

Defined in services/logger/logger.service.ts:94

Parameters:

NameType
aTypestring
Rest aArgsany[]

Returns: void

_refreshLoggers

_refreshLoggers(): void

Defined in services/logger/logger.service.ts:99

Returns: void

@ibm-wch-sdk/ng > "services/logger/wch.logger.service"

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

Index

Classes

Functions

Functions

_createLoggerProxy

_createLoggerProxy(aName: string): Logger

Defined in services/logger/wch.logger.service.ts:13

Constructs a proxy around our logger

Parameters:

NameTypeDescription
aNamestringthe name of the loger

Returns: Logger the proxy

@ibm-wch-sdk/ng > "services/mappings/mappings.service"

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

Index

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

MappingEntry

Ƭ MappingEntry: Record<string, Selector>

Defined in services/mappings/mappings.service.ts:31

Selector

Ƭ Selector: string | Type<any>

Defined in services/mappings/mappings.service.ts:26

Variables

<Const> EMPTY_ARRAY

● EMPTY_ARRAY: string[] = []

Defined in services/mappings/mappings.service.ts:70

<Const> EMPTY_LAYOUT_MODES

● EMPTY_LAYOUT_MODES: string[] = [DEFAULT_LAYOUT_MODE]

Defined in services/mappings/mappings.service.ts:71

<Const> LOGGER

● LOGGER: "MappingsService" = "MappingsService"

Defined in services/mappings/mappings.service.ts:24

Functions

_findMappingByKind

_findMappingByKind(aKeys: string[], aMap: Mappings): MappingEntry | undefined

Defined in services/mappings/mappings.service.ts:45

Parameters:

NameType
aKeysstring[]
aMapMappings

Returns: MappingEntry | undefined

_getIds

_getIds(aMapping: RegisteredMapping): string[]

Defined in services/mappings/mappings.service.ts:95

Parameters:

NameType
aMappingRegisteredMapping

Returns: string[]

_getKinds

_getKinds(aMapping: RegisteredMapping): string[]

Defined in services/mappings/mappings.service.ts:106

Parameters:

NameType
aMappingRegisteredMapping

Returns: string[]

_getLayoutModes

_getLayoutModes(aMapping: RegisteredMapping): string[]

Defined in services/mappings/mappings.service.ts:117

Parameters:

NameType
aMappingRegisteredMapping

Returns: string[]

_getMappingById

_getMappingById(aKey: string | null | undefined, aMap: Mappings): MappingEntry | undefined

Defined in services/mappings/mappings.service.ts:38

Parameters:

NameType
aKeystring | null | undefined
aMapMappings

Returns: MappingEntry | undefined

_getMappingByKind

_getMappingByKind(aKeys: string[] | null | undefined, aMap: Mappings): MappingEntry | undefined

Defined in services/mappings/mappings.service.ts:63

Parameters:

NameType
aKeysstring[] | null | undefined
aMapMappings

Returns: MappingEntry | undefined

_getSelector

_getSelector(aLayoutMode: string, aRenderingContext: RenderingContext, aMap: Mappings): string | undefined

Defined in services/mappings/mappings.service.ts:223

Parameters:

NameType
aLayoutModestring
aRenderingContextRenderingContext
aMapMappings

Returns: string | undefined

_getSelectors

_getSelectors(aMapping: RegisteredMapping): Selector[]

Defined in services/mappings/mappings.service.ts:128

Parameters:

NameType
aMappingRegisteredMapping

Returns: Selector[]

_onRegisterMapping

_onRegisterMapping(aId: string, aSelector: Selector, aLayoutMode: string, aMap: Record<string, MappingEntry>): void

Defined in services/mappings/mappings.service.ts:197

Parameters:

NameType
aIdstring
aSelectorSelector
aLayoutModestring
aMapRecord<string, MappingEntry>

Returns: void

_onRegisteredMapping

_onRegisteredMapping(aMapping: RegisteredMapping, aMap: Mappings): void

Defined in services/mappings/mappings.service.ts:176

Parameters:

NameType
aMappingRegisteredMapping
aMapMappings

Returns: void

_registerAll

_registerAll(aIds: string[], aKinds: string[], aModes: string[], aSelectors: Selector[], aMap: Mappings): void

Defined in services/mappings/mappings.service.ts:155

Parameters:

NameType
aIdsstring[]
aKindsstring[]
aModesstring[]
aSelectorsSelector[]
aMapMappings

Returns: void

_registerAllMappings

_registerAllMappings(aIds: string[], aModes: string[], aSelectors: Selector[], aMap: Record<string, MappingEntry>): void

Defined in services/mappings/mappings.service.ts:138

Parameters:

NameType
aIdsstring[]
aModesstring[]
aSelectorsSelector[]
aMapRecord<string, MappingEntry>

Returns: void

_registerMapping

_registerMapping(aId: string | string[], aSelector: string | string[] | Type<any>, aLayoutMode: string | string[], aMap: Mappings): void

Defined in services/mappings/mappings.service.ts:256

Parameters:

NameType
aIdstring | string[]
aSelectorstring | string[] | Type<any>
aLayoutModestring | string[]
aMapMappings

Returns: void

_toStringArray

_toStringArray(aValue: any, aDefault: string[]): string[]

Defined in services/mappings/mappings.service.ts:80

Parameters:

NameType
aValueany
aDefaultstring[]

Returns: string[]

@ibm-wch-sdk/ng > "services/markup/markup.service"

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

Index

Classes

Interfaces

Type aliases

Variables

Type aliases

MarkupGenerator

Ƭ MarkupGenerator: function

Defined in services/markup/markup.service.ts:7

Type declaration

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

Parameters:

NameType
contextRenderingContext
Optional optionsany

Returns: string

Variables

<Const> KEY_PROVIDERS

● KEY_PROVIDERS: string | symbol = createSymbol()

Defined in services/markup/markup.service.ts:21

@ibm-wch-sdk/ng > "services/page/active.page.service"

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

Index

Classes

@ibm-wch-sdk/ng > "services/refresh/refresh.service"

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

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "RefreshService" = "RefreshService"

Defined in services/refresh/refresh.service.ts:7

@ibm-wch-sdk/ng > "services/resolver/content.resolver.service"

External module: "services/resolver/content.resolver.service"

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "ContentResolverService" = "ContentResolverService"

Defined in services/resolver/content.resolver.service.ts:7

@ibm-wch-sdk/ng > "services/search/search.service"

External module: "services/search/search.service"

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "SearchService" = "SearchService"

Defined in services/search/search.service.ts:12

@ibm-wch-sdk/ng > "services/storage/storage.service"

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

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "StorageService" = "StorageService"

Defined in services/storage/storage.service.ts:7

@ibm-wch-sdk/ng > "services/url/urls.service"

External module: "services/url/urls.service"

Index

Classes

Variables

Variables

<Const> LOGGER

● LOGGER: "UrlsService" = "UrlsService"

Defined in services/url/urls.service.ts:25

@ibm-wch-sdk/ng > "services/wch.service"

External module: "services/wch.service"

Index

Classes

Variables

Functions

Object literals

Variables

<Const> DEFAULT_CYCLE_HANDLING

● DEFAULT_CYCLE_HANDLING: BREAK = CYCLE_HANDLING.BREAK

Defined in services/wch.service.ts:154

<Const> EMPTY_PAGE_SEARCH_RESULT

● EMPTY_PAGE_SEARCH_RESULT: PageSearchResult[] = []

Defined in services/wch.service.ts:125

<Const> EMPTY_RENDERING_CONTEXTS

● EMPTY_RENDERING_CONTEXTS: RenderingContext[] = []

Defined in services/wch.service.ts:126

<Const> EMPTY_RENDERING_CONTEXTS_SEQUENCE

● EMPTY_RENDERING_CONTEXTS_SEQUENCE: Observable<RenderingContextQueryResult> = of(EMPTY_RENDERING_QUERY)

Defined in services/wch.service.ts:138

<Const> EMPTY_RENDERING_CONTEXT_SEARCH_RESULT

● EMPTY_RENDERING_CONTEXT_SEARCH_RESULT: RenderingContextSearchResult[] = []

Defined in services/wch.service.ts:124

<Const> EMPTY_SITE_PAGES_SEQUENCE

● EMPTY_SITE_PAGES_SEQUENCE: Observable<SitePagesQueryResult> = of( EMPTY_SITE_PAGES_QUERY )

Defined in services/wch.service.ts:141

<Const> LOGGER

● LOGGER: "WchService" = "WchService"

Defined in services/wch.service.ts:150

<Const> NO_RENDERING_CONTEXT

● NO_RENDERING_CONTEXT: Observable<RenderingContext> = of( EMPTY_RENDERING_CONTEXT ).pipe(map(cloneDeep))

Defined in services/wch.service.ts:145

<Const> UNKNOWN_RENDERING_CONTEXT

● UNKNOWN_RENDERING_CONTEXT: Observable<RenderingContext> = of(undefined)

Defined in services/wch.service.ts:148

<Const> _BehaviorSubject

● _BehaviorSubject: BehaviorSubject = BehaviorSubject

Defined in services/wch.service.ts:122

<Const> _Subject

● _Subject: Subject = Subject

Defined in services/wch.service.ts:151

Functions

_pluckDocument

_pluckDocument<T>(aSearchResult: SearchResult<T>): T

Defined in services/wch.service.ts:162

Extracts the document element from a search result

Type parameters:

T

Parameters:

NameTypeDescription
aSearchResultSearchResult<T>the result

Returns: T the document

_pluckSiteId

_pluckSiteId(aSite: Site): string

Defined in services/wch.service.ts:172

Extracts the site ID from the site

Parameters:

NameTypeDescription
aSiteSitethe site

Returns: string the document

Object literals

<Const> EMPTY_RENDERING_QUERY

EMPTY_RENDERING_QUERY: object

Defined in services/wch.service.ts:127

numFound

● numFound: number = 0

Defined in services/wch.service.ts:128

renderingContexts

● renderingContexts: RenderingContext[] = EMPTY_RENDERING_CONTEXTS

Defined in services/wch.service.ts:129

<Const> EMPTY_SITE_PAGES_QUERY

EMPTY_SITE_PAGES_QUERY: object

Defined in services/wch.service.ts:131

numFound

● numFound: number = 0

Defined in services/wch.service.ts:132

sitePages

● sitePages: undefined[] = []

Defined in services/wch.service.ts:133

@ibm-wch-sdk/ng > "services/zone/zone.service"

External module: "services/zone/zone.service"

Index

Classes

Functions

Functions

opAssertInAngularZone

opAssertInAngularZone<T>(): MonoTypeOperatorFunction<T>

Defined in services/zone/zone.service.ts:54

Helper operator to assert that a function is executed in an angular zone

Type parameters:

T

Returns: MonoTypeOperatorFunction<T> the assertion operator

@ibm-wch-sdk/ng > "utils/bootstrap.utils"

External module: "utils/bootstrap.utils"

Index

Type aliases

Variables

Functions

Type aliases

BootstrapInput

Ƭ BootstrapInput: BootstrapSource<T> | Generator<BootstrapSource<T>>

Defined in utils/bootstrap.utils.ts:42

BootstrapSource

Ƭ BootstrapSource: T | string | ObservableInput<T>

Defined in utils/bootstrap.utils.ts:41

Variables

<Const> LOGGER

● LOGGER: "BootstrapUtils" = "BootstrapUtils"

Defined in utils/bootstrap.utils.ts:37

<Const> data

● data: object

Defined in utils/bootstrap.utils.ts:65

Type declaration

Functions

<Const> _addDebug

_addDebug<T>(aObject: T): T

Defined in utils/bootstrap.utils.ts:39

Type parameters:

T

Parameters:

NameType
aObjectT

Returns: T

_bootstrapClear

_bootstrapClear(): void

Defined in utils/bootstrap.utils.ts:139

Returns: void

_bootstrapGet

_bootstrapGet(aKey: string): Observable<AnyJson>

Defined in utils/bootstrap.utils.ts:152

Parameters:

NameType
aKeystring

Returns: Observable<AnyJson>

_bootstrapInputToObservable

_bootstrapInputToObservable<T>(aValue: BootstrapInput<T>): Observable<T>

Defined in utils/bootstrap.utils.ts:73

Converts the input to an observable of the desired type

Type parameters:

T

Parameters:

NameTypeDescription
aValueBootstrapInput<T>the value to convert

Returns: Observable<T> the type

_bootstrapPut

_bootstrapPut(aKey: string, aValue: AnyJson | string | ObservableInput<AnyJson> | Generator<AnyJson>): void

Defined in utils/bootstrap.utils.ts:167

Parameters:

NameType
aKeystring
aValueAnyJson | string | ObservableInput<AnyJson> | Generator<AnyJson>

Returns: void

_bootstrapPutContentWithLayout

_bootstrapPutContentWithLayout(aContext: ContentItemWithLayout | string): Subscription | undefined

Defined in utils/bootstrap.utils.ts:200

Parameters:

NameType
aContextContentItemWithLayout | string

Returns: Subscription | undefined

_bootstrapPutSite

_bootstrapPutSite(aInput: BootstrapInput<Site>, aSiteId?: string): Subscription | undefined

Defined in utils/bootstrap.utils.ts:244

Parameters:

NameType
aInputBootstrapInput<Site>
Optional aSiteIdstring

Returns: Subscription | undefined

_bootstrapRemove

_bootstrapRemove(aKey: string): void

Defined in utils/bootstrap.utils.ts:186

Parameters:

NameType
aKeystring

Returns: void

_generatorToObservable

_generatorToObservable<T>(aGenerator: Generator<BootstrapSource<T>>): Observable<T>

Defined in utils/bootstrap.utils.ts:106

Converts a generator, the result of the generator can be another input

Type parameters:

T

Parameters:

NameTypeDescription
aGeneratorGenerator<BootstrapSource<T>>the generator

Returns: Observable<T> the observable

_internalPut

_internalPut(aKey: string, aValue: BootstrapInput<AnyJson>): void

Defined in utils/bootstrap.utils.ts:123

Parameters:

NameType
aKeystring
aValueBootstrapInput<AnyJson>

Returns: void

_isBootstrapInput

_isBootstrapInput<T>(aValue: any): boolean

Defined in utils/bootstrap.utils.ts:52

Tests if the value is a valid input

Type parameters:

T

Parameters:

NameTypeDescription
aValueanythe value

Returns: boolean true if the value is valid

@ibm-wch-sdk/ng > "utils/component.mapping.utils"

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

Index

Interfaces

Variables

Functions

Variables

<Const> LOGGER

● LOGGER: "ComponentMappingUtils" = "ComponentMappingUtils"

Defined in utils/component.mapping.utils.ts:13

<Const> _ReplaySubject

● _ReplaySubject: ReplaySubject = ReplaySubject

Defined in utils/component.mapping.utils.ts:14

<Const> _mappingsSubject

● _mappingsSubject: ReplaySubject<RegisteredMapping> = new _ReplaySubject()

Defined in utils/component.mapping.utils.ts:41

Functions

_destroy

_destroy(): void

Defined in utils/component.mapping.utils.ts:100

Returns: void

_getRegistered

_getRegistered(): Observable<RegisteredMapping>

Defined in utils/component.mapping.utils.ts:47

Returns: Observable<RegisteredMapping>

_registerFromLayoutComponent

_registerFromLayoutComponent(aDirective: LayoutComponentDirective, aType: Type<any>): void

Defined in utils/component.mapping.utils.ts:57

Parameters:

NameType
aDirectiveLayoutComponentDirective
aTypeType<any>

Returns: void

_registerFromMappingDirective

_registerFromMappingDirective(aDirective: LayoutMappingDirective, aComponent: Type<any>): void

Defined in utils/component.mapping.utils.ts:85

Parameters:

NameType
aDirectiveLayoutMappingDirective
aComponentType<any>

Returns: void

@ibm-wch-sdk/ng > "utils/component.utils"

External module: "utils/component.utils"

Index

Interfaces

Variables

Functions

Variables

<Const> EMPTY_ARRAY

● EMPTY_ARRAY: string[] = []

Defined in utils/component.utils.ts:21

<Const> KEY_ANNOTATIONS

● KEY_ANNOTATIONS: string | symbol = createSymbol()

Defined in utils/component.utils.ts:24

<Const> LOGGER

● LOGGER: "ComponentUtils" = "ComponentUtils"

Defined in utils/component.utils.ts:18

<Const> REFLECT_ANNOTATIONS

● REFLECT_ANNOTATIONS: "annotations" = "annotations"

Defined in utils/component.utils.ts:22

<Const> _ReplaySubject

● _ReplaySubject: ReplaySubject = ReplaySubject

Defined in utils/component.utils.ts:19

<Const> componentsObservable

● componentsObservable: ReplaySubject<RegisteredComponent> = componentsSubject

Defined in utils/component.utils.ts:82

<Const> componentsSubject

● componentsSubject: ReplaySubject<RegisteredComponent> = new _ReplaySubject()

Defined in utils/component.utils.ts:81

Functions

_addAnnotation

_addAnnotation(aAnnotation: any, aHost: any): any[]

Defined in utils/component.utils.ts:35

Adds one of our own annotations to the host and returns the set of annotations.

Parameters:

NameTypeDescription
aAnnotationanythe annotation to add
aHostanythe host to add the annotations to

Returns: any[] the list of annotations

_destroy

_destroy(): void

Defined in utils/component.utils.ts:102

Returns: void

_getAllAnnotations

_getAllAnnotations(aHost: any): any[]

Defined in utils/component.utils.ts:56

Returns all known annotations, which are a combination of our own annotations and the angular annotations.

Parameters:

NameTypeDescription
aHostanythe type to get the annotations from

Returns: any[] the list of annotations

_getAnnotations

_getAnnotations(aHost: any): any[]

Defined in utils/component.utils.ts:45

Returns our annotations for a function type

Parameters:

NameTypeDescription
aHostanythe type to get the annotations from

Returns: any[] the list of annotations

_getRegisteredComponents

_getRegisteredComponents(): Observable<RegisteredComponent>

Defined in utils/component.utils.ts:84

Returns: Observable<RegisteredComponent>

_getSelector

_getSelector(aSelector: string | Type<any> | null | undefined): string | undefined

Defined in utils/component.utils.ts:123

Parameters:

NameType
aSelectorstring | Type<any> | null | undefined

Returns: string | undefined

_getSelectors

_getSelectors(aSelector: string | string[] | Type<any> | null | undefined): string[]

Defined in utils/component.utils.ts:148

Parameters:

NameType
aSelectorstring | string[] | Type<any> | null | undefined

Returns: string[]

_pluckSelector

_pluckSelector(aMetadata: any): any

Defined in utils/component.utils.ts:113

Extracts the selector

Parameters:

NameTypeDescription
aMetadataanymetadata

Returns: any the selector

_registerComponent

_registerComponent(aDirective: LayoutComponentDirective, aType: Type<any>): void

Defined in utils/component.utils.ts:88

Parameters:

NameType
aDirectiveLayoutComponentDirective
aTypeType<any>

Returns: void

@ibm-wch-sdk/ng > "utils/http.service"

External module: "utils/http.service"

Index

Variables

Variables

<Const> HTTP_SERVICE

● HTTP_SERVICE: InjectionToken<HttpService> = new InjectionToken(LOGGER)

Defined in utils/http.service.ts:7

<Const> LOGGER

● LOGGER: "HttpService" = "HttpService"

Defined in utils/http.service.ts:5

@ibm-wch-sdk/ng > "utils/http.service.on.http"

External module: "utils/http.service.on.http"

Index

Variables

Functions

Variables

<Const> HTTP_SERVICE_ON_HTTP

● HTTP_SERVICE_ON_HTTP: InjectionToken<HttpService> = new InjectionToken(LOGGER)

Defined in utils/http.service.on.http.ts:12

<Const> LOGGER

● LOGGER: "HttpServiceOnHttp" = "HttpServiceOnHttp"

Defined in utils/http.service.on.http.ts:10

Functions

createHttpServiceOnHttp

createHttpServiceOnHttp(aHttp: Http): HttpService

Defined in utils/http.service.on.http.ts:22

Creates an http service on top of the (deprecated) http client

deprecated: use createHttpServiceOnHttpClient instead

Parameters:

NameTypeDescription
aHttpHttpthe http angular service

Returns: HttpService the created service

@ibm-wch-sdk/ng > "utils/http.service.on.http.client"

External module: "utils/http.service.on.http.client"

Index

Variables

Functions

Variables

<Const> HTTP_SERVICE_ON_HTTP_CLIENT

● HTTP_SERVICE_ON_HTTP_CLIENT: InjectionToken<HttpService> = new InjectionToken(LOGGER)

Defined in utils/http.service.on.http.client.ts:11

<Const> LOGGER

● LOGGER: "HttpServiceOnHttpClient" = "HttpServiceOnHttpClient"

Defined in utils/http.service.on.http.client.ts:9

Functions

createHttpServiceOnHttpClient

createHttpServiceOnHttpClient(aHttp: HttpClient): HttpService

Defined in utils/http.service.on.http.client.ts:19

Implements the {@link HttpService} interface on top of the {@link HttpClient} interface.

Parameters:

NameTypeDescription
aHttpHttpClientthe client

Returns: HttpService service implementation

@ibm-wch-sdk/ng > "utils/http.service.on.jsonp"

External module: "utils/http.service.on.jsonp"

Index

Interfaces

Variables

Functions

Variables

<Const> HTTP_SERVICE_ON_JSONP

● HTTP_SERVICE_ON_JSONP: InjectionToken<HttpService> = new InjectionToken(LOGGER)

Defined in utils/http.service.on.jsonp.ts:14

<Const> JSONP_CALLBACK

● JSONP_CALLBACK: "callback=JSONP_CALLBACK" = "callback=JSONP_CALLBACK"

Defined in utils/http.service.on.jsonp.ts:16

<Const> LOGGER

● LOGGER: "HttpServiceOnJsonp" = "HttpServiceOnJsonp"

Defined in utils/http.service.on.jsonp.ts:12

<Const> _JSONP_CALLBACK_PREFIX

● _JSONP_CALLBACK_PREFIX: string = ${_MODULE_NAME}.jsonp.callback.

Defined in utils/http.service.on.jsonp.ts:20

<Const> _MODULE_NAME

● _MODULE_NAME: "WchSdk" = Sdk.MODULE_NAME

Defined in utils/http.service.on.jsonp.ts:19

<Const> _assertInAngularZone

● _assertInAngularZone: assertInAngularZone = NgZone.assertInAngularZone

Defined in utils/http.service.on.jsonp.ts:47

expect to run in an Angular zone

<Const> _assertNotInAngularZone

● _assertNotInAngularZone: assertNotInAngularZone = NgZone.assertNotInAngularZone

Defined in utils/http.service.on.jsonp.ts:42

expect to NOT run in an Angular zone

Functions

_addCallback

_addCallback(aUrl: string): string

Defined in utils/http.service.on.jsonp.ts:206

Adds the JSONP callback parameter to the URL

Parameters:

NameTypeDescription
aUrlstringthe URL

Returns: string the callback

_removeNode

_removeNode(aNode: HTMLScriptElement): void

Defined in utils/http.service.on.jsonp.ts:27

Parameters:

NameType
aNodeHTMLScriptElement

Returns: void

_sendRequest

_sendRequest<T>(aUrl: string, aDoc: Document, aScope: any, aPending: PendingRequests): Observable<T>

Defined in utils/http.service.on.jsonp.ts:59

Type parameters:

T

Parameters:

NameType
aUrlstring
aDocDocument
aScopeany
aPendingPendingRequests

Returns: Observable<T>

createHttpServiceOnJsonp

createHttpServiceOnJsonp(aDoc: Document, aScope: any, aZoneService: ZoneService): HttpService

Defined in utils/http.service.on.jsonp.ts:226

Implements the {@link HttpService} interface via JSONP requests.

Parameters:

NameTypeDescription
aDocDocumentthe document
aScopeanythe SDK scope
aZoneServiceZoneService

Returns: HttpService service implementation

@ibm-wch-sdk/ng > "utils/js.utils"

External module: "utils/js.utils"

Index

Variables

Functions

Variables

<Const> KEY_DEBUG

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

Defined in utils/js.utils.ts:8

<Const> _assign

● _assign: assign = Object.assign

Defined in utils/js.utils.ts:10

<Const> _defineProperties

● _defineProperties: defineProperties = Object.defineProperties

Defined in utils/js.utils.ts:11

<Const> _false

● _false: false = false

Defined in utils/js.utils.ts:21

<Const> _getPrototype

● _getPrototype: getPrototypeOf = Object.getPrototypeOf

Defined in utils/js.utils.ts:93

<Const> _keys

● _keys: keys = Object.keys

Defined in utils/js.utils.ts:26

<Const> _true

● _true: true = true

Defined in utils/js.utils.ts:16

<Const> opDistinctComponentTypeRef

● opDistinctComponentTypeRef: MonoTypeOperatorFunction<ComponentTypeRef<any>> = distinctUntilChanged(_isEqualComponentTypeRef)

Defined in utils/js.utils.ts:128

Functions

_concatArguments

_concatArguments(aDst: any[], aArgs: IArguments): any[]

Defined in utils/js.utils.ts:84

Parameters:

NameType
aDstany[]
aArgsIArguments

Returns: any[]

_getClassName

_getClassName(aThis: any, aDefault?: string): string

Defined in utils/js.utils.ts:101

Tries to decode the classname

Parameters:

NameTypeDescription
aThisanythe instance pointer
Optional aDefaultstringdefault name

Returns: string

_isEqualComponentTypeRef

_isEqualComponentTypeRef(aLeft: ComponentTypeRef<any>, aRight: ComponentTypeRef<any>): boolean

Defined in utils/js.utils.ts:118

Parameters:

NameType
aLeftComponentTypeRef<any>
aRightComponentTypeRef<any>

Returns: boolean

_perfCloneDeep

_perfCloneDeep(aValue: any): any

Defined in utils/js.utils.ts:33

Parameters:

NameType
aValueany

Returns: any

_perfDeepEquals

_perfDeepEquals(aLeft: any, aRight: any): boolean

Defined in utils/js.utils.ts:66

Parameters:

NameType
aLeftany
aRightany

Returns: boolean

_perfFreezeDeep

_perfFreezeDeep(aValue: any): any

Defined in utils/js.utils.ts:49

Parameters:

NameType
aValueany

Returns: any

@ibm-wch-sdk/ng > "utils/lazy.injector"

External module: "utils/lazy.injector"

Index

Functions

Functions

lazyInjector

lazyInjector<T,R>(aInjector: Injector, aToken: any, aDefault?: T, aTransform?: UnaryFunction<T, R>): Generator<R>

Defined in utils/lazy.injector.ts:14

Performs a lazy lookup of a dependency via an injector

Type parameters:

T

R

Parameters:

NameTypeDescription
aInjectorInjectorthe injector
aTokenanythe token
Optional aDefaultTan optional default of fallback token
Optional aTransformUnaryFunction<T, R>

Returns: Generator<R> lazy injection result

@ibm-wch-sdk/ng > "utils/markup.utils"

External module: "utils/markup.utils"

Index

Interfaces

Variables

Functions

Variables

<Const> LOGGER

● LOGGER: "MarkupUtils" = "MarkupUtils"

Defined in utils/markup.utils.ts:8

Functions

_addMarkup

_addMarkup(aRenderingContext: RenderingContext, aMapping: MarkupMapping, aProviders: MarkupProviders): void

Defined in utils/markup.utils.ts:91

Parameters:

NameType
aRenderingContextRenderingContext
aMappingMarkupMapping
aProvidersMarkupProviders

Returns: void

_defineAccessor

_defineAccessor(aRenderingContext: RenderingContext, aHandlebarsMarkup: Markup, aOptions?: any): void

Defined in utils/markup.utils.ts:32

Parameters:

NameType
aRenderingContextRenderingContext
aHandlebarsMarkupMarkup
Optional aOptionsany

Returns: void

_defineAccessors

_defineAccessors(aRenderingContext: RenderingContext, aHandlebarsMarkup: Markup[], aOptions?: any): void

Defined in utils/markup.utils.ts:71

Parameters:

NameType
aRenderingContextRenderingContext
aHandlebarsMarkupMarkup[]
Optional aOptionsany

Returns: void

_emptyMarkupMapping

_emptyMarkupMapping(): MarkupMapping

Defined in utils/markup.utils.ts:84

Returns: MarkupMapping

@ibm-wch-sdk/ng > "utils/page.utils"

External module: "utils/page.utils"

Index

Variables

Functions

Variables

<Const> _ReplaySubject

● _ReplaySubject: ReplaySubject = ReplaySubject

Defined in utils/page.utils.ts:6

<Const> pageSubject

● pageSubject: ReplaySubject<RenderingContext> = new _ReplaySubject(1)

Defined in utils/page.utils.ts:9

Functions

_disposeActivePage

_disposeActivePage(): void

Defined in utils/page.utils.ts:19

Returns: void

_getActivePage

_getActivePage(): Observable<RenderingContext>

Defined in utils/page.utils.ts:11

Returns: Observable<RenderingContext>

_setActivePage

_setActivePage(aRenderingContext: RenderingContext): void

Defined in utils/page.utils.ts:15

Parameters:

NameType
aRenderingContextRenderingContext

Returns: void

@ibm-wch-sdk/ng > "utils/rx.utils"

External module: "utils/rx.utils"

Index

Classes

Interfaces

Functions

Functions

_completeLater

_completeLater<T>(aSubject: Subject<T>): function

Defined in utils/rx.utils.ts:15

Constructs a callback function that completes the subject and then unsubscribes all pending subscriptions

Type parameters:

T

Parameters:

NameTypeDescription
aSubjectSubject<T>the subject

Returns: function the callback

_createLater

_createLater<K,O,T>(aGenerator: function): function

Defined in utils/rx.utils.ts:108

Produces a value at a later point in time on top of a generator

Type parameters:

K

O

T

Parameters:

NameTypeDescription
aGeneratorfunctionthe generator function

Returns: function a function that takes a parameter and generates an observable based on the result

_createZoneSchedulers

_createZoneSchedulers(aZone: NgZone, aDelegate?: SchedulerLike): ZoneSchedulers

Defined in utils/rx.utils.ts:86

Parameters:

NameType
aZoneNgZone
Optional aDelegateSchedulerLike

Returns: ZoneSchedulers

_distinctSubject

_distinctSubject<T>(aSubject: Subject<T>): Observable<T>

Defined in utils/rx.utils.ts:96

Type parameters:

T

Parameters:

NameType
aSubjectSubject<T>

Returns: Observable<T>

_unsubscribeLater

_unsubscribeLater(aSubscription: Subscription | null | undefined): function

Defined in utils/rx.utils.ts:25

Parameters:

NameType
aSubscriptionSubscription | null | undefined

Returns: function

@ibm-wch-sdk/ng > "utils/site.utils"

External module: "utils/site.utils"

Index

Functions

Functions

_getPathFromUrlSegments

_getPathFromUrlSegments(aSegments: UrlSegment[]): string

Defined in utils/site.utils.ts:12

Constructs the URL path based on the segemnets

Parameters:

NameTypeDescription
aSegmentsUrlSegment[]the segments

Returns: string the path

@ibm-wch-sdk/ng > "utils/symbol"

External module: "utils/symbol"

Index

Variables

Variables

<Const> createSymbol

● createSymbol: Generator<symbol | string> = typeof Symbol === UNDEFINED_TYPE ? hashRandomIdentifier : Symbol

Defined in utils/symbol.ts:9

Creates a unique symbol, either as a real symbol or as a random string if symbols are not available.

returns: the unique symbol

@ibm-wch-sdk/ng > "utils/url.utils"

External module: "utils/url.utils"

Index

Variables

Functions

Variables

<Const> decode

● decode: decodeURIComponent = decodeURIComponent

Defined in utils/url.utils.ts:10

Functions

_createBaseURL

_createBaseURL(aUrl: URL | string): string

Defined in utils/url.utils.ts:12

Parameters:

NameType
aUrlURL | string

Returns: string

_ensureTrailingSlash

_ensureTrailingSlash(aUrl: string): string

Defined in utils/url.utils.ts:6

Parameters:

NameType
aUrlstring

Returns: string

@ibm-wch-sdk/ng > "utils/url.utils.ifaces"

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

Index

Type aliases

Type aliases

QueryInput

Ƭ QueryInput: string | string[] | null | undefined | URLSearchParams | Query | HttpParams

Defined in utils/url.utils.ifaces.ts:7

@ibm-wch-sdk/ng > "utils/urls"

External module: "utils/urls"

Index

Variables

Variables

<Const> BFF_BASE_URL

● BFF_BASE_URL: Observable<string> = USE_PUBLIC_URL.pipe( map<boolean, string>(bFlag => bFlag ? BFF_PUBLIC_URL : BFF_SECURE_URL), distinctUntilChanged(), opShareLast )

Defined in 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

<Const> BFF_PUBLIC_URL

● BFF_PUBLIC_URL: "delivery/v1/rendering/" = "delivery/v1/rendering/"

Defined in utils/urls.ts:8

<Const> BFF_SECURE_URL

● BFF_SECURE_URL: "mydelivery/v1/rendering/" = "mydelivery/v1/rendering/"

Defined in utils/urls.ts:9

<Const> DEFAULT_PUBLIC_URL

● DEFAULT_PUBLIC_URL: true = true

Defined in utils/urls.ts:7

<Const> USE_PUBLIC_URL

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

Defined in utils/urls.ts:12

@ibm-wch-sdk/ng > "utils/wch.utils"

External module: "utils/wch.utils"

Index

Variables

Functions

Variables

<Const> KEY_ON_LAYOUT_MODE

● KEY_ON_LAYOUT_MODE: "onLayoutMode" = "onLayoutMode"

Defined in utils/wch.utils.ts:12

<Const> KEY_ON_RENDERING_CONTEXT

● KEY_ON_RENDERING_CONTEXT: "onRenderingContext" = "onRenderingContext"

Defined in utils/wch.utils.ts:11

<Const> LOGGER

● LOGGER: "WchUtils" = "WchUtils"

Defined in utils/wch.utils.ts:9

Functions

_getAppBaseHref

_getAppBaseHref(aBaseUrl?: HubInfoUrlProvider, aDoc?: Document): string

Defined in utils/wch.utils.ts:52

Decodes the base href of the application from the config or the doc fallback

Parameters:

NameTypeDescription
Optional aBaseUrlHubInfoUrlProviderthe optional base URL
Optional aDocDocumentthe document

Returns: string the path prefix that is supposed to be recognized as URLs

_getAppBaseURL

_getAppBaseURL(aBaseUrl?: HubInfoUrlProvider, aDoc?: Document): string

Defined in utils/wch.utils.ts:34

Decodes the base href of the application from the config or the doc fallback

Parameters:

NameTypeDescription
Optional aBaseUrlHubInfoUrlProviderthe optional base URL
Optional aDocDocumentthe document

Returns: string the path prefix that is supposed to be recognized as URLs

_getPrefix

_getPrefix(aUrl: string): string

Defined in utils/wch.utils.ts:20

Decodes the path prefix from the URL that is the starting segment

Parameters:

NameTypeDescription
aUrlstringthe potentially absolute URL

Returns: string the path prefix

_getRenderingContextURL

_getRenderingContextURL(aID: string): Observable<string>

Defined in utils/wch.utils.ts:66

Parameters:

NameType
aIDstring

Returns: Observable<string>

_getSiteURL

_getSiteURL(): Observable<string>

Defined in utils/wch.utils.ts:77

Returns: Observable<string>

@ibm-wch-sdk/ng > "version"

External module: "version"

Index

Object literals

Object literals

<Const> VERSION

VERSION: object

Defined in version.ts:1

build

● build: string = "01a021c9-8427-4cdd-bdd1-18ad1dda695d"

Defined in version.ts:3

version

● version: string = "f507579f-a7b0-4d70-9027-87aa5e35b020"

Defined in version.ts:2

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 module.

HubInfoService

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

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.
  • useApi?: If enabled the system will load site data and content items from the WCH REST APIs. When disabled it will only use one of the methods mentioned above. Defaults to true. Setting it to false is not recommended for production scenarios, but rather for testing, e.g. performance testing.
  • 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.

Tipps

When maintaining a wchtools data folder with your application, this folder already has a .wchtoolsoptions.json file that contains the API URL. We recommend to read this file and initialize the environment variables from that source, to avoid duplication.

Declare the .wchtoolsoptions.json files as a modulein the typings.d.ts file, e.g. like this:

declare module '*/.wchtoolsoptions.json' {
  const value: any;
  export default value;
}

In your environment.ts read the module, e.g. like this:

import * as OPTIONS from './../../data/.wchtoolsoptions.json';

export const environment = {
  production: false,
  apiUrl: OPTIONS['x-ibm-dx-tenant-base-url'],
  httpOptions: { pollTime: 10 * 20 * 1000 },
  httpPreviewOptions: { pollTime: 10 * 1000 }
};

Note that it is sufficient to specify the apiUrl property, the matching deliveryUrl property will be derived from it, automatically.

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.

Injection Tokens

Although the typical way to configure the WchNgModule is via its forRoot method, all configuration options are handled as tokens of the dependency injector. This makes it possible to configure individual aspects on a granular level. The injection tokens are:

  • WCH_TOKEN_API_URL
  • WCH_TOKEN_DELIVERY_URL
  • WCH_TOKEN_BASE_URL
  • WCH_TOKEN_HTTP_OPTIONS
  • WCH_TOKEN_HTTP_PREVIEW_OPTIONS
  • WCH_TOKEN_CYCLE_HANDLING_STRATEGY
  • WCH_TOKEN_FETCH_LEVELS

Modules

The SDK splits its functionality into a module that provides services and one that provides components and directives.

WchNgServiceModule

The service module exposes services.

WchNgComponentsModule

The component module defines components and directives. Import this module from other modules that contain UI artifacts.

Common Interfaces

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

  • DEFAULT_LAYOUT: name of the component rendered if the layout cannot be resolved
  • PAGE_NOT_FOUND_LAYOUT: name of the component rendered if the page cannot be resolved

@ibm-wch-sdk/ng

Index

External modules

@ibm-wch-sdk/ng > "components/content/content.component" > ContentComponent

Class: ContentComponent

Hierarchy

AbstractLifeCycleComponent

↳ ContentComponent

Implements

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

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ContentComponent(aWchService: WchService): ContentComponent

Defined in components/content/content.component.ts:81

Parameters:

NameType
aWchServiceWchService

Returns: ContentComponent

Properties

id

● id: string

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

layoutMode

● layoutMode: string

Defined in components/content/content.component.ts:52

levels

● levels: string | number | null | undefined

Defined in components/content/content.component.ts:58

onComponent

● onComponent: ReplaySubject<any> = createSingleSubject()

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

onLayoutMode

● onLayoutMode: Observable<string>

Defined in components/content/content.component.ts:76

onRenderingContext

● onRenderingContext: Observable<RenderingContext>

Defined in components/content/content.component.ts:64

onState

● onState: Observable<ComponentState>

Defined in components/content/content.component.ts:81

The component state

Accessors

<Protected> onAfterContentChecked

get onAfterContentChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:307

see: AfterContentChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterContentInit

get onAfterContentInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentInit

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

see: AfterContentInit

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewChecked

get onAfterViewChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:291

see: AfterViewChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewInit

get onAfterViewInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:299

see: AfterViewInit

Returns: Observable<void> the observable representation of this callback

<Protected> onDoCheck

get onDoCheck(): Observable<void>

Inherited from AbstractLifeCycleComponent.onDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:323

see: DoCheck

Returns: Observable<void> the observable representation of this callback

<Protected> onOnChanges

get onOnChanges(): Observable<SimpleChanges>

Inherited from AbstractLifeCycleComponent.onOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:331

see: OnChanges

Returns: Observable<SimpleChanges> the observable representation of this callback

<Protected> onOnDestroy

get onOnDestroy(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnDestroy

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

see: OnDestroy

Returns: Observable<void> the observable representation of this callback

<Protected> onOnInit

get onOnInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:339

see: OnInit

Returns: Observable<void> the observable representation of this callback

Methods

<Protected> describeSetter

describeSetter<T>(aSubject: Subject<T>): PropertyDescriptor

Inherited from AbstractLifeCycleComponent.describeSetter

Defined in components/rendering/abstract.lifecycle.component.ts:374

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.

deprecated: use createSetter instead

Type parameters:

T

Parameters:

NameTypeDescription
aSubjectSubject<T>the subject

Returns: PropertyDescriptor the property descriptor

ngAfterContentChecked

ngAfterContentChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:241

see: AfterContentChecked

override:

Returns: void

ngAfterContentInit

ngAfterContentInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentInit

Defined in components/rendering/abstract.lifecycle.component.ts:249

see: AfterContentInit

override:

Returns: void

ngAfterViewChecked

ngAfterViewChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:225

see: AfterViewChecked

override:

Returns: void

ngAfterViewInit

ngAfterViewInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:233

see: AfterViewInit

override:

Returns: void

ngDoCheck

ngDoCheck(): void

Inherited from AbstractLifeCycleComponent.ngDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:257

see: DoCheck

override:

Returns: void

ngOnChanges

ngOnChanges(changes: SimpleChanges): void

Inherited from AbstractLifeCycleComponent.ngOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:265

see: OnChanges

override:

Parameters:

NameType
changesSimpleChanges

Returns: void

ngOnDestroy

ngOnDestroy(): void

Overrides AbstractLifeCycleComponent.ngOnDestroy

Defined in components/content/content.component.ts:154

Returns: void

ngOnInit

ngOnInit(): void

Inherited from AbstractLifeCycleComponent.ngOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:273

see: OnInit

override:

Returns: void

safeSubscribe

safeSubscribe<T>(aObservable: Subscribable<T>, aObserver?: PartialObserver<T> | function | string, error?: function, complete?: function): void

Inherited from AbstractLifeCycleComponent.safeSubscribe

Defined in components/rendering/abstract.lifecycle.component.ts:393

Subscribes to an observable and makes sure to clean the subscription in ngOnDestroy to avoid memory leaks.

deprecated: use takeUntil(onOnDestroy) instead

Type parameters:

T

Parameters:

NameTypeDescription
aObservableSubscribable<T>the observable to subscribe to
Optional aObserverPartialObserver<T> | function | stringthe handler. If this value is a 'string', then the subscription will automatically update the respective property on the instance.
Optional errorfunctionoptional error handler
Optional completefunctionoptional completion handler

Returns: void

<Protected> unsubscribeOnDestroy

unsubscribeOnDestroy(aSubscription: Subscription): void

Inherited from AbstractLifeCycleComponent.unsubscribeOnDestroy

Defined in components/rendering/abstract.lifecycle.component.ts:359

Unsubscribes the given subscription in the ngOnDestroy method. This method exists for convenience only, consider to use the {@link #safeSubscribe} method instead.

deprecated: use takeUntil(onOnDestroy) instead

Parameters:

NameTypeDescription
aSubscriptionSubscriptionthe subscription to unsubscribe on

Returns: void

@ibm-wch-sdk/ng > "components/contentquery/contentquery.component" > ContentQueryComponent

Class: ContentQueryComponent

Hierarchy

AbstractLifeCycleComponent

↳ ContentQueryComponent

Implements

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

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ContentQueryComponent(aRenderer: Renderer2, aElement: ElementRef, aWchService: WchService): ContentQueryComponent

Defined in components/contentquery/contentquery.component.ts:82

Parameters:

NameType
aRendererRenderer2
aElementElementRef
aWchServiceWchService

Returns: ContentQueryComponent

Properties

layoutMode

● layoutMode: string

Defined in components/contentquery/contentquery.component.ts:57

levels

● levels: string | number | null | undefined

Defined in components/contentquery/contentquery.component.ts:67

onLayoutMode

● onLayoutMode: Observable<string>

Defined in components/contentquery/contentquery.component.ts:72

onNumFound

● onNumFound: Observable<number>

Defined in components/contentquery/contentquery.component.ts:82

onRenderingContexts

● onRenderingContexts: Observable<RenderingContext[]>

Defined in components/contentquery/contentquery.component.ts:77

query

● query: QueryInput

Defined in components/contentquery/contentquery.component.ts:62

Accessors

<Protected> onAfterContentChecked

get onAfterContentChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:307

see: AfterContentChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterContentInit

get onAfterContentInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentInit

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

see: AfterContentInit

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewChecked

get onAfterViewChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:291

see: AfterViewChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewInit

get onAfterViewInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:299

see: AfterViewInit

Returns: Observable<void> the observable representation of this callback

<Protected> onDoCheck

get onDoCheck(): Observable<void>

Inherited from AbstractLifeCycleComponent.onDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:323

see: DoCheck

Returns: Observable<void> the observable representation of this callback

<Protected> onOnChanges

get onOnChanges(): Observable<SimpleChanges>

Inherited from AbstractLifeCycleComponent.onOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:331

see: OnChanges

Returns: Observable<SimpleChanges> the observable representation of this callback

<Protected> onOnDestroy

get onOnDestroy(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnDestroy

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

see: OnDestroy

Returns: Observable<void> the observable representation of this callback

<Protected> onOnInit

get onOnInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:339

see: OnInit

Returns: Observable<void> the observable representation of this callback

Methods

<Protected> describeSetter

describeSetter<T>(aSubject: Subject<T>): PropertyDescriptor

Inherited from AbstractLifeCycleComponent.describeSetter

Defined in components/rendering/abstract.lifecycle.component.ts:374

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.

deprecated: use createSetter instead

Type parameters:

T

Parameters:

NameTypeDescription
aSubjectSubject<T>the subject

Returns: PropertyDescriptor the property descriptor

ngAfterContentChecked

ngAfterContentChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:241

see: AfterContentChecked

override:

Returns: void

ngAfterContentInit

ngAfterContentInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentInit

Defined in components/rendering/abstract.lifecycle.component.ts:249

see: AfterContentInit

override:

Returns: void

ngAfterViewChecked

ngAfterViewChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:225

see: AfterViewChecked

override:

Returns: void

ngAfterViewInit

ngAfterViewInit(): void

Overrides AbstractLifeCycleComponent.ngAfterViewInit

Defined in components/contentquery/contentquery.component.ts:195

Returns: void

ngDoCheck

ngDoCheck(): void

Inherited from AbstractLifeCycleComponent.ngDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:257

see: DoCheck

override:

Returns: void

ngOnChanges

ngOnChanges(changes: SimpleChanges): void

Inherited from AbstractLifeCycleComponent.ngOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:265

see: OnChanges

override:

Parameters:

NameType
changesSimpleChanges

Returns: void

ngOnDestroy

ngOnDestroy(): void

Overrides AbstractLifeCycleComponent.ngOnDestroy

Defined in components/contentquery/contentquery.component.ts:200

Returns: void

ngOnInit

ngOnInit(): void

Inherited from AbstractLifeCycleComponent.ngOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:273

see: OnInit

override:

Returns: void

safeSubscribe

safeSubscribe<T>(aObservable: Subscribable<T>, aObserver?: PartialObserver<T> | function | string, error?: function, complete?: function): void

Inherited from AbstractLifeCycleComponent.safeSubscribe

Defined in components/rendering/abstract.lifecycle.component.ts:393

Subscribes to an observable and makes sure to clean the subscription in ngOnDestroy to avoid memory leaks.

deprecated: use takeUntil(onOnDestroy) instead

Type parameters:

T

Parameters:

NameTypeDescription
aObservableSubscribable<T>the observable to subscribe to
Optional aObserverPartialObserver<T> | function | stringthe handler. If this value is a 'string', then the subscription will automatically update the respective property on the instance.
Optional errorfunctionoptional error handler
Optional completefunctionoptional completion handler

Returns: void

<Protected> unsubscribeOnDestroy

unsubscribeOnDestroy(aSubscription: Subscription): void

Inherited from AbstractLifeCycleComponent.unsubscribeOnDestroy

Defined in components/rendering/abstract.lifecycle.component.ts:359

Unsubscribes the given subscription in the ngOnDestroy method. This method exists for convenience only, consider to use the {@link #safeSubscribe} method instead.

deprecated: use takeUntil(onOnDestroy) instead

Parameters:

NameTypeDescription
aSubscriptionSubscriptionthe subscription to unsubscribe on

Returns: void

@ibm-wch-sdk/ng > "components/contentref/contentref.component" > ContentrefComponent

Class: ContentrefComponent

Hierarchy

AbstractRenderingComponent

↳ ContentrefComponent

Implements

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

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ContentrefComponent(aCmp: ComponentsService, aMapping: LayoutMappingService, aWchService: WchService): ContentrefComponent

Overrides AbstractRenderingComponent.constructor

Defined in components/contentref/contentref.component.ts:122

Parameters:

NameType
aCmpComponentsService
aMappingLayoutMappingService
aWchServiceWchService

Returns: ContentrefComponent

Properties

<Protected> _id

● _id: string

Inherited from AbstractRenderingComponent._id

Defined in components/rendering/abstract-rendering.component.ts:34

<Optional> cycleHandlingStrategy

● cycleHandlingStrategy: CYCLE_HANDLING | string

Defined in components/contentref/contentref.component.ts:97

layoutMode

● layoutMode: string

Overrides AbstractRenderingComponent.layoutMode

Defined in components/contentref/contentref.component.ts:107

onComponent

● onComponent: ReplaySubject<any> = createSingleSubject()

Defined in components/contentref/contentref.component.ts:112

Output that will be triggered when a new component was created

onLayoutMode

● onLayoutMode: Observable<string>

Inherited from AbstractRenderingComponent.onLayoutMode

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

onRenderingContext

● onRenderingContext: Observable<RenderingContext>

Inherited from AbstractRenderingComponent.onRenderingContext

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

onState

● onState: Observable<ComponentState>

Defined in components/contentref/contentref.component.ts:122

The component state

onType

● onType: Observable<ComponentTypeRef<any>>

Defined in components/contentref/contentref.component.ts:117

The current type to render

renderingContext

● renderingContext: RenderingContext

Overrides AbstractRenderingComponent.renderingContext

Defined in components/contentref/contentref.component.ts:102

Accessors

<Protected> context

get context(): Observable<RenderingContext>

Inherited from AbstractRenderingComponent.context

Defined in components/rendering/abstract-rendering.component.ts:141

Returns: Observable<RenderingContext>

<Protected> onAfterContentChecked

get onAfterContentChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:307

see: AfterContentChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterContentInit

get onAfterContentInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentInit

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

see: AfterContentInit

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewChecked

get onAfterViewChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:291

see: AfterViewChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewInit

get onAfterViewInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:299

see: AfterViewInit

Returns: Observable<void> the observable representation of this callback

<Protected> onDoCheck

get onDoCheck(): Observable<void>

Inherited from AbstractLifeCycleComponent.onDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:323

see: DoCheck

Returns: Observable<void> the observable representation of this callback

<Protected> onOnChanges

get onOnChanges(): Observable<SimpleChanges>

Inherited from AbstractLifeCycleComponent.onOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:331

see: OnChanges

Returns: Observable<SimpleChanges> the observable representation of this callback

<Protected> onOnDestroy

get onOnDestroy(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnDestroy

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

see: OnDestroy

Returns: Observable<void> the observable representation of this callback

<Protected> onOnInit

get onOnInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:339

see: OnInit

Returns: Observable<void> the observable representation of this callback

Methods

<Protected> describeSetter

describeSetter<T>(aSubject: Subject<T>): PropertyDescriptor

Inherited from AbstractLifeCycleComponent.describeSetter

Defined in components/rendering/abstract.lifecycle.component.ts:374

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.

deprecated: use createSetter instead

Type parameters:

T

Parameters:

NameTypeDescription
aSubjectSubject<T>the subject

Returns: PropertyDescriptor the property descriptor

ngAfterContentChecked

ngAfterContentChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:241

see: AfterContentChecked

override:

Returns: void

ngAfterContentInit

ngAfterContentInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentInit

Defined in components/rendering/abstract.lifecycle.component.ts:249

see: AfterContentInit

override:

Returns: void

ngAfterViewChecked

ngAfterViewChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:225

see: AfterViewChecked

override:

Returns: void

ngAfterViewInit

ngAfterViewInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:233

see: AfterViewInit

override:

Returns: void

ngDoCheck

ngDoCheck(): void

Inherited from AbstractLifeCycleComponent.ngDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:257

see: DoCheck

override:

Returns: void

ngOnChanges

ngOnChanges(changes: SimpleChanges): void

Inherited from AbstractLifeCycleComponent.ngOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:265

see: OnChanges

override:

Parameters:

NameType
changesSimpleChanges

Returns: void

ngOnDestroy

ngOnDestroy(): void

Overrides AbstractRenderingComponent.ngOnDestroy

Defined in components/contentref/contentref.component.ts:184

Returns: void

ngOnInit

ngOnInit(): void

Inherited from AbstractLifeCycleComponent.ngOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:273

see: OnInit

override:

Returns: void

safeSubscribe

safeSubscribe<T>(aObservable: Subscribable<T>, aObserver?: PartialObserver<T> | function | string, error?: function, complete?: function): void

Inherited from AbstractLifeCycleComponent.safeSubscribe

Defined in components/rendering/abstract.lifecycle.component.ts:393

Subscribes to an observable and makes sure to clean the subscription in ngOnDestroy to avoid memory leaks.

deprecated: use takeUntil(onOnDestroy) instead

Type parameters:

T

Parameters:

NameTypeDescription
aObservableSubscribable<T>the observable to subscribe to
Optional aObserverPartialObserver<T> | function | stringthe handler. If this value is a 'string', then the subscription will automatically update the respective property on the instance.
Optional errorfunctionoptional error handler
Optional completefunctionoptional completion handler

Returns: void

trackByComponentId

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

Inherited from AbstractRenderingComponent.trackByComponentId

Defined in components/rendering/abstract-rendering.component.ts:153

Parameters:

NameType
aIndexnumber
aRenderingContextRenderingContext

Returns: string

<Protected> unsubscribeOnDestroy

unsubscribeOnDestroy(aSubscription: Subscription): void

Inherited from AbstractLifeCycleComponent.unsubscribeOnDestroy

Defined in components/rendering/abstract.lifecycle.component.ts:359

Unsubscribes the given subscription in the ngOnDestroy method. This method exists for convenience only, consider to use the {@link #safeSubscribe} method instead.

deprecated: use takeUntil(onOnDestroy) instead

Parameters:

NameTypeDescription
aSubscriptionSubscriptionthe subscription to unsubscribe on

Returns: void

@ibm-wch-sdk/ng > "services/components/components.service" > ComponentsService

Class: ComponentsService

Hierarchy

ComponentsService

Implements

  • OnDestroy

Index

Constructors

Properties

Constructors

constructor

new ComponentsService(markupService: MarkupService): ComponentsService

Defined in services/components/components.service.ts:321

Parameters:

NameType
markupServiceMarkupService

Returns: ComponentsService

Properties

getTypeByLayout

● getTypeByLayout: function

Defined in services/components/components.service.ts:301

Type declaration

▸(aLayout: Layout, aLayoutMode?: string): Observable<ComponentTypeRef<any>>

Parameters:

NameType
aLayoutLayout
Optional aLayoutModestring

Returns: Observable<ComponentTypeRef<any>>

getTypeBySelector

● getTypeBySelector: function

Defined in services/components/components.service.ts:313

Type declaration

▸(aSelector: string, aLayoutMode?: string): Observable<ComponentTypeRef<any>>

Parameters:

NameType
aSelectorstring
Optional aLayoutModestring

Returns: Observable<ComponentTypeRef<any>>

ngOnDestroy

● ngOnDestroy: function

Defined in services/components/components.service.ts:321

Type declaration

▸(): void

Returns: void

registerType

● registerType: function

Defined in services/components/components.service.ts:288

Type declaration

▸(aController: string | string[], aType: ComponentTypeRef<any>, aLayoutModes?: string | string[]): void

Parameters:

NameType
aControllerstring | string[]
aTypeComponentTypeRef<any>
Optional aLayoutModesstring | string[]

Returns: void

<Static> DEFAULT_LAYOUT

● DEFAULT_LAYOUT: "wch-default-layout" = _DEFAULT_LAYOUT

Defined in services/components/components.service.ts:280

<Static> PAGE_NOT_FOUND_LAYOUT

● PAGE_NOT_FOUND_LAYOUT: "wch-404" = _PAGE_NOT_FOUND_LAYOUT

Defined in services/components/components.service.ts:285

@ibm-wch-sdk/ng > "services/mappings/mappings.service" > LayoutMappingService

Class: LayoutMappingService

Hierarchy

LayoutMappingService

Implements

  • OnDestroy

Index

Constructors

Properties

Constructors

constructor

new LayoutMappingService(): LayoutMappingService

Defined in services/mappings/mappings.service.ts:302

Returns: LayoutMappingService

Properties

getSelector

● getSelector: function

Defined in services/mappings/mappings.service.ts:294

Type declaration

▸(aLayoutMode: string, aRenderingContext: RenderingContext): string | undefined

Parameters:

NameType
aLayoutModestring
aRenderingContextRenderingContext

Returns: string | undefined

ngOnDestroy

● ngOnDestroy: function

Defined in services/mappings/mappings.service.ts:302

Type declaration

▸(): void

Returns: void

registerMapping

● registerMapping: function

Defined in services/mappings/mappings.service.ts:281

Type declaration

▸(aId: string | string[], aSelector: string | string[] | Type<any>, aLayoutMode?: string | string[]): void

Parameters:

NameType
aIdstring | string[]
aSelectorstring | string[] | Type<any>
Optional aLayoutModestring | string[]

Returns: void

@ibm-wch-sdk/ng > "components/default/default.component" > DefaultComponent

Class: DefaultComponent

Hierarchy

DefaultComponent

Index

@ibm-wch-sdk/ng > "components/page/page.component" > PageComponent

Class: PageComponent

Hierarchy

AbstractBaseComponent

↳ PageComponent

Implements

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

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

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

Overrides AbstractBaseComponent.constructor

Defined in components/page/page.component.ts:170

Parameters:

NameType
aRouteActivatedRoute
aWchServiceWchService
aTitleServiceTitle
aMetaServiceMeta

Returns: PageComponent

Properties

layoutMode

● layoutMode: string

Inherited from AbstractBaseComponent.layoutMode

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

onComponent

● onComponent: ReplaySubject<any> = createSingleSubject()

Defined in components/page/page.component.ts:165

onLayoutMode

● onLayoutMode: Observable<string>

Overrides AbstractBaseComponent.onLayoutMode

Defined in components/page/page.component.ts:154

onRenderingContext

● onRenderingContext: Observable<RenderingContext>

Overrides AbstractBaseComponent.onRenderingContext

Defined in components/page/page.component.ts:160

onState

● onState: Observable<ComponentState>

Defined in components/page/page.component.ts:170

The component state

Accessors

<Protected> onAfterContentChecked

get onAfterContentChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:307

see: AfterContentChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterContentInit

get onAfterContentInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentInit

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

see: AfterContentInit

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewChecked

get onAfterViewChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:291

see: AfterViewChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewInit

get onAfterViewInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:299

see: AfterViewInit

Returns: Observable<void> the observable representation of this callback

<Protected> onDoCheck

get onDoCheck(): Observable<void>

Inherited from AbstractLifeCycleComponent.onDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:323

see: DoCheck

Returns: Observable<void> the observable representation of this callback

<Protected> onOnChanges

get onOnChanges(): Observable<SimpleChanges>

Inherited from AbstractLifeCycleComponent.onOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:331

see: OnChanges

Returns: Observable<SimpleChanges> the observable representation of this callback

<Protected> onOnDestroy

get onOnDestroy(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnDestroy

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

see: OnDestroy

Returns: Observable<void> the observable representation of this callback

<Protected> onOnInit

get onOnInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:339

see: OnInit

Returns: Observable<void> the observable representation of this callback

Methods

<Protected> describeSetter

describeSetter<T>(aSubject: Subject<T>): PropertyDescriptor

Inherited from AbstractLifeCycleComponent.describeSetter

Defined in components/rendering/abstract.lifecycle.component.ts:374

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.

deprecated: use createSetter instead

Type parameters:

T

Parameters:

NameTypeDescription
aSubjectSubject<T>the subject

Returns: PropertyDescriptor the property descriptor

ngAfterContentChecked

ngAfterContentChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:241

see: AfterContentChecked

override:

Returns: void

ngAfterContentInit

ngAfterContentInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentInit

Defined in components/rendering/abstract.lifecycle.component.ts:249

see: AfterContentInit

override:

Returns: void

ngAfterViewChecked

ngAfterViewChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:225

see: AfterViewChecked

override:

Returns: void

ngAfterViewInit

ngAfterViewInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:233

see: AfterViewInit

override:

Returns: void

ngDoCheck

ngDoCheck(): void

Inherited from AbstractLifeCycleComponent.ngDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:257

see: DoCheck

override:

Returns: void

ngOnChanges

ngOnChanges(changes: SimpleChanges): void

Inherited from AbstractLifeCycleComponent.ngOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:265

see: OnChanges

override:

Parameters:

NameType
changesSimpleChanges

Returns: void

ngOnDestroy

ngOnDestroy(): void

Overrides AbstractLifeCycleComponent.ngOnDestroy

Defined in components/page/page.component.ts:217

Returns: void

ngOnInit

ngOnInit(): void

Inherited from AbstractLifeCycleComponent.ngOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:273

see: OnInit

override:

Returns: void

safeSubscribe

safeSubscribe<T>(aObservable: Subscribable<T>, aObserver?: PartialObserver<T> | function | string, error?: function, complete?: function): void

Inherited from AbstractLifeCycleComponent.safeSubscribe

Defined in components/rendering/abstract.lifecycle.component.ts:393

Subscribes to an observable and makes sure to clean the subscription in ngOnDestroy to avoid memory leaks.

deprecated: use takeUntil(onOnDestroy) instead

Type parameters:

T

Parameters:

NameTypeDescription
aObservableSubscribable<T>the observable to subscribe to
Optional aObserverPartialObserver<T> | function | stringthe handler. If this value is a 'string', then the subscription will automatically update the respective property on the instance.
Optional errorfunctionoptional error handler
Optional completefunctionoptional completion handler

Returns: void

<Protected> unsubscribeOnDestroy

unsubscribeOnDestroy(aSubscription: Subscription): void

Inherited from AbstractLifeCycleComponent.unsubscribeOnDestroy

Defined in components/rendering/abstract.lifecycle.component.ts:359

Unsubscribes the given subscription in the ngOnDestroy method. This method exists for convenience only, consider to use the {@link #safeSubscribe} method instead.

deprecated: use takeUntil(onOnDestroy) instead

Parameters:

NameTypeDescription
aSubscriptionSubscriptionthe subscription to unsubscribe on

Returns: void

@ibm-wch-sdk/ng > "components/pageref/pageref.component" > PagerefComponent

Class: PagerefComponent

Hierarchy

AbstractLifeCycleComponent

↳ PagerefComponent

Implements

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

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

new PagerefComponent(aWchService: WchService): PagerefComponent

Defined in components/pageref/pageref.component.ts:73

Parameters:

NameType
aWchServiceWchService

Returns: PagerefComponent

Properties

layoutMode

● layoutMode: string

Defined in components/pageref/pageref.component.ts:48

levels

● levels: string | number | null | undefined

Defined in components/pageref/pageref.component.ts:53

onComponent

● onComponent: ReplaySubject<any> = createSingleSubject()

Defined in components/pageref/pageref.component.ts:63

onLayoutMode

● onLayoutMode: Observable<string>

Defined in components/pageref/pageref.component.ts:68

onRenderingContext

● onRenderingContext: Observable<RenderingContext>

Defined in components/pageref/pageref.component.ts:58

onState

● onState: Observable<ComponentState>

Defined in components/pageref/pageref.component.ts:73

The component state

sitePage

● sitePage: SitePage

Defined in components/pageref/pageref.component.ts:41

Accessors

<Protected> onAfterContentChecked

get onAfterContentChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:307

see: AfterContentChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterContentInit

get onAfterContentInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentInit

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

see: AfterContentInit

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewChecked

get onAfterViewChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:291

see: AfterViewChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewInit

get onAfterViewInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:299

see: AfterViewInit

Returns: Observable<void> the observable representation of this callback

<Protected> onDoCheck

get onDoCheck(): Observable<void>

Inherited from AbstractLifeCycleComponent.onDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:323

see: DoCheck

Returns: Observable<void> the observable representation of this callback

<Protected> onOnChanges

get onOnChanges(): Observable<SimpleChanges>

Inherited from AbstractLifeCycleComponent.onOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:331

see: OnChanges

Returns: Observable<SimpleChanges> the observable representation of this callback

<Protected> onOnDestroy

get onOnDestroy(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnDestroy

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

see: OnDestroy

Returns: Observable<void> the observable representation of this callback

<Protected> onOnInit

get onOnInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:339

see: OnInit

Returns: Observable<void> the observable representation of this callback

Methods

<Protected> describeSetter

describeSetter<T>(aSubject: Subject<T>): PropertyDescriptor

Inherited from AbstractLifeCycleComponent.describeSetter

Defined in components/rendering/abstract.lifecycle.component.ts:374

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.

deprecated: use createSetter instead

Type parameters:

T

Parameters:

NameTypeDescription
aSubjectSubject<T>the subject

Returns: PropertyDescriptor the property descriptor

ngAfterContentChecked

ngAfterContentChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:241

see: AfterContentChecked

override:

Returns: void

ngAfterContentInit

ngAfterContentInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentInit

Defined in components/rendering/abstract.lifecycle.component.ts:249

see: AfterContentInit

override:

Returns: void

ngAfterViewChecked

ngAfterViewChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:225

see: AfterViewChecked

override:

Returns: void

ngAfterViewInit

ngAfterViewInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:233

see: AfterViewInit

override:

Returns: void

ngDoCheck

ngDoCheck(): void

Inherited from AbstractLifeCycleComponent.ngDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:257

see: DoCheck

override:

Returns: void

ngOnChanges

ngOnChanges(changes: SimpleChanges): void

Inherited from AbstractLifeCycleComponent.ngOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:265

see: OnChanges

override:

Parameters:

NameType
changesSimpleChanges

Returns: void

ngOnDestroy

ngOnDestroy(): void

Overrides AbstractLifeCycleComponent.ngOnDestroy

Defined in components/pageref/pageref.component.ts:152

Returns: void

ngOnInit

ngOnInit(): void

Inherited from AbstractLifeCycleComponent.ngOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:273

see: OnInit

override:

Returns: void

safeSubscribe

safeSubscribe<T>(aObservable: Subscribable<T>, aObserver?: PartialObserver<T> | function | string, error?: function, complete?: function): void

Inherited from AbstractLifeCycleComponent.safeSubscribe

Defined in components/rendering/abstract.lifecycle.component.ts:393

Subscribes to an observable and makes sure to clean the subscription in ngOnDestroy to avoid memory leaks.

deprecated: use takeUntil(onOnDestroy) instead

Type parameters:

T

Parameters:

NameTypeDescription
aObservableSubscribable<T>the observable to subscribe to
Optional aObserverPartialObserver<T> | function | stringthe handler. If this value is a 'string', then the subscription will automatically update the respective property on the instance.
Optional errorfunctionoptional error handler
Optional completefunctionoptional completion handler

Returns: void

<Protected> unsubscribeOnDestroy

unsubscribeOnDestroy(aSubscription: Subscription): void

Inherited from AbstractLifeCycleComponent.unsubscribeOnDestroy

Defined in components/rendering/abstract.lifecycle.component.ts:359

Unsubscribes the given subscription in the ngOnDestroy method. This method exists for convenience only, consider to use the {@link #safeSubscribe} method instead.

deprecated: use takeUntil(onOnDestroy) instead

Parameters:

NameTypeDescription
aSubscriptionSubscriptionthe subscription to unsubscribe on

Returns: void

@ibm-wch-sdk/ng > "components/path/content.path.component" > ContentPathComponent

Class: ContentPathComponent

Hierarchy

AbstractBaseComponent

↳ ContentPathComponent

Implements

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

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ContentPathComponent(aWchService: WchService): ContentPathComponent

Overrides AbstractBaseComponent.constructor

Defined in components/path/content.path.component.ts:67

Parameters:

NameType
aWchServiceWchService

Returns: ContentPathComponent

Properties

layoutMode

● layoutMode: string

Inherited from AbstractBaseComponent.layoutMode

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

levels

● levels: string | number | null | undefined

Defined in components/path/content.path.component.ts:52

onComponent

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

Defined in components/path/content.path.component.ts:47

onLayoutMode

● onLayoutMode: Observable<string>

Overrides AbstractBaseComponent.onLayoutMode

Defined in components/path/content.path.component.ts:36

onPath

● onPath: Observable<string>

Defined in components/path/content.path.component.ts:62

onRenderingContext

● onRenderingContext: Observable<RenderingContext>

Overrides AbstractBaseComponent.onRenderingContext

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

onState

● onState: Observable<ComponentState>

Defined in components/path/content.path.component.ts:67

The component state

path

● path: string

Defined in components/path/content.path.component.ts:57

Accessors

<Protected> onAfterContentChecked

get onAfterContentChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:307

see: AfterContentChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterContentInit

get onAfterContentInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentInit

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

see: AfterContentInit

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewChecked

get onAfterViewChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:291

see: AfterViewChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewInit

get onAfterViewInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:299

see: AfterViewInit

Returns: Observable<void> the observable representation of this callback

<Protected> onDoCheck

get onDoCheck(): Observable<void>

Inherited from AbstractLifeCycleComponent.onDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:323

see: DoCheck

Returns: Observable<void> the observable representation of this callback

<Protected> onOnChanges

get onOnChanges(): Observable<SimpleChanges>

Inherited from AbstractLifeCycleComponent.onOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:331

see: OnChanges

Returns: Observable<SimpleChanges> the observable representation of this callback

<Protected> onOnDestroy

get onOnDestroy(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnDestroy

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

see: OnDestroy

Returns: Observable<void> the observable representation of this callback

<Protected> onOnInit

get onOnInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:339

see: OnInit

Returns: Observable<void> the observable representation of this callback

Methods

<Protected> describeSetter

describeSetter<T>(aSubject: Subject<T>): PropertyDescriptor

Inherited from AbstractLifeCycleComponent.describeSetter

Defined in components/rendering/abstract.lifecycle.component.ts:374

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.

deprecated: use createSetter instead

Type parameters:

T

Parameters:

NameTypeDescription
aSubjectSubject<T>the subject

Returns: PropertyDescriptor the property descriptor

ngAfterContentChecked

ngAfterContentChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:241

see: AfterContentChecked

override:

Returns: void

ngAfterContentInit

ngAfterContentInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentInit

Defined in components/rendering/abstract.lifecycle.component.ts:249

see: AfterContentInit

override:

Returns: void

ngAfterViewChecked

ngAfterViewChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:225

see: AfterViewChecked

override:

Returns: void

ngAfterViewInit

ngAfterViewInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:233

see: AfterViewInit

override:

Returns: void

ngDoCheck

ngDoCheck(): void

Inherited from AbstractLifeCycleComponent.ngDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:257

see: DoCheck

override:

Returns: void

ngOnChanges

ngOnChanges(changes: SimpleChanges): void

Inherited from AbstractLifeCycleComponent.ngOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:265

see: OnChanges

override:

Parameters:

NameType
changesSimpleChanges

Returns: void

ngOnDestroy

ngOnDestroy(): void

Overrides AbstractLifeCycleComponent.ngOnDestroy

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

Returns: void

ngOnInit

ngOnInit(): void

Inherited from AbstractLifeCycleComponent.ngOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:273

see: OnInit

override:

Returns: void

safeSubscribe

safeSubscribe<T>(aObservable: Subscribable<T>, aObserver?: PartialObserver<T> | function | string, error?: function, complete?: function): void

Inherited from AbstractLifeCycleComponent.safeSubscribe

Defined in components/rendering/abstract.lifecycle.component.ts:393

Subscribes to an observable and makes sure to clean the subscription in ngOnDestroy to avoid memory leaks.

deprecated: use takeUntil(onOnDestroy) instead

Type parameters:

T

Parameters:

NameTypeDescription
aObservableSubscribable<T>the observable to subscribe to
Optional aObserverPartialObserver<T> | function | stringthe handler. If this value is a 'string', then the subscription will automatically update the respective property on the instance.
Optional errorfunctionoptional error handler
Optional completefunctionoptional completion handler

Returns: void

<Protected> unsubscribeOnDestroy

unsubscribeOnDestroy(aSubscription: Subscription): void

Inherited from AbstractLifeCycleComponent.unsubscribeOnDestroy

Defined in components/rendering/abstract.lifecycle.component.ts:359

Unsubscribes the given subscription in the ngOnDestroy method. This method exists for convenience only, consider to use the {@link #safeSubscribe} method instead.

deprecated: use takeUntil(onOnDestroy) instead

Parameters:

NameTypeDescription
aSubscriptionSubscriptionthe subscription to unsubscribe on

Returns: void

@ibm-wch-sdk/ng > "components/rendering/abstract-base.component" > AbstractBaseComponent

Class: AbstractBaseComponent

Hierarchy

AbstractLifeCycleComponent

↳ AbstractBaseComponent

PageComponent

ContentPathComponent

SiteComponent

Implements

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

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

new AbstractBaseComponent(): AbstractBaseComponent

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

Returns: AbstractBaseComponent

Properties

layoutMode

● layoutMode: string

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

onLayoutMode

● onLayoutMode: Observable<string>

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

onRenderingContext

● onRenderingContext: Observable<RenderingContext>

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

Accessors

<Protected> onAfterContentChecked

get onAfterContentChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:307

see: AfterContentChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterContentInit

get onAfterContentInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentInit

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

see: AfterContentInit

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewChecked

get onAfterViewChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:291

see: AfterViewChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewInit

get onAfterViewInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:299

see: AfterViewInit

Returns: Observable<void> the observable representation of this callback

<Protected> onDoCheck

get onDoCheck(): Observable<void>

Inherited from AbstractLifeCycleComponent.onDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:323

see: DoCheck

Returns: Observable<void> the observable representation of this callback

<Protected> onOnChanges

get onOnChanges(): Observable<SimpleChanges>

Inherited from AbstractLifeCycleComponent.onOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:331

see: OnChanges

Returns: Observable<SimpleChanges> the observable representation of this callback

<Protected> onOnDestroy

get onOnDestroy(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnDestroy

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

see: OnDestroy

Returns: Observable<void> the observable representation of this callback

<Protected> onOnInit

get onOnInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:339

see: OnInit

Returns: Observable<void> the observable representation of this callback

Methods

<Protected> describeSetter

describeSetter<T>(aSubject: Subject<T>): PropertyDescriptor

Inherited from AbstractLifeCycleComponent.describeSetter

Defined in components/rendering/abstract.lifecycle.component.ts:374

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.

deprecated: use createSetter instead

Type parameters:

T

Parameters:

NameTypeDescription
aSubjectSubject<T>the subject

Returns: PropertyDescriptor the property descriptor

ngAfterContentChecked

ngAfterContentChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:241

see: AfterContentChecked

override:

Returns: void

ngAfterContentInit

ngAfterContentInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentInit

Defined in components/rendering/abstract.lifecycle.component.ts:249

see: AfterContentInit

override:

Returns: void

ngAfterViewChecked

ngAfterViewChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:225

see: AfterViewChecked

override:

Returns: void

ngAfterViewInit

ngAfterViewInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:233

see: AfterViewInit

override:

Returns: void

ngDoCheck

ngDoCheck(): void

Inherited from AbstractLifeCycleComponent.ngDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:257

see: DoCheck

override:

Returns: void

ngOnChanges

ngOnChanges(changes: SimpleChanges): void

Inherited from AbstractLifeCycleComponent.ngOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:265

see: OnChanges

override:

Parameters:

NameType
changesSimpleChanges

Returns: void

ngOnDestroy

ngOnDestroy(): void

Inherited from AbstractLifeCycleComponent.ngOnDestroy

Defined in components/rendering/abstract.lifecycle.component.ts:281

see: OnDestroy

override:

Returns: void

ngOnInit

ngOnInit(): void

Inherited from AbstractLifeCycleComponent.ngOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:273

see: OnInit

override:

Returns: void

safeSubscribe

safeSubscribe<T>(aObservable: Subscribable<T>, aObserver?: PartialObserver<T> | function | string, error?: function, complete?: function): void

Inherited from AbstractLifeCycleComponent.safeSubscribe

Defined in components/rendering/abstract.lifecycle.component.ts:393

Subscribes to an observable and makes sure to clean the subscription in ngOnDestroy to avoid memory leaks.

deprecated: use takeUntil(onOnDestroy) instead

Type parameters:

T

Parameters:

NameTypeDescription
aObservableSubscribable<T>the observable to subscribe to
Optional aObserverPartialObserver<T> | function | stringthe handler. If this value is a 'string', then the subscription will automatically update the respective property on the instance.
Optional errorfunctionoptional error handler
Optional completefunctionoptional completion handler

Returns: void

<Protected> unsubscribeOnDestroy

unsubscribeOnDestroy(aSubscription: Subscription): void

Inherited from AbstractLifeCycleComponent.unsubscribeOnDestroy

Defined in components/rendering/abstract.lifecycle.component.ts:359

Unsubscribes the given subscription in the ngOnDestroy method. This method exists for convenience only, consider to use the {@link #safeSubscribe} method instead.

deprecated: use takeUntil(onOnDestroy) instead

Parameters:

NameTypeDescription
aSubscriptionSubscriptionthe subscription to unsubscribe on

Returns: void

@ibm-wch-sdk/ng > "components/rendering/abstract-rendering.component" > AbstractRenderingComponent

Class: AbstractRenderingComponent

Hierarchy

AbstractLifeCycleComponent

↳ AbstractRenderingComponent

ContentrefComponent

Implements

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

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

new AbstractRenderingComponent(): AbstractRenderingComponent

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

Returns: AbstractRenderingComponent

Properties

<Protected> _id

● _id: string

Defined in components/rendering/abstract-rendering.component.ts:34

layoutMode

● layoutMode: string

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

The current layout mode for convenience

onLayoutMode

● onLayoutMode: Observable<string>

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

onRenderingContext

● onRenderingContext: Observable<RenderingContext>

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

renderingContext

● renderingContext: RenderingContext

Defined in components/rendering/abstract-rendering.component.ts:49

The current rendering context for convenience

Accessors

<Protected> context

get context(): Observable<RenderingContext>

Defined in components/rendering/abstract-rendering.component.ts:141

Returns: Observable<RenderingContext>

<Protected> onAfterContentChecked

get onAfterContentChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:307

see: AfterContentChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterContentInit

get onAfterContentInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentInit

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

see: AfterContentInit

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewChecked

get onAfterViewChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:291

see: AfterViewChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewInit

get onAfterViewInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:299

see: AfterViewInit

Returns: Observable<void> the observable representation of this callback

<Protected> onDoCheck

get onDoCheck(): Observable<void>

Inherited from AbstractLifeCycleComponent.onDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:323

see: DoCheck

Returns: Observable<void> the observable representation of this callback

<Protected> onOnChanges

get onOnChanges(): Observable<SimpleChanges>

Inherited from AbstractLifeCycleComponent.onOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:331

see: OnChanges

Returns: Observable<SimpleChanges> the observable representation of this callback

<Protected> onOnDestroy

get onOnDestroy(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnDestroy

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

see: OnDestroy

Returns: Observable<void> the observable representation of this callback

<Protected> onOnInit

get onOnInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:339

see: OnInit

Returns: Observable<void> the observable representation of this callback

Methods

<Protected> describeSetter

describeSetter<T>(aSubject: Subject<T>): PropertyDescriptor

Inherited from AbstractLifeCycleComponent.describeSetter

Defined in components/rendering/abstract.lifecycle.component.ts:374

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.

deprecated: use createSetter instead

Type parameters:

T

Parameters:

NameTypeDescription
aSubjectSubject<T>the subject

Returns: PropertyDescriptor the property descriptor

ngAfterContentChecked

ngAfterContentChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:241

see: AfterContentChecked

override:

Returns: void

ngAfterContentInit

ngAfterContentInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentInit

Defined in components/rendering/abstract.lifecycle.component.ts:249

see: AfterContentInit

override:

Returns: void

ngAfterViewChecked

ngAfterViewChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:225

see: AfterViewChecked

override:

Returns: void

ngAfterViewInit

ngAfterViewInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:233

see: AfterViewInit

override:

Returns: void

ngDoCheck

ngDoCheck(): void

Inherited from AbstractLifeCycleComponent.ngDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:257

see: DoCheck

override:

Returns: void

ngOnChanges

ngOnChanges(changes: SimpleChanges): void

Inherited from AbstractLifeCycleComponent.ngOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:265

see: OnChanges

override:

Parameters:

NameType
changesSimpleChanges

Returns: void

ngOnDestroy

ngOnDestroy(): void

Overrides AbstractLifeCycleComponent.ngOnDestroy

Defined in components/rendering/abstract-rendering.component.ts:162

Returns: void

ngOnInit

ngOnInit(): void

Inherited from AbstractLifeCycleComponent.ngOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:273

see: OnInit

override:

Returns: void

safeSubscribe

safeSubscribe<T>(aObservable: Subscribable<T>, aObserver?: PartialObserver<T> | function | string, error?: function, complete?: function): void

Inherited from AbstractLifeCycleComponent.safeSubscribe

Defined in components/rendering/abstract.lifecycle.component.ts:393

Subscribes to an observable and makes sure to clean the subscription in ngOnDestroy to avoid memory leaks.

deprecated: use takeUntil(onOnDestroy) instead

Type parameters:

T

Parameters:

NameTypeDescription
aObservableSubscribable<T>the observable to subscribe to
Optional aObserverPartialObserver<T> | function | stringthe handler. If this value is a 'string', then the subscription will automatically update the respective property on the instance.
Optional errorfunctionoptional error handler
Optional completefunctionoptional completion handler

Returns: void

trackByComponentId

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

Defined in components/rendering/abstract-rendering.component.ts:153

Parameters:

NameType
aIndexnumber
aRenderingContextRenderingContext

Returns: string

<Protected> unsubscribeOnDestroy

unsubscribeOnDestroy(aSubscription: Subscription): void

Inherited from AbstractLifeCycleComponent.unsubscribeOnDestroy

Defined in components/rendering/abstract.lifecycle.component.ts:359

Unsubscribes the given subscription in the ngOnDestroy method. This method exists for convenience only, consider to use the {@link #safeSubscribe} method instead.

deprecated: use takeUntil(onOnDestroy) instead

Parameters:

NameTypeDescription
aSubscriptionSubscriptionthe subscription to unsubscribe on

Returns: void

@ibm-wch-sdk/ng > "components/rendering/abstract.lifecycle.component" > AbstractLifeCycleComponent

Class: AbstractLifeCycleComponent

Base class that allows to register life cycle hooks. This class is supposed to be subclassed before use.

The 'ngXXX' methods override the methods from the Angular life cycle interfaces. If you overridde any of these methods make sure to call the super method.

The 'onXXX' methods expose observables that will be triggered when the life cycle method occurs. This is a convenient way to register hooks in the constructor of a subclass without having to override any method.

The {@link #onOnDestroy} observable is especially useful, since it can be used as a termination signal for automatic unsubscriptions via the http://reactivex.io/documentation/operators/takeuntil.html operation.

Note that hooks such as onOnInit and onOnDestroy only fire once. If you depend on such a hook in an observable chain more than once make sure to share the emissions (typically via shareReplay )

Hierarchy

AbstractLifeCycleComponent

ContentComponent

ContentQueryComponent

AbstractRenderingComponent

AbstractBaseComponent

PagerefComponent

Implements

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

Index

Accessors

Methods

Accessors

<Protected> onAfterContentChecked

get onAfterContentChecked(): Observable<void>

Defined in components/rendering/abstract.lifecycle.component.ts:307

see: AfterContentChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterContentInit

get onAfterContentInit(): Observable<void>

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

see: AfterContentInit

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewChecked

get onAfterViewChecked(): Observable<void>

Defined in components/rendering/abstract.lifecycle.component.ts:291

see: AfterViewChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewInit

get onAfterViewInit(): Observable<void>

Defined in components/rendering/abstract.lifecycle.component.ts:299

see: AfterViewInit

Returns: Observable<void> the observable representation of this callback

<Protected> onDoCheck

get onDoCheck(): Observable<void>

Defined in components/rendering/abstract.lifecycle.component.ts:323

see: DoCheck

Returns: Observable<void> the observable representation of this callback

<Protected> onOnChanges

get onOnChanges(): Observable<SimpleChanges>

Defined in components/rendering/abstract.lifecycle.component.ts:331

see: OnChanges

Returns: Observable<SimpleChanges> the observable representation of this callback

<Protected> onOnDestroy

get onOnDestroy(): Observable<void>

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

see: OnDestroy

Returns: Observable<void> the observable representation of this callback

<Protected> onOnInit

get onOnInit(): Observable<void>

Defined in components/rendering/abstract.lifecycle.component.ts:339

see: OnInit

Returns: Observable<void> the observable representation of this callback

Methods

<Protected> describeSetter

describeSetter<T>(aSubject: Subject<T>): PropertyDescriptor

Defined in components/rendering/abstract.lifecycle.component.ts:374

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.

deprecated: use createSetter instead

Type parameters:

T

Parameters:

NameTypeDescription
aSubjectSubject<T>the subject

Returns: PropertyDescriptor the property descriptor

ngAfterContentChecked

ngAfterContentChecked(): void

Defined in components/rendering/abstract.lifecycle.component.ts:241

see: AfterContentChecked

override:

Returns: void

ngAfterContentInit

ngAfterContentInit(): void

Defined in components/rendering/abstract.lifecycle.component.ts:249

see: AfterContentInit

override:

Returns: void

ngAfterViewChecked

ngAfterViewChecked(): void

Defined in components/rendering/abstract.lifecycle.component.ts:225

see: AfterViewChecked

override:

Returns: void

ngAfterViewInit

ngAfterViewInit(): void

Defined in components/rendering/abstract.lifecycle.component.ts:233

see: AfterViewInit

override:

Returns: void

ngDoCheck

ngDoCheck(): void

Defined in components/rendering/abstract.lifecycle.component.ts:257

see: DoCheck

override:

Returns: void

ngOnChanges

ngOnChanges(changes: SimpleChanges): void

Defined in components/rendering/abstract.lifecycle.component.ts:265

see: OnChanges

override:

Parameters:

NameType
changesSimpleChanges

Returns: void

ngOnDestroy

ngOnDestroy(): void

Defined in components/rendering/abstract.lifecycle.component.ts:281

see: OnDestroy

override:

Returns: void

ngOnInit

ngOnInit(): void

Defined in components/rendering/abstract.lifecycle.component.ts:273

see: OnInit

override:

Returns: void

safeSubscribe

safeSubscribe<T>(aObservable: Subscribable<T>, aObserver?: PartialObserver<T> | function | string, error?: function, complete?: function): void

Defined in components/rendering/abstract.lifecycle.component.ts:393

Subscribes to an observable and makes sure to clean the subscription in ngOnDestroy to avoid memory leaks.

deprecated: use takeUntil(onOnDestroy) instead

Type parameters:

T

Parameters:

NameTypeDescription
aObservableSubscribable<T>the observable to subscribe to
Optional aObserverPartialObserver<T> | function | stringthe handler. If this value is a 'string', then the subscription will automatically update the respective property on the instance.
Optional errorfunctionoptional error handler
Optional completefunctionoptional completion handler

Returns: void

<Protected> unsubscribeOnDestroy

unsubscribeOnDestroy(aSubscription: Subscription): void

Defined in components/rendering/abstract.lifecycle.component.ts:359

Unsubscribes the given subscription in the ngOnDestroy method. This method exists for convenience only, consider to use the {@link #safeSubscribe} method instead.

deprecated: use takeUntil(onOnDestroy) instead

Parameters:

NameTypeDescription
aSubscriptionSubscriptionthe subscription to unsubscribe on

Returns: void

@ibm-wch-sdk/ng > "components/site/site.component" > SiteComponent

Class: SiteComponent

Hierarchy

AbstractBaseComponent

↳ SiteComponent

Implements

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

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

new SiteComponent(aWchService: WchService): SiteComponent

Overrides AbstractBaseComponent.constructor

Defined in components/site/site.component.ts:34

Parameters:

NameType
aWchServiceWchService

Returns: SiteComponent

Properties

layoutMode

● layoutMode: string

Inherited from AbstractBaseComponent.layoutMode

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

onComponent

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

Defined in components/site/site.component.ts:34

onLayoutMode

● onLayoutMode: Observable<string>

Overrides AbstractBaseComponent.onLayoutMode

Defined in components/site/site.component.ts:23

onRenderingContext

● onRenderingContext: Observable<RenderingContext>

Overrides AbstractBaseComponent.onRenderingContext

Defined in components/site/site.component.ts:29

Accessors

<Protected> onAfterContentChecked

get onAfterContentChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:307

see: AfterContentChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterContentInit

get onAfterContentInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterContentInit

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

see: AfterContentInit

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewChecked

get onAfterViewChecked(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:291

see: AfterViewChecked

Returns: Observable<void> the observable representation of this callback

<Protected> onAfterViewInit

get onAfterViewInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:299

see: AfterViewInit

Returns: Observable<void> the observable representation of this callback

<Protected> onDoCheck

get onDoCheck(): Observable<void>

Inherited from AbstractLifeCycleComponent.onDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:323

see: DoCheck

Returns: Observable<void> the observable representation of this callback

<Protected> onOnChanges

get onOnChanges(): Observable<SimpleChanges>

Inherited from AbstractLifeCycleComponent.onOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:331

see: OnChanges

Returns: Observable<SimpleChanges> the observable representation of this callback

<Protected> onOnDestroy

get onOnDestroy(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnDestroy

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

see: OnDestroy

Returns: Observable<void> the observable representation of this callback

<Protected> onOnInit

get onOnInit(): Observable<void>

Inherited from AbstractLifeCycleComponent.onOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:339

see: OnInit

Returns: Observable<void> the observable representation of this callback

Methods

<Protected> describeSetter

describeSetter<T>(aSubject: Subject<T>): PropertyDescriptor

Inherited from AbstractLifeCycleComponent.describeSetter

Defined in components/rendering/abstract.lifecycle.component.ts:374

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.

deprecated: use createSetter instead

Type parameters:

T

Parameters:

NameTypeDescription
aSubjectSubject<T>the subject

Returns: PropertyDescriptor the property descriptor

ngAfterContentChecked

ngAfterContentChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentChecked

Defined in components/rendering/abstract.lifecycle.component.ts:241

see: AfterContentChecked

override:

Returns: void

ngAfterContentInit

ngAfterContentInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterContentInit

Defined in components/rendering/abstract.lifecycle.component.ts:249

see: AfterContentInit

override:

Returns: void

ngAfterViewChecked

ngAfterViewChecked(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewChecked

Defined in components/rendering/abstract.lifecycle.component.ts:225

see: AfterViewChecked

override:

Returns: void

ngAfterViewInit

ngAfterViewInit(): void

Inherited from AbstractLifeCycleComponent.ngAfterViewInit

Defined in components/rendering/abstract.lifecycle.component.ts:233

see: AfterViewInit

override:

Returns: void

ngDoCheck

ngDoCheck(): void

Inherited from AbstractLifeCycleComponent.ngDoCheck

Defined in components/rendering/abstract.lifecycle.component.ts:257

see: DoCheck

override:

Returns: void

ngOnChanges

ngOnChanges(changes: SimpleChanges): void

Inherited from AbstractLifeCycleComponent.ngOnChanges

Defined in components/rendering/abstract.lifecycle.component.ts:265

see: OnChanges

override:

Parameters:

NameType
changesSimpleChanges

Returns: void

ngOnDestroy

ngOnDestroy(): void

Overrides AbstractLifeCycleComponent.ngOnDestroy

Defined in components/site/site.component.ts:52

Returns: void

ngOnInit

ngOnInit(): void

Inherited from AbstractLifeCycleComponent.ngOnInit

Defined in components/rendering/abstract.lifecycle.component.ts:273

see: OnInit

override:

Returns: void

safeSubscribe

safeSubscribe<T>(aObservable: Subscribable<T>, aObserver?: PartialObserver<T> | function | string, error?: function, complete?: function): void

Inherited from AbstractLifeCycleComponent.safeSubscribe

Defined in components/rendering/abstract.lifecycle.component.ts:393

Subscribes to an observable and makes sure to clean the subscription in ngOnDestroy to avoid memory leaks.

deprecated: use takeUntil(onOnDestroy) instead

Type parameters:

T

Parameters:

NameTypeDescription
aObservableSubscribable<T>the observable to subscribe to
Optional aObserverPartialObserver<T> | function | stringthe handler. If this value is a 'string', then the subscription will automatically update the respective property on the instance.
Optional errorfunctionoptional error handler
Optional completefunctionoptional completion handler

Returns: void

<Protected> unsubscribeOnDestroy

unsubscribeOnDestroy(aSubscription: Subscription): void

Inherited from AbstractLifeCycleComponent.unsubscribeOnDestroy

Defined in components/rendering/abstract.lifecycle.component.ts:359

Unsubscribes the given subscription in the ngOnDestroy method. This method exists for convenience only, consider to use the {@link #safeSubscribe} method instead.

deprecated: use takeUntil(onOnDestroy) instead

Parameters:

NameTypeDescription
aSubscriptionSubscriptionthe subscription to unsubscribe on

Returns: void

@ibm-wch-sdk/ng > "decorators/bootstrap/rendering.context.bootstrap.directive" > ContentWithLayoutBootstrapDirective

Interface: ContentWithLayoutBootstrapDirective

Hierarchy

ContentWithLayoutBootstrapDirective

Index

@ibm-wch-sdk/ng > "decorators/bootstrap/site.bootstrap.directive" > SiteBootstrapDirective

Interface: SiteBootstrapDirective

Hierarchy

SiteBootstrapDirective

Index

Properties

Properties

<Optional> siteId

● siteId: string

Defined in decorators/bootstrap/site.bootstrap.directive.ts:7

@ibm-wch-sdk/ng > "decorators/layout/layout.decorator" > Binding

Interface: Binding

Type parameters

T

Hierarchy

Binding

Index

Properties

Properties

name

● name: string

Defined in decorators/layout/layout.decorator.ts:57

observable

● observable: Observable<T>

Defined in decorators/layout/layout.decorator.ts:58

subscription

● subscription: Subscription

Defined in decorators/layout/layout.decorator.ts:59

value

● value: T

Defined in decorators/layout/layout.decorator.ts:60

@ibm-wch-sdk/ng > "decorators/layout/layout.directive" > LayoutComponentDirective

Interface: LayoutComponentDirective

Hierarchy

LayoutComponentDirective

Index

Properties

Properties

<Optional> componentFactoryResolver

● componentFactoryResolver: ComponentFactoryResolver

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

The optional component factory resolver used to instantiate the component

<Optional> layoutMode

● layoutMode: string | string[]

Defined in decorators/layout/layout.directive.ts:26

<Optional> mappingId

● mappingId: string | string[]

Defined in decorators/layout/layout.directive.ts:21

<Optional> selector

● selector: string | string[]

Defined in decorators/layout/layout.directive.ts:14

@ibm-wch-sdk/ng > "decorators/layout/layout.directive" > LayoutMappingDirective

Interface: LayoutMappingDirective

Hierarchy

LayoutMappingDirective

Index

Properties

Properties

<Optional> id

● id: string | string[]

Defined in decorators/layout/layout.directive.ts:58

Type IDs or content IDs to map this to

<Optional> kind

● kind: CONTENT_ITEM_KIND | CONTENT_ITEM_KIND[]

Defined in decorators/layout/layout.directive.ts:63

Type IDs to map this to

<Optional> layoutMode

● layoutMode: string | string[]

Defined in decorators/layout/layout.directive.ts:53

<Optional> selector

● selector: string | string[]

Defined in decorators/layout/layout.directive.ts:48

@ibm-wch-sdk/ng > "directives/contentref.directive" > ContentRefDirective

Class: ContentRefDirective

Hierarchy

ContentRefDirective

Implements

  • OnChanges
  • OnDestroy

Index

Constructors

Properties

Methods

Constructors

constructor

new ContentRefDirective(_viewContainerRef: ViewContainerRef, _cmpResolver: ComponentFactoryResolver, _activatedRoute: ActivatedRoute): ContentRefDirective

Defined in directives/contentref.directive.ts:83

Parameters:

NameType
_viewContainerRefViewContainerRef
_cmpResolverComponentFactoryResolver
_activatedRouteActivatedRoute

Returns: ContentRefDirective

Properties

<Private>``<Optional> _cc

● _cc: ComponentRef<any>

Defined in directives/contentref.directive.ts:83

The currently used component

<Private>``<Optional> _cr

● _cr: ComponentFactoryResolver

Defined in directives/contentref.directive.ts:73

The currently used resolver

<Private>``<Optional> _ct

● _ct: ComponentTypeRef<any>

Defined in directives/contentref.directive.ts:78

The currently used type

<Private> _r

● _r: ComponentFactoryResolver

Defined in directives/contentref.directive.ts:68

The default component factory resolver

<Private> _viewContainerRef

● _viewContainerRef: ViewContainerRef

Defined in directives/contentref.directive.ts:86

cmpResolver

● cmpResolver: ComponentFactoryResolver

Defined in directives/contentref.directive.ts:49

layoutMode

● layoutMode: string

Defined in directives/contentref.directive.ts:58

onComponent

● onComponent: Subject<any> = createSingleSubject()

Defined in directives/contentref.directive.ts:63

Output that will be triggered when a new component was created

renderingContext

● renderingContext: RenderingContext

Defined in directives/contentref.directive.ts:53

wchContentRef

● wchContentRef: ComponentTypeRef<any>

Defined in directives/contentref.directive.ts:47

Methods

ngOnChanges

ngOnChanges(changes: SimpleChanges): void

Defined in directives/contentref.directive.ts:98

Parameters:

NameType
changesSimpleChanges

Returns: void

ngOnDestroy

ngOnDestroy(): void

Defined in directives/contentref.directive.ts:165

Returns: void

@ibm-wch-sdk/ng > "guards/root.page.guard" > SelectFirstRootPageGuard

Class: SelectFirstRootPageGuard

Hierarchy

SelectFirstRootPageGuard

Implements

  • CanActivate

Index

Constructors

Properties

Methods

Constructors

constructor

new SelectFirstRootPageGuard(aSearchService: SearchService, aRouter: Router): SelectFirstRootPageGuard

Defined in guards/root.page.guard.ts:22

Parameters:

NameType
aSearchServiceSearchService
aRouterRouter

Returns: SelectFirstRootPageGuard

Properties

<Private> aRouter

● aRouter: Router

Defined in guards/root.page.guard.ts:23

<Private> aSearchService

● aSearchService: SearchService

Defined in guards/root.page.guard.ts:23

Methods

canActivate

canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean>

Defined in guards/root.page.guard.ts:25

Parameters:

NameType
routeActivatedRouteSnapshot
stateRouterStateSnapshot

Returns: Observable<boolean>

@ibm-wch-sdk/ng > "interfaces/hub-context" > HubContext

Interface: HubContext

Hierarchy

HubContext

Index

Properties

Properties

apiUrl

● apiUrl: URL

Defined in interfaces/hub-context.ts:10

deliveryUrl

● deliveryUrl: URL

Defined in interfaces/hub-context.ts:17

<Optional> isPreviewMode

● isPreviewMode: boolean

Defined in interfaces/hub-context.ts:22

@ibm-wch-sdk/ng > "module" > WchNgModule

Class: WchNgModule

Hierarchy

WchNgModule

Index

Constructors

Methods

Constructors

constructor

new WchNgModule(parentModule: WchNgModule, loggerService: LoggerProxy, depService: DependencyService): WchNgModule

Defined in module.ts:145

Parameters:

NameType
parentModuleWchNgModule
loggerServiceLoggerProxy
depServiceDependencyService

Returns: WchNgModule

Methods

<Static> forRoot

forRoot(aService?: HubInfoConfig): ModuleWithProviders

Defined in module.ts:55

Parameters:

NameType
Optional aServiceHubInfoConfig

Returns: ModuleWithProviders

@ibm-wch-sdk/ng > "modules/components.module" > WchNgComponentsModule

Class: WchNgComponentsModule

Hierarchy

WchNgComponentsModule

Index

@ibm-wch-sdk/ng > "modules/services.module" > WchNgServicesModule

Class: WchNgServicesModule

Hierarchy

WchNgServicesModule

Index

Constructors

Constructors

constructor

new WchNgServicesModule(parentModule: WchNgServicesModule, loggerService: LoggerProxy, depService: DependencyService): WchNgServicesModule

Defined in modules/services.module.ts:18

Parameters:

NameType
parentModuleWchNgServicesModule
loggerServiceLoggerProxy
depServiceDependencyService

Returns: WchNgServicesModule

@ibm-wch-sdk/ng > "services/config/application.config.service" > ApplicationConfigService

Class: ApplicationConfigService

Hierarchy

ApplicationConfigService

Index

Constructors

Properties

Accessors

Constructors

constructor

new ApplicationConfigService(wchService: WchService): ApplicationConfigService

Defined in services/config/application.config.service.ts:12

Parameters:

NameType
wchServiceWchService

Returns: ApplicationConfigService

Properties

<Private> wchService

● wchService: WchService

Defined in services/config/application.config.service.ts:14

Accessors

appConfig

get appConfig(): Observable<ApplicationConfig>

Defined in services/config/application.config.service.ts:17

Returns: Observable<ApplicationConfig>

@ibm-wch-sdk/ng > "services/dependency/dependency.service" > DependencyService

Class: DependencyService

Hierarchy

DependencyService

Implements

  • OnDestroy

Index

Constructors

Properties

Accessors

Constructors

constructor

new DependencyService(loggerService: WchLoggerService, router: Router, urlsService: UrlsService, wchService: WchService, aInjector: Injector): DependencyService

Defined in services/dependency/dependency.service.ts:22

Parameters:

NameType
loggerServiceWchLoggerService
routerRouter
urlsServiceUrlsService
wchServiceWchService
aInjectorInjector

Returns: DependencyService

Properties

<Private> _sdk

● _sdk: Sdk

Defined in services/dependency/dependency.service.ts:22

ngOnDestroy

● ngOnDestroy: function

Defined in services/dependency/dependency.service.ts:20

Type declaration

▸(): void

Returns: void

Accessors

sdk

get sdk(): Sdk

Defined in services/dependency/dependency.service.ts:85

Returns: Sdk

@ibm-wch-sdk/ng > "services/dependency/message/sdk.navigate.by.path.message" > SdkNavigateByPathHandler

Class: SdkNavigateByPathHandler

Executes a navigation event

Hierarchy

SdkNavigateByPathHandler

Implements

  • SdkMessageHandler

Index

Constructors

Properties

Constructors

constructor

new SdkNavigateByPathHandler(router: Router, loggerService: WchLoggerService): SdkNavigateByPathHandler

Defined in services/dependency/message/sdk.navigate.by.path.message.ts:17

Parameters:

NameType
routerRouter
loggerServiceWchLoggerService

Returns: SdkNavigateByPathHandler

Properties

handle

● handle: SdkMessageHandlerCallback

Defined in services/dependency/message/sdk.navigate.by.path.message.ts:17

@ibm-wch-sdk/ng > "services/dependency/message/sdk.refresh.message" > SdkRefreshHandler

Class: SdkRefreshHandler

Executes a refresh event

Hierarchy

SdkRefreshHandler

Implements

  • SdkMessageHandler

Index

Constructors

Properties

Constructors

constructor

new SdkRefreshHandler(refreshService: RefreshService, loggerService: WchLoggerService): SdkRefreshHandler

Defined in services/dependency/message/sdk.refresh.message.ts:17

Parameters:

NameType
refreshServiceRefreshService
loggerServiceWchLoggerService

Returns: SdkRefreshHandler

Properties

handle

● handle: SdkMessageHandlerCallback

Defined in services/dependency/message/sdk.refresh.message.ts:17

@ibm-wch-sdk/ng > "services/dependency/message/sdk.set.mode.message" > SdkSetModeHandler

Class: SdkSetModeHandler

Executes a navigation event

Hierarchy

SdkSetModeHandler

Implements

  • SdkMessageHandler

Index

Constructors

Properties

Constructors

constructor

new SdkSetModeHandler(loggerService: WchLoggerService): SdkSetModeHandler

Defined in services/dependency/message/sdk.set.mode.message.ts:17

Parameters:

NameType
loggerServiceWchLoggerService

Returns: SdkSetModeHandler

Properties

handle

● handle: SdkMessageHandlerCallback

Defined in services/dependency/message/sdk.set.mode.message.ts:17

@ibm-wch-sdk/ng > "services/dependency/message/sdk.subscribe.message" > SdkUnsubscribeHandler

Class: SdkUnsubscribeHandler

Subscribes to the active route

Hierarchy

SdkUnsubscribeHandler

Implements

  • SdkMessageHandler

Index

Constructors

Properties

Constructors

constructor

new SdkUnsubscribeHandler(loggerService: WchLoggerService): SdkUnsubscribeHandler

Defined in services/dependency/message/sdk.subscribe.message.ts:16

Parameters:

NameType
loggerServiceWchLoggerService

Returns: SdkUnsubscribeHandler

Properties

handle

● handle: SdkMessageHandlerCallback

Defined in services/dependency/message/sdk.subscribe.message.ts:16

@ibm-wch-sdk/ng > "services/dependency/message/sdk.subscribe.active.route.message" > SdkSubscribeActiveRouteHandler

Class: SdkSubscribeActiveRouteHandler

Subscribes to the active route

Hierarchy

SdkSubscribeActiveRouteHandler

Implements

  • SdkMessageHandler

Index

Constructors

Properties

Constructors

constructor

new SdkSubscribeActiveRouteHandler(activePageService: ActivePageService, loggerService: WchLoggerService): SdkSubscribeActiveRouteHandler

Defined in services/dependency/message/sdk.subscribe.active.route.message.ts:16

Parameters:

NameType
activePageServiceActivePageService
loggerServiceWchLoggerService

Returns: SdkSubscribeActiveRouteHandler

Properties

handle

● handle: SdkMessageHandlerCallback

Defined in services/dependency/message/sdk.subscribe.active.route.message.ts:16

@ibm-wch-sdk/ng > "services/dependency/message/sdk.subscribe.mode.message" > SdkSubscribeModeHandler

Class: SdkSubscribeModeHandler

Subscribes to the active mode

Hierarchy

SdkSubscribeModeHandler

Implements

  • SdkMessageHandler

Index

Constructors

Properties

Constructors

constructor

new SdkSubscribeModeHandler(loggerService: WchLoggerService): SdkSubscribeModeHandler

Defined in services/dependency/message/sdk.subscribe.mode.message.ts:16

Parameters:

NameType
loggerServiceWchLoggerService

Returns: SdkSubscribeModeHandler

Properties

handle

● handle: SdkMessageHandlerCallback

Defined in services/dependency/message/sdk.subscribe.mode.message.ts:16

@ibm-wch-sdk/ng > "services/dependency/message/sdk.subscribe.route.message" > SdkSubscribeRouteHandler

Class: SdkSubscribeRouteHandler

Subscribes to a given route

Hierarchy

SdkSubscribeRouteHandler

Implements

  • SdkMessageHandler

Index

Constructors

Properties

Constructors

constructor

new SdkSubscribeRouteHandler(wchService: WchService, loggerService: WchLoggerService): SdkSubscribeRouteHandler

Defined in services/dependency/message/sdk.subscribe.route.message.ts:18

Parameters:

NameType
wchServiceWchService
loggerServiceWchLoggerService

Returns: SdkSubscribeRouteHandler

Properties

handle

● handle: SdkMessageHandlerCallback

Defined in services/dependency/message/sdk.subscribe.route.message.ts:18

@ibm-wch-sdk/ng > "services/dependency/sdk/jsonp/jsonp" > SdkJsonp

Class: SdkJsonp

Hierarchy

SdkJsonp

Index

Constructors

Properties

Constructors

constructor

new SdkJsonp(aDeps: SdkJsonpDependencies): SdkJsonp

Defined in services/dependency/sdk/jsonp/jsonp.ts:113

Parameters:

NameType
aDepsSdkJsonpDependencies

Returns: SdkJsonp

Properties

addCallback

● addCallback: function

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

Type declaration

▸(aUrl: string, aCallback: JsonpCallback): string

Parameters:

NameType
aUrlstring
aCallbackJsonpCallback

Returns: string

callback

● callback: JsonpCallbacks

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

destroy

● destroy: function

Defined in services/dependency/sdk/jsonp/jsonp.ts:113

Type declaration

▸(): void

Returns: void

removeCallback

● removeCallback: function

Defined in services/dependency/sdk/jsonp/jsonp.ts:108

Type declaration

▸(aDigest: string): boolean

Parameters:

NameType
aDigeststring

Returns: boolean

@ibm-wch-sdk/ng > "services/dependency/sdk/jsonp/jsonp" > JsonpCallbacks

Interface: JsonpCallbacks

Hierarchy

JsonpCallbacks

Indexable

[url: string]: JsonpCallback

Index

@ibm-wch-sdk/ng > "services/dependency/sdk/jsonp/jsonp" > SdkJsonpDependencies

Interface: SdkJsonpDependencies

Hierarchy

SdkJsonpDependencies

SdkDependencies

Index

Properties

Properties

urlsService

● urlsService: UrlConfig

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

@ibm-wch-sdk/ng > "services/dependency/sdk/router/router" > SdkRouter

Class: SdkRouter

Hierarchy

SdkRouter

Implements

  • WchSdkRouter

Index

Constructors

Properties

Constructors

constructor

new SdkRouter(aDeps: SdkRouterDependencies): SdkRouter

Defined in services/dependency/sdk/router/router.ts:37

Parameters:

NameType
aDepsSdkRouterDependencies

Returns: SdkRouter

Properties

activeRenderingContext

● activeRenderingContext: function

Defined in services/dependency/sdk/router/router.ts:35

Type declaration

▸(): Observable<RenderingContext>

Returns: Observable<RenderingContext>

activeRoute

● activeRoute: function

Defined in services/dependency/sdk/router/router.ts:28

Type declaration

▸(): Observable<SitePage>

Returns: Observable<SitePage>

destroy

● destroy: function

Defined in services/dependency/sdk/router/router.ts:37

Type declaration

▸(): void

Returns: void

navigateByPath

● navigateByPath: function

Defined in services/dependency/sdk/router/router.ts:21

Type declaration

▸(aPath: string): PromiseLike<boolean>

Parameters:

NameType
aPathstring

Returns: PromiseLike<boolean>

@ibm-wch-sdk/ng > "services/dependency/sdk/router/router" > SdkRouterDependencies

Interface: SdkRouterDependencies

Hierarchy

SdkRouterDependencies

SdkDependencies

Index

Properties

Properties

router

● router: Router

Defined in services/dependency/sdk/router/router.ts:15

@ibm-wch-sdk/ng > "services/dependency/sdk/version" > SdkVersion

Interface: SdkVersion

Hierarchy

WchSdkVersion

↳ SdkVersion

Index

Properties

Properties

build

● build: Date

Overrides WchSdkVersion.build

Defined in services/dependency/sdk/version.ts:9

version

● version: Version

Overrides WchSdkVersion.version

Defined in services/dependency/sdk/version.ts:8

@ibm-wch-sdk/ng > "services/dependency/sdk/sdk" > Sdk

Class: Sdk

Hierarchy

Sdk

Implements

  • WchSdk

Index

Constructors

Properties

Accessors

Constructors

constructor

new Sdk(aDeps: SdkDependencies): Sdk

Defined in services/dependency/sdk/sdk.ts:54

Parameters:

NameType
aDepsSdkDependencies

Returns: Sdk

Properties

destroy

● destroy: function

Defined in services/dependency/sdk/sdk.ts:46

Type declaration

▸(): void

Returns: void

refresh

● refresh: function

Defined in services/dependency/sdk/sdk.ts:42

Type declaration

▸(): void

Returns: void

<Private> sdkJsonp

● sdkJsonp: SdkJsonp

Defined in services/dependency/sdk/sdk.ts:50

<Private> sdkLogger

● sdkLogger: LoggerService

Defined in services/dependency/sdk/sdk.ts:52

<Private> sdkRouter

● sdkRouter: SdkRouter

Defined in services/dependency/sdk/sdk.ts:48

<Private> sdkSearch

● sdkSearch: SdkSearch

Defined in services/dependency/sdk/sdk.ts:54

<Static> MODULE_NAME

● MODULE_NAME: "WchSdk" = _MODULE_NAME

Defined in services/dependency/sdk/sdk.ts:35

Accessors

jsonp

get jsonp(): SdkJsonp

Defined in services/dependency/sdk/sdk.ts:134

Returns: SdkJsonp

logger

get logger(): LoggerService

Defined in services/dependency/sdk/sdk.ts:138

Returns: LoggerService

router

get router(): SdkRouter

Defined in services/dependency/sdk/sdk.ts:130

Returns: SdkRouter

get search(): SdkSearch

Defined in services/dependency/sdk/sdk.ts:142

Returns: SdkSearch

version

get version(): SdkVersion

Defined in services/dependency/sdk/sdk.ts:151

Returns: SdkVersion

@ibm-wch-sdk/ng > "services/dependency/sdk/sdk" > SdkDependencies

Interface: SdkDependencies

Hierarchy

SdkRouterDependencies

SdkJsonpDependencies

SdkSearchDependencies

↳ SdkDependencies

Index

Properties

Properties

loggerService

● loggerService: LoggerService

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

msgHandlers

● msgHandlers: Generator<SdkMessageHandler[]>

Defined in services/dependency/sdk/sdk.ts:23

router

● router: Router

Inherited from SdkRouterDependencies.router

Defined in services/dependency/sdk/router/router.ts:15

urlsService

● urlsService: UrlConfig

Inherited from SdkJsonpDependencies.urlsService

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

wchService

● wchService: WchService

Overrides SdkSearchDependencies.wchService

Defined in services/dependency/sdk/sdk.ts:21

@ibm-wch-sdk/ng > "services/http/http.service" > WchHttpService

Class: WchHttpService

Hierarchy

WchHttpService

Index

Constructors

Properties

Constructors

constructor

new WchHttpService(aWchService: WchService): WchHttpService

Defined in services/http/http.service.ts:25

Parameters:

NameType
aWchServiceWchService

Returns: WchHttpService

Properties

getJsonResource

● getJsonResource: function

Defined in services/http/http.service.ts:17

Fetches a JSON resource and keeps this live based on the given or the default options

param: the URL to fetch, this can be a relative URL in which case it applies to the correct base API URL

returns: an observable with the content

Type declaration

▸<T>(aUrl: string, aOptions?: HttpResourceOptions): Observable<T>

Type parameters:

T

Parameters:

NameType
aUrlstring
Optional aOptionsHttpResourceOptions

Returns: Observable<T>

getTextResource

● getTextResource: function

Defined in services/http/http.service.ts:25

Fetches a string resource and keeps this live based on the given or the default options

param: the URL to fetch, this can be a relative URL in which case it applies to the correct base API URL

returns: an observable with the content

Type declaration

▸(aUrl: string, aOptions?: HttpResourceOptions): Observable<string>

Parameters:

NameType
aUrlstring
Optional aOptionsHttpResourceOptions

Returns: Observable<string>

@ibm-wch-sdk/ng > "services/http/http.service.on.http.client" > HttpServiceOnHttpClient

Class: HttpServiceOnHttpClient

Hierarchy

HttpServiceOnHttpClient

Implements

  • HttpService

Index

Constructors

Properties

Constructors

constructor

new HttpServiceOnHttpClient(aHttpClient: HttpClient): HttpServiceOnHttpClient

Defined in services/http/http.service.on.http.client.ts:16

Parameters:

NameType
aHttpClientHttpClient

Returns: HttpServiceOnHttpClient

Properties

getJson

● getJson: function

Defined in services/http/http.service.on.http.client.ts:15

Type declaration

▸<T>(aUrl: string, aOptions: HttpOptions): Observable<T>

Type parameters:

T

Parameters:

NameType
aUrlstring
aOptionsHttpOptions

Returns: Observable<T>

getText

● getText: function

Defined in services/http/http.service.on.http.client.ts:16

Type declaration

▸(aUrl: string, aOptions: HttpOptions): Observable<string>

Parameters:

NameType
aUrlstring
aOptionsHttpOptions

Returns: Observable<string>

@ibm-wch-sdk/ng > "services/dependency/sdk/search/search" > SdkSearch

Class: SdkSearch

Hierarchy

SdkSearch

Implements

  • WchSdkSearch

Index

Constructors

Properties

Constructors

constructor

new SdkSearch(aDeps: SdkSearchDependencies): SdkSearch

Defined in services/dependency/sdk/search/search.ts:23

Parameters:

NameType
aDepsSdkSearchDependencies

Returns: SdkSearch

Properties

getRenderingContextById

● getRenderingContextById: function

Defined in services/dependency/sdk/search/search.ts:21

Type declaration

▸(aId: string, aLevels?: number): Observable<RenderingContext>

Parameters:

NameType
aIdstring
Optional aLevelsnumber

Returns: Observable<RenderingContext>

getRenderingContexts

● getRenderingContexts: function

Defined in services/dependency/sdk/search/search.ts:22

Type declaration

▸(aValue: QueryInput, aLevels?: number): Observable<RenderingContextQueryResult>

Parameters:

NameType
aValueQueryInput
Optional aLevelsnumber

Returns: Observable<RenderingContextQueryResult>

getSitePages

● getSitePages: function

Defined in services/dependency/sdk/search/search.ts:23

Type declaration

▸(aValue: QueryInput): Observable<SitePagesQueryResult>

Parameters:

NameType
aValueQueryInput

Returns: Observable<SitePagesQueryResult>

@ibm-wch-sdk/ng > "services/dependency/sdk/search/search" > SdkSearchDependencies

Interface: SdkSearchDependencies

Hierarchy

SdkSearchDependencies

SdkDependencies

Index

Properties

Properties

wchService

● wchService: WchService

Defined in services/dependency/sdk/search/search.ts:15

@ibm-wch-sdk/ng > "services/http/http.service.on.jsonp" > HttpServiceOnJsonp

Class: HttpServiceOnJsonp

dynamic:

Hierarchy

HttpServiceOnJsonp

Implements

  • HttpService

Index

Constructors

Properties

Constructors

constructor

new HttpServiceOnJsonp(aDocument: Document, aHttpClient: HttpClient, aZoneService: ZoneService): HttpServiceOnJsonp

Defined in services/http/http.service.on.jsonp.ts:27

Parameters:

NameType
aDocumentDocument
aHttpClientHttpClient
aZoneServiceZoneService

Returns: HttpServiceOnJsonp

Properties

getJson

● getJson: function

Defined in services/http/http.service.on.jsonp.ts:26

Type declaration

▸<T>(aUrl: string, aOptions: HttpOptions): Observable<T>

Type parameters:

T

Parameters:

NameType
aUrlstring
aOptionsHttpOptions

Returns: Observable<T>

getText

● getText: function

Defined in services/http/http.service.on.jsonp.ts:27

Type declaration

▸(aUrl: string, aOptions: HttpOptions): Observable<string>

Parameters:

NameType
aUrlstring
aOptionsHttpOptions

Returns: Observable<string>

@ibm-wch-sdk/ng > "services/hub-info/hub-info.service" > HubInfoService

Class: HubInfoService

Hierarchy

HubInfoService

Implements

  • HubInfoConfig

Index

Constructors

Properties

Constructors

constructor

new HubInfoService(aApiUrl: HubInfoUrlProvider, aDeliveryUrl: HubInfoUrlProvider, aBaseUrl: HubInfoUrlProvider, aHttpOptions: HttpResourceOptions, aHttpPreviewOptions: HttpResourceOptions, aCycleHandlingStrategy: CYCLE_HANDLING | string, aFetchLevels: number): HubInfoService

Defined in services/hub-info/hub-info.service.ts:81

Parameters:

NameType
aApiUrlHubInfoUrlProvider
aDeliveryUrlHubInfoUrlProvider
aBaseUrlHubInfoUrlProvider
aHttpOptionsHttpResourceOptions
aHttpPreviewOptionsHttpResourceOptions
aCycleHandlingStrategyCYCLE_HANDLING | string
aFetchLevelsnumber

Returns: HubInfoService

Properties

<Optional> apiUrl

● apiUrl: HubInfoUrlProvider

Defined in services/hub-info/hub-info.service.ts:29

URL to access the API layer

Naming of this field according to the field in the rendering context

example: 'https://my.digitalexperience.ibm.com/api/345563cf-a83c-40e5-a065-1d6ff36b05c1'

example: 'https://my.digitalexperience.ibm.com/api/345563cf-a83c-40e5-a065-1d6ff36b05c1/dxsites/mysite'

<Optional> baseUrl

● baseUrl: HubInfoUrlProvider

Defined in services/hub-info/hub-info.service.ts:50

URL that represents the base URL of the path based routing of the application. This prefix will be preserved when generating and recognizing URLs. If this property is not configured, then it will be decoded from the window location.

example: 'https://my.digitalexperience.ibm.com/345563cf-a83c-40e5-a065-1d6ff36b05c1'

example: 'https://my.digitalexperience.ibm.com/345563cf-a83c-40e5-a065-1d6ff36b05c1/dxsites/mysite'

example: 'https://my.external.example.com/'

<Optional> cycleHandlingStrategy

● cycleHandlingStrategy: CYCLE_HANDLING | string

Defined in services/hub-info/hub-info.service.ts:75

Optionally specify how the SDK is supposed to deal with cyclic references in the content data structure. Per default the rendering context will break cycles by representing the duplicate element in a reference path by an unresolved reference. When configuring the strategy to {@link CYCLE_HANDLING.RESOLVE}, the ContentrefComponent will use a resolved refence when rendering the context, instead of the unresolved reference. This bears the risk of an infinite loop during rendering. The actual rendering context objects will still not have cycles, so a JSON serialization of these objects will produce a valid result.

Default is {@link CYCLE_HANDLING.BREAK}

<Optional> deliveryUrl

● deliveryUrl: HubInfoUrlProvider

Defined in services/hub-info/hub-info.service.ts:39

URL to access the delivery

Naming of this field according to the field in the rendering context

example: 'https://my.digitalexperience.ibm.com/345563cf-a83c-40e5-a065-1d6ff36b05c1'

example: 'https://my.digitalexperience.ibm.com/345563cf-a83c-40e5-a065-1d6ff36b05c1/dxsites/mysite'

<Optional> fetchLevels

● fetchLevels: number

Defined in services/hub-info/hub-info.service.ts:81

Number of levels to fetch per request to the rendering context. If missing all levels will be fetched.

<Optional> httpOptions

● httpOptions: HttpResourceOptions

Defined in services/hub-info/hub-info.service.ts:55

Optionally specify how the SDK makes outbound requests

<Optional> httpPreviewOptions

● httpPreviewOptions: HttpResourceOptions

Defined in services/hub-info/hub-info.service.ts:60

Optionally specify how the SDK makes outbound requests for the preview case

@ibm-wch-sdk/ng > "services/info/wch.info.service" > WchInfoService

Class: WchInfoService

Hierarchy

WchInfoService

Implements

  • UrlConfig

Index

Constructors

Properties

Constructors

constructor

new WchInfoService(wchService: WchService): WchInfoService

Defined in services/info/wch.info.service.ts:15

Parameters:

NameType
wchServiceWchService

Returns: WchInfoService

Properties

apiUrl

● apiUrl: URL

Defined in services/info/wch.info.service.ts:11

some global infos. See definitions in UrlConfig

<Optional> baseUrl

● baseUrl: URL

Defined in services/info/wch.info.service.ts:15

deliveryUrl

● deliveryUrl: URL

Defined in services/info/wch.info.service.ts:12

isPreviewMode

● isPreviewMode: boolean

Defined in services/info/wch.info.service.ts:13

@ibm-wch-sdk/ng > "services/logger/wch.logger.service" > WchLoggerService

Class: WchLoggerService

Hierarchy

WchLoggerService

Implements

  • LoggerService

Index

Constructors

Properties

Constructors

constructor

new WchLoggerService(): WchLoggerService

Defined in services/logger/wch.logger.service.ts:24

Returns: WchLoggerService

Properties

get

● get: function

Defined in services/logger/wch.logger.service.ts:24

Type declaration

▸(name: string): Logger

Parameters:

NameType
namestring

Returns: Logger

@ibm-wch-sdk/ng > "services/logger/logger.service" > LoggerProxy

Class: LoggerProxy

Implementation of the logger service. The service accepts either a {@link LoggerFactory} or a {@link DynamicLoggerFactory} as initialization parameters to dynamically replace logger instances.

Hierarchy

LoggerProxy

Implements

  • OnDestroy

Index

Constructors

Properties

Methods

Constructors

constructor

new LoggerProxy(aInjector: Injector): LoggerProxy

Defined in services/logger/logger.service.ts:124

Parameters:

NameType
aInjectorInjector

Returns: LoggerProxy

Properties

<Private> _fctSubscription

● _fctSubscription: Subscription

Defined in services/logger/logger.service.ts:124

Methods

get

get(name: string): Logger

Defined in services/logger/logger.service.ts:151

Parameters:

NameType
namestring

Returns: Logger

ngOnDestroy

ngOnDestroy(): void

Defined in services/logger/logger.service.ts:155

Returns: void

@ibm-wch-sdk/ng > "services/markup/markup.service" > MarkupService

Class: MarkupService

Hierarchy

MarkupService

Implements

  • OnDestroy

Index

Constructors

Accessors

Methods

Constructors

constructor

new MarkupService(): MarkupService

Defined in services/markup/markup.service.ts:24

Returns: MarkupService

Accessors

markupProviders

get markupProviders(): MarkupProviders

Defined in services/markup/markup.service.ts:29

Returns: MarkupProviders

Methods

ngOnDestroy

ngOnDestroy(): void

Defined in services/markup/markup.service.ts:41

Returns: void

registerProvider

registerProvider(aLayoutType: string, aProvider: MarkupProvider): void

Defined in services/markup/markup.service.ts:33

Parameters:

NameType
aLayoutTypestring
aProviderMarkupProvider

Returns: void

@ibm-wch-sdk/ng > "services/markup/markup.service" > MarkupProvider

Interface: MarkupProvider

Hierarchy

MarkupProvider

Index

Methods

Methods

compile

compile(aURL: string, aTemplateString: string): Observable<MarkupGenerator>

Defined in services/markup/markup.service.ts:13

Parameters:

NameType
aURLstring
aTemplateStringstring

Returns: Observable<MarkupGenerator>

getComponentTypeRef

getComponentTypeRef(): ComponentTypeRef<any>

Defined in services/markup/markup.service.ts:14

Returns: ComponentTypeRef<any>

@ibm-wch-sdk/ng > "services/markup/markup.service" > MarkupProviders

Interface: MarkupProviders

Hierarchy

MarkupProviders

Indexable

[layoutType: string]: MarkupProvider

Index

@ibm-wch-sdk/ng > "services/mappings/mappings.service" > Mappings

Interface: Mappings

Hierarchy

Mappings

Index

Properties

Properties

byId

● byId: Record<string, MappingEntry>

Defined in services/mappings/mappings.service.ts:34

byKind

● byKind: Record<string, MappingEntry>

Defined in services/mappings/mappings.service.ts:35

@ibm-wch-sdk/ng > "utils/component.mapping.utils" > RegisteredMapping

Interface: RegisteredMapping

Hierarchy

RegisteredMapping

Index

Properties

Properties

<Optional> id

● id: string | string[]

Defined in utils/component.mapping.utils.ts:32

Type IDs or content IDs to map this to

<Optional> kind

● kind: CONTENT_ITEM_KIND | CONTENT_ITEM_KIND[]

Defined in utils/component.mapping.utils.ts:37

Type IDs to map this to

<Optional> layoutMode

● layoutMode: string | string[]

Defined in utils/component.mapping.utils.ts:27

selector

● selector: string | string[] | Type<any>

Defined in utils/component.mapping.utils.ts:22

@ibm-wch-sdk/ng > "services/page/active.page.service" > ActivePageService

Class: ActivePageService

Hierarchy

ActivePageService

Implements

  • ActivePage
  • OnDestroy

Index

Accessors

Methods

Accessors

onRenderingContext

get onRenderingContext(): Observable<RenderingContext>

Defined in services/page/active.page.service.ts:22

Returns: Observable<RenderingContext>

Methods

ngOnDestroy

ngOnDestroy(): void

Defined in services/page/active.page.service.ts:29

Returns: void

@ibm-wch-sdk/ng > "services/refresh/refresh.service" > RefreshService

Class: RefreshService

Hierarchy

RefreshService

Index

Constructors

Properties

Constructors

constructor

new RefreshService(aWchService: WchService): RefreshService

Defined in services/refresh/refresh.service.ts:18

Parameters:

NameType
aWchServiceWchService

Returns: RefreshService

Properties

refresh

● refresh: function

Defined in services/refresh/refresh.service.ts:18

Type declaration

▸(): void

Returns: void

@ibm-wch-sdk/ng > "services/resolver/content.resolver.service" > ContentResolverService

Class: ContentResolverService

Hierarchy

ContentResolverService

Index

Constructors

Properties

Constructors

constructor

new ContentResolverService(wchService: WchService): ContentResolverService

Defined in services/resolver/content.resolver.service.ts:14

Parameters:

NameType
wchServiceWchService

Returns: ContentResolverService

Properties

resolveRenderingContext

● resolveRenderingContext: function

Defined in services/resolver/content.resolver.service.ts:13

Type declaration

▸(aRenderingContext?: RenderingContext, aStrategy?: CYCLE_HANDLING): Observable<RenderingContext | null | undefined>

Parameters:

NameType
Optional aRenderingContextRenderingContext
Optional aStrategyCYCLE_HANDLING

Returns: Observable<RenderingContext | null | undefined>

@ibm-wch-sdk/ng > "services/search/search.service" > SearchService

Class: SearchService

Hierarchy

SearchService

Implements

  • WchSdkSearch

Index

Constructors

Properties

Constructors

constructor

new SearchService(wchService: WchService): SearchService

Defined in services/search/search.service.ts:25

Parameters:

NameType
wchServiceWchService

Returns: SearchService

Properties

getRenderingContextById

● getRenderingContextById: function

Defined in services/search/search.service.ts:17

Type declaration

▸(aId: string, aLevels?: number): Observable<RenderingContext>

Parameters:

NameType
aIdstring
Optional aLevelsnumber

Returns: Observable<RenderingContext>

getRenderingContexts

● getRenderingContexts: function

Defined in services/search/search.service.ts:21

Type declaration

▸(aValue: QueryInput, aLevels?: number): Observable<RenderingContextQueryResult>

Parameters:

NameType
aValueQueryInput
Optional aLevelsnumber

Returns: Observable<RenderingContextQueryResult>

getSitePages

● getSitePages: function

Defined in services/search/search.service.ts:25

Type declaration

▸(aValue: QueryInput): Observable<SitePagesQueryResult>

Parameters:

NameType
aValueQueryInput

Returns: Observable<SitePagesQueryResult>

@ibm-wch-sdk/ng > "services/storage/storage.service" > StorageService

Class: StorageService

Hierarchy

ClientStorageService

↳ StorageService

Implements

  • ClientStorage
  • ClientStorage

Index

Constructors

Properties

Constructors

constructor

new StorageService(aUrlsService: UrlsService): StorageService

Overrides ClientStorageService.__constructor

Defined in services/storage/storage.service.ts:10

Parameters:

NameType
aUrlsServiceUrlsService

Returns: StorageService

Properties

get

● get: function

Inherited from ClientStorageService.get

Defined in /usr/build/node_modules/@ibm-wch-sdk/utils/src/storage/storage.service.d.ts:5

Type declaration

▸(aKey: string): AnyJson

Parameters:

NameType
aKeystring

Returns: AnyJson

put

● put: function

Inherited from ClientStorageService.put

Defined in /usr/build/node_modules/@ibm-wch-sdk/utils/src/storage/storage.service.d.ts:6

Type declaration

▸(aKey: string, aValue: AnyJson): void

Parameters:

NameType
aKeystring
aValueAnyJson

Returns: void

@ibm-wch-sdk/ng > "services/url/urls.service" > UrlsService

Class: UrlsService

Implementation of a service that decodes the relevant URLs

dynamic:

Hierarchy

UrlsService

Implements

  • UrlConfig

Index

Constructors

Properties

Constructors

constructor

new UrlsService(aBaseUrl: HubInfoUrlProvider, aApiUrl: HubInfoUrlProvider, aDeliveryUrl: HubInfoUrlProvider, aDocument: Document): UrlsService

Defined in services/url/urls.service.ts:56

Parameters:

NameType
aBaseUrlHubInfoUrlProvider
aApiUrlHubInfoUrlProvider
aDeliveryUrlHubInfoUrlProvider
aDocumentDocument

Returns: UrlsService

Properties

apiUrl

● apiUrl: URL

Defined in services/url/urls.service.ts:37

The API URL to content hub

<Optional> baseUrl

● baseUrl: URL

Defined in services/url/urls.service.ts:48

The base URL of the host the application is running on. This can be undefined if the application is rendered standalone as part of the universal renderer.

deliveryUrl

● deliveryUrl: URL

Defined in services/url/urls.service.ts:42

The Delivery URL to content hub

isPreviewMode

● isPreviewMode: boolean

Defined in services/url/urls.service.ts:56

True if the system runs in preview mode, else false.

<Optional> resourceUrl

● resourceUrl: URL

Defined in services/url/urls.service.ts:53

The base URL of the document, this is the URL that is used as the basis for static resources in the application

@ibm-wch-sdk/ng > "services/wch.service" > WchService

Class: WchService

Hierarchy

WchService

Implements

  • OnDestroy

Index

Constructors

Properties

Constructors

constructor

new WchService(aHttp: HttpService, aJsonp: HttpService, wchConfig: HubInfoService, aUrlService: UrlsService, clientStorage: StorageService, bootstrapService: BootstrapService, markupProviderService: MarkupService, zoneService: ZoneService, loggerService: WchLoggerService, aInjector: Injector): WchService

Defined in services/wch.service.ts:234

Parameters:

NameType
aHttpHttpService
aJsonpHttpService
wchConfigHubInfoService
aUrlServiceUrlsService
clientStorageStorageService
bootstrapServiceBootstrapService
markupProviderServiceMarkupService
zoneServiceZoneService
loggerServiceWchLoggerService
aInjectorInjector

Returns: WchService

Properties

<Protected> createPollingTrigger

● createPollingTrigger: function

Defined in services/wch.service.ts:232

Type declaration

▸(aOptions?: HttpResourceOptions): Observable<any>

Parameters:

NameType
Optional aOptionsHttpResourceOptions

Returns: Observable<any>

getApiUrl

● getApiUrl: function

Defined in services/wch.service.ts:183

Type declaration

▸(): URL

Returns: URL

getAppConfig

● getAppConfig: function

Defined in services/wch.service.ts:188

Type declaration

▸(): Observable<ApplicationConfig>

Returns: Observable<ApplicationConfig>

getBaseUrl

● getBaseUrl: function

Defined in services/wch.service.ts:185

Type declaration

▸(): URL | undefined

Returns: URL | undefined

getCorsWhitelist

● getCorsWhitelist: function

Defined in services/wch.service.ts:217

Type declaration

▸(): Observable<string[]>

Returns: Observable<string[]>

getDeliverOrigin

● getDeliverOrigin: function

Defined in services/wch.service.ts:187

Type declaration

▸(): string

Returns: string

getDeliveryUrl

● getDeliveryUrl: function

Defined in services/wch.service.ts:184

Type declaration

▸(): URL

Returns: URL

getJsonResource

● getJsonResource: function

Defined in services/wch.service.ts:218

Type declaration

▸<T>(aUrl: string, aOptions?: HttpResourceOptions): Observable<T>

Type parameters:

T

Parameters:

NameType
aUrlstring
Optional aOptionsHttpResourceOptions

Returns: Observable<T>

getRenderingContextByActivatedRoute

● getRenderingContextByActivatedRoute: function

Defined in services/wch.service.ts:205

Type declaration

▸(aRoute: ActivatedRoute, aLevels?: number): Observable<RenderingContext | null | undefined>

Parameters:

NameType
aRouteActivatedRoute
Optional aLevelsnumber

Returns: Observable<RenderingContext | null | undefined>

getRenderingContextById

● getRenderingContextById: function

Defined in services/wch.service.ts:189

Type declaration

▸(aID: string | null | undefined, aLevels?: number): Observable<RenderingContext | null | undefined>

Parameters:

NameType
aIDstring | null | undefined
Optional aLevelsnumber

Returns: Observable<RenderingContext | null | undefined>

getRenderingContextByPage

● getRenderingContextByPage: function

Defined in services/wch.service.ts:201

Type declaration

▸(aPage: SitePage, aLevels?: number): Observable<RenderingContext | null | undefined>

Parameters:

NameType
aPageSitePage
Optional aLevelsnumber

Returns: Observable<RenderingContext | null | undefined>

getRenderingContextByPath

● getRenderingContextByPath: function

Defined in services/wch.service.ts:197

Type declaration

▸(aPath: string, aLevels?: number): Observable<RenderingContext | null | undefined>

Parameters:

NameType
aPathstring
Optional aLevelsnumber

Returns: Observable<RenderingContext | null | undefined>

getRenderingContextByUrlSegments

● getRenderingContextByUrlSegments: function

Defined in services/wch.service.ts:193

Type declaration

▸(aSegments: UrlSegment[], aLevels?: number): Observable<RenderingContext | null | undefined>

Parameters:

NameType
aSegmentsUrlSegment[]
Optional aLevelsnumber

Returns: Observable<RenderingContext | null | undefined>

getRenderingContextForAppConfig

● getRenderingContextForAppConfig: function

Defined in services/wch.service.ts:209

Type declaration

▸(aLevels?: number): Observable<RenderingContext>

Parameters:

NameType
Optional aLevelsnumber

Returns: Observable<RenderingContext>

getRenderingContextsByQuery

● getRenderingContextsByQuery: function

Defined in services/wch.service.ts:212

Type declaration

▸(aQuery: string, aLevels?: number): Observable<RenderingContextQueryResult>

Parameters:

NameType
aQuerystring
Optional aLevelsnumber

Returns: Observable<RenderingContextQueryResult>

getSitePagesByQuery

● getSitePagesByQuery: function

Defined in services/wch.service.ts:216

Type declaration

▸(aQuery: string): Observable<SitePagesQueryResult>

Parameters:

NameType
aQuerystring

Returns: Observable<SitePagesQueryResult>

getTextResource

● getTextResource: function

Defined in services/wch.service.ts:222

Type declaration

▸(aUrl: string, aOptions?: HttpResourceOptions): Observable<string>

Parameters:

NameType
aUrlstring
Optional aOptionsHttpResourceOptions

Returns: Observable<string>

isPreviewMode

● isPreviewMode: function

Defined in services/wch.service.ts:186

Type declaration

▸(): boolean

Returns: boolean

ngOnDestroy

● ngOnDestroy: function

Defined in services/wch.service.ts:179

Type declaration

▸(): void

Returns: void

resolveRenderingContext

● resolveRenderingContext: function

Defined in services/wch.service.ts:226

Type declaration

▸(aRenderingContext?: RenderingContext, aStrategy?: CYCLE_HANDLING): Observable<RenderingContext | null | undefined>

Parameters:

NameType
Optional aRenderingContextRenderingContext
Optional aStrategyCYCLE_HANDLING

Returns: Observable<RenderingContext | null | undefined>

triggerRefresh

● triggerRefresh: function

Defined in services/wch.service.ts:182

Type declaration

▸(): void

Returns: void

@ibm-wch-sdk/ng > "services/zone/zone.service" > ZoneService

Class: ZoneService

Service that exposes schedulers and operators that allow client code to run inside or outside of angular zone.

Hierarchy

ZoneService

Index

Constructors

Properties

Constructors

constructor

new ZoneService(aZone: NgZone): ZoneService

Defined in services/zone/zone.service.ts:29

Parameters:

NameType
aZoneNgZone

Returns: ZoneService

Properties

insideScheduler

● insideScheduler: SchedulerLike

Defined in services/zone/zone.service.ts:16

observeInside

● observeInside: function

Defined in services/zone/zone.service.ts:24

Operator to run the observer inside of a zone

Type declaration

▸<T>(): MonoTypeOperatorFunction<T>

Type parameters:

T

Returns: MonoTypeOperatorFunction<T>

outsideScheduler

● outsideScheduler: SchedulerLike

Defined in services/zone/zone.service.ts:19

subscribeOutside

● subscribeOutside: function

Defined in services/zone/zone.service.ts:29

Operator to subscribe outside of a zone

Type declaration

▸<T>(): MonoTypeOperatorFunction<T>

Type parameters:

T

Returns: MonoTypeOperatorFunction<T>

@ibm-wch-sdk/ng > "utils/component.utils" > RegisteredComponent

Interface: RegisteredComponent

Hierarchy

RegisteredComponent

Index

Properties

Properties

directive

● directive: LayoutComponentDirective

Defined in utils/component.utils.ts:76

type

● type: Type<any>

Defined in utils/component.utils.ts:77

@ibm-wch-sdk/ng > "utils/http.service.on.jsonp" > PendingRequests

Interface: PendingRequests

Hierarchy

PendingRequests

Indexable

[url: string]: Observable<any>

Index

@ibm-wch-sdk/ng > "utils/markup.utils" > Markup

Interface: Markup

Hierarchy

Markup

Index

Properties

Properties

componentId

● componentId: string

Defined in utils/markup.utils.ts:15

layoutMode

● layoutMode: string

Defined in utils/markup.utils.ts:16

markup

● markup: string | undefined

Defined in utils/markup.utils.ts:18

template

● template: MarkupGenerator | undefined

Defined in utils/markup.utils.ts:19

templateRef

● templateRef: string

Defined in utils/markup.utils.ts:17

@ibm-wch-sdk/ng > "utils/markup.utils" > MarkupMapping

Interface: MarkupMapping

Hierarchy

MarkupMapping

Index

Properties

Properties

byId

● byId: object

Defined in utils/markup.utils.ts:29

Type declaration

byTemplate

● byTemplate: object

Defined in utils/markup.utils.ts:28

Type declaration

@ibm-wch-sdk/ng > "utils/markup.utils" > MarkupRef

Interface: MarkupRef

Hierarchy

MarkupRef

Index

Properties

Properties

markupRef

● markupRef: Markup

Defined in utils/markup.utils.ts:24

provider

● provider: MarkupProvider

Defined in utils/markup.utils.ts:23

@ibm-wch-sdk/ng > "utils/rx.utils" > AbstractNgInZoneScheduler

Class: AbstractNgInZoneScheduler

Implements a scheduler that runs the work inside or outside an angular zone.

Hierarchy

AbstractNgInZoneScheduler

NgInZoneScheduler

NgOutOfZoneScheduler

Implements

  • SchedulerLike

Index

Constructors

Properties

Methods

Constructors

constructor

new AbstractNgInZoneScheduler(aZone: NgZone, aDelegate?: SchedulerLike): AbstractNgInZoneScheduler

Defined in utils/rx.utils.ts:36

Parameters:

NameType
aZoneNgZone
Optional aDelegateSchedulerLike

Returns: AbstractNgInZoneScheduler

Properties

<Private> delegate

● delegate: SchedulerLike

Defined in utils/rx.utils.ts:34

<Private> zone

● zone: NgZone

Defined in utils/rx.utils.ts:36

Methods

<Protected>``<Abstract> doRun

doRun(zone: NgZone, cb: function): Subscription

Defined in utils/rx.utils.ts:55

Parameters:

NameType
zoneNgZone
cbfunction

Returns: Subscription

now

now(): number

Defined in utils/rx.utils.ts:44

Returns: number

schedule

schedule<T>(work: function, delay?: number, state?: T): Subscription

Defined in utils/rx.utils.ts:48

Type parameters:

T

Parameters:

NameType
workfunction
Optional delaynumber
Optional stateT

Returns: Subscription

@ibm-wch-sdk/ng > "utils/rx.utils" > NgInZoneScheduler

Class: NgInZoneScheduler

Hierarchy

AbstractNgInZoneScheduler

↳ NgInZoneScheduler

Implements

  • SchedulerLike

Index

Constructors

Methods

Constructors

constructor

new NgInZoneScheduler(aZone: NgZone, aDelegate?: SchedulerLike): NgInZoneScheduler

Overrides AbstractNgInZoneScheduler.constructor

Defined in utils/rx.utils.ts:59

Parameters:

NameType
aZoneNgZone
Optional aDelegateSchedulerLike

Returns: NgInZoneScheduler

Methods

<Protected> doRun

doRun(zone: NgZone, cb: function): Subscription

Overrides AbstractNgInZoneScheduler.doRun

Defined in utils/rx.utils.ts:65

Parameters:

NameType
zoneNgZone
cbfunction

Returns: Subscription

now

now(): number

Inherited from AbstractNgInZoneScheduler.now

Defined in utils/rx.utils.ts:44

Returns: number

schedule

schedule<T>(work: function, delay?: number, state?: T): Subscription

Inherited from AbstractNgInZoneScheduler.schedule

Defined in utils/rx.utils.ts:48

Type parameters:

T

Parameters:

NameType
workfunction
Optional delaynumber
Optional stateT

Returns: Subscription

@ibm-wch-sdk/ng > "utils/rx.utils" > NgOutOfZoneScheduler

Class: NgOutOfZoneScheduler

Hierarchy

AbstractNgInZoneScheduler

↳ NgOutOfZoneScheduler

Implements

  • SchedulerLike

Index

Constructors

Methods

Constructors

constructor

new NgOutOfZoneScheduler(aZone: NgZone, aDelegate?: SchedulerLike): NgOutOfZoneScheduler

Overrides AbstractNgInZoneScheduler.constructor

Defined in utils/rx.utils.ts:70

Parameters:

NameType
aZoneNgZone
Optional aDelegateSchedulerLike

Returns: NgOutOfZoneScheduler

Methods

<Protected> doRun

doRun(zone: NgZone, cb: function): Subscription

Overrides AbstractNgInZoneScheduler.doRun

Defined in utils/rx.utils.ts:76

Parameters:

NameType
zoneNgZone
cbfunction

Returns: Subscription

now

now(): number

Inherited from AbstractNgInZoneScheduler.now

Defined in utils/rx.utils.ts:44

Returns: number

schedule

schedule<T>(work: function, delay?: number, state?: T): Subscription

Inherited from AbstractNgInZoneScheduler.schedule

Defined in utils/rx.utils.ts:48

Type parameters:

T

Parameters:

NameType
workfunction
Optional delaynumber
Optional stateT

Returns: Subscription

@ibm-wch-sdk/ng > "utils/rx.utils" > ZoneSchedulers

Interface: ZoneSchedulers

Hierarchy

ZoneSchedulers

Index

Properties

Properties

inside

● inside: SchedulerLike

Defined in utils/rx.utils.ts:82

outside

● outside: SchedulerLike

Defined in utils/rx.utils.ts:83

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

@ibm-wch-sdk/ng > "services/config/application.config" > ApplicationConfig

Interface: ApplicationConfig

Hierarchy

ContentItem

↳ ApplicationConfig

Index

Properties

Properties

classification

● classification: string

Overrides BaseDeliveryItem.classification

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

<Optional> created

● created: string

Inherited from BaseDeliveryItem.created

Defined in /usr/build/node_modules/@ibm-wch-sdk/api/interfaces/delivery/v1/base.item.d.ts:19

<Optional> creatorId

● creatorId: string

Inherited from BaseDeliveryItem.creatorId

Defined in /usr/build/node_modules/@ibm-wch-sdk/api/interfaces/delivery/v1/base.item.d.ts:20

<Optional> description

● description: string

Inherited from BaseDeliveryItem.description

Defined in /usr/build/node_modules/@ibm-wch-sdk/api/interfaces/delivery/v1/base.item.d.ts:21

<Optional> draftId

● draftId: string

Inherited from ContentItem.draftId

Defined in /usr/build/node_modules/@ibm-wch-sdk/api/interfaces/delivery/v1/content/content.item.d.ts:12

TBD

<Optional> draftStatus

● draftStatus: "pending" | "approved"

Inherited from ContentItem.draftStatus

Defined in /usr/build/node_modules/@ibm-wch-sdk/api/interfaces/delivery/v1/content/content.item.d.ts:16

TBD

elements

● elements: object

Overrides ContentItem.elements

Defined in services/config/application.config.ts:11

Type declaration

id

● id: string

Overrides BaseDeliveryItem.id

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

kind

● kind: CONTENT_ITEM_KIND[]

Inherited from ContentItem.kind

Defined in /usr/build/node_modules/@ibm-wch-sdk/api/interfaces/delivery/v1/content/content.item.d.ts:8

Kind of a content item

<Optional> lastModified

● lastModified: string

Inherited from BaseDeliveryItem.lastModified

Defined in /usr/build/node_modules/@ibm-wch-sdk/api/interfaces/delivery/v1/base.item.d.ts:17

<Optional> lastModifierId

● lastModifierId: string

Inherited from BaseDeliveryItem.lastModifierId

Defined in /usr/build/node_modules/@ibm-wch-sdk/api/interfaces/delivery/v1/base.item.d.ts:18

<Optional> locale

● locale: string

Inherited from ContentItem.locale

Defined in /usr/build/node_modules/@ibm-wch-sdk/api/interfaces/delivery/v1/content/content.item.d.ts:18

name

● name: string

Overrides BaseDeliveryItem.name

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

<Optional> rev

● rev: string

Inherited from BaseDeliveryItem.rev

Defined in /usr/build/node_modules/@ibm-wch-sdk/api/interfaces/delivery/v1/base.item.d.ts:14

<Optional> tags

● tags: Array<string>

Inherited from ContentItem.tags

Defined in /usr/build/node_modules/@ibm-wch-sdk/api/interfaces/delivery/v1/content/content.item.d.ts:19

type

● type: string

Overrides ContentItem.type

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

typeId

● typeId: string

Overrides ContentItem.typeId

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

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.
  • baseUrl: optionally the base URL of the document that served the application. This can be undefined in case the application is rendered by Angular Universal.

Note

  • This service is related to the HubInfoService but differs by the fact that the WchInfoService represents the configuration 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

SearchService

The search service allows to perform searches against the WCH index for rendering contexts or pages. The search results are kept current, 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. The resulting pages will automatically only contain pages for the current site.

References

  • the result of getRenderingContexts can be rendered using the wch-contentref component.
  • the result of getSitePages can be rendered using the wch-pageref component.

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.

Build Aspects

This section discusses aspects that are relevant for building your application.

External Hosting

When writing single page applications using the @ibm-wch-sdk/ng they are typically hosted on WCH. In this case the SDK can automatically detect the correct API URL from the URL the application has been served from.

In case the application is hosted on a custom web server, this is not possible, automatically, and the correct API URL has to be configured by the application. In this section we discuss the required configuration steps:

Configuration in the SPA

The API URL is configured in the config object passed to WchNgModule.forRoot(config) in your application root module. Typically the config object is the CLI environment object.

For externally hosted applications the API URL is different for the live mode and the preview mode of the application. It is in the responsivility of the single page application to tell what mode it is running in. Typically this is determined based on the hostname.

We recommend the following way to configure the API URL (see also documentation for @ibm-wch-sdk/utils:

environment.ts

import { HubInfoUrlProvider } from '@ibm-wch-sdk/api';
import { wchGetHubInfoUrlProvider } from '@ibm-wch-sdk/utils';

export function apiUrl(): HubInfoUrlProvider {
  return wchGetHubInfoUrlProvider(
    'https://my10.digitalexperience.ibm.com/api/6f0ce0ff-8a25-4fac-b66a-5d42516247eb',
    baseURL => /preview/.test(baseURL.href)
  );
}

export const environment = {
  apiUrl
};
  • Provide a function that returns the configuration provider. This provider computes the correct API based on the baseURL of the application and the live version of the API URL. A customer provided callback tells based on the baseURL if the application is running in live mode or in preview mode. The correct API URL will then be computed by the wchGetHubInfoUrlProvider method.
  • The live/preview mode detection callback can be omitted if you application uses the scheme https://<PREFIX>-preview.<SUFFIX> for the preview domain.
  • Register this function as apiUrl in the config object. Do NOT configure the deliveryUrl option, this will be computed based on the apiUrl automatically.

For Oslo based Applications

If your application is derived from Oslo then the live version of the API URL is configured in the /src/aps/Constants.ts class. Use this value in the example above, e.g. such as:

/src/app/environment/environment.ts:

import { HubInfoUrlProvider } from '@ibm-wch-sdk/api';
import { wchGetHubInfoUrlProvider } from '@ibm-wch-sdk/utils';
import { Constants } from '../Constants';

export function apiUrl(): HubInfoUrlProvider {
  return wchGetHubInfoUrlProvider(Constants.apiUrl, baseURL =>
    /preview/.test(baseURL.href)
  );
}

export const environment = {
  apiUrl
};
  • Make sure that your application uses the WchInfoService to access the configured API URL in the implementation code of the application. Do NOT access the Constants.apiUrl anywhere other than in the previously mentioned configuration section.

Configuration in the Site Records

The hostname of you externally hosted application has to be configured as part of the WCH Site.

  • Use wchtools to pull the site record to your local system
  • Edit the site json record and fill in the externalURL and externalPreviewURL. These values are required to be https, in order to prevent loading insecure content. Both URLs should be the full URL to where the preview site is hosted (e.g https://my-external-site.com/ or https://my-external-site.com/example-path/).
  • Push the changes back using wchtools.

URL Management

Refer to the documentation of the UrlsService to learn more about URLs in the WCH SDK.

Browse on external Domain, host on WCH

In this usecase we explore a setup in which you browse your application on your custom domain (which does not have to be managed by WCH) but you would like to host the application binaries and the content on WCH. This e.g. makes sense if you already own a domain that you would like to reuse but you'd like to benefit from the CDN capabilities of WCH to speed up delivery.

Let's assume for a sample setup a custom domain https://my.custom.domain.com and a WCH tenant with the delivery URL http://myX.digitalexperience.ibm.com/TENANTID/.

You would like to deploy your application with a context root, since it needs to run alongside other applications that you might have deployed already, so let the base URL of the application be https://my.custom.domain.com/my-app/.

Following this nomenclature this leads to the following URL configuration:

TypeURL
apiUrlhttp://myX.digitalexperience.ibm.com/api/TENANTID/
deliveryUrlhttp://myX.digitalexperience.ibm.com/TENANTID/
baseUrlhttps://my.custom.domain.com/my-app/
resourceUrlhttp://myX.digitalexperience.ibm.com/TENANTID/

Configuration in the AppModule

Do not configure any URL in the /src/app/app.module.ts.

Configuration in the Kicker File

Configure the ${baseUrl} and the ${apiUrl}? in your kicker file /src/index.html:

<!doctype html>
<html lang="en">
<head>
  <!-- used to load static resources -->
  <base href="http://myX.digitalexperience.ibm.com/TENANTID/">
  <!-- used to make API calls -->
  <link rel="wch-config-api-url" href="http://myX.digitalexperience.ibm.com/api/TENANTID/">
  <!-- basis for routing -->
  <link rel="wch-config-base-url" href="https://my.custom.domain.com/my-app/">

  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <app-root></app-root>
  <script type="text/javascript" src="main.js">
</body>
</html>

Configuration of the Server

  • Upload the kicker file (just the kicker, not the application binaries) to your web server such that it will be served from https://my.custom.domain.com/my-app/.
  • Upload the application binaries to WCH
  • Make sure you route all path requests to your kicker file at https://my.custom.domain.com/my-app/index.html. In case your server is an Apache server, add the following .htaccess file to your application root folder:

/my-app/.htaccess

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) index.html [NC,L]

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.

PagerefComponent

The page ref component renders the content item referenced by a page. The extended context for the rendering context used to render the item contains the given page and the context for the page (siblings, breadcrumb etc). So this component renders the content item in the context of the given page.

Usage

Usage in HTML:

<wch-pageref [sitePage]="..."></wch-pageref>

Attributes

  • sitePage: the page object for the page to be rendered. This can e.g. be determined via a search.
  • layoutMode: the layout mode used to render the component. If not specified the system uses a default.
  • levels: the number of levels to resolve nested rendering contexts. Defaults to -1 which means to resolve all levels.

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.

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. @ibm-wch-sdk/ng > "services/bootstrap/bootstrap.service" > BootstrapService

Class: BootstrapService

Hierarchy

BootstrapService

Implements

  • OnDestroy

Index

Constructors

Methods

Constructors

constructor

new BootstrapService(): BootstrapService

Defined in services/bootstrap/bootstrap.service.ts:18

Returns: BootstrapService

Methods

get

get(aKey: string): Observable<AnyJson>

Defined in services/bootstrap/bootstrap.service.ts:27

Parameters:

NameType
aKeystring

Returns: Observable<AnyJson>

ngOnDestroy

ngOnDestroy(): void

Defined in services/bootstrap/bootstrap.service.ts:44

Returns: void

put

put(aKey: string, aValue: AnyJson | string | ObservableInput<AnyJson> | Generator<AnyJson>): void

Defined in services/bootstrap/bootstrap.service.ts:32

Parameters:

NameType
aKeystring
aValueAnyJson | string | ObservableInput<AnyJson> | Generator<AnyJson>

Returns: void

putContentWithLayout

putContentWithLayout(aContext: ContentItemWithLayout | string): void

Defined in services/bootstrap/bootstrap.service.ts:36

Parameters:

NameType
aContextContentItemWithLayout | string

Returns: void

putSite

putSite(aSite: Site | string): void

Defined in services/bootstrap/bootstrap.service.ts:40

Parameters:

NameType
aSiteSite | string

Returns: void

@ibm-wch-sdk/ng > "services/components/components.service" > ByLayoutModeMapping

Interface: ByLayoutModeMapping

Hierarchy

ByLayoutModeMapping

Indexable

[layoutMode: string]: BySelectorMapping

Index

@ibm-wch-sdk/ng > "services/components/components.service" > BySelectorMapping

Interface: BySelectorMapping

Hierarchy

BySelectorMapping

Indexable

[selector: string]: MappingEntry

Index

@ibm-wch-sdk/ng > "services/components/components.service" > MappingEntry

Interface: MappingEntry

Hierarchy

MappingEntry

Index

Properties

Properties

ob

● ob: Observable<ComponentTypeRef<any>>

Defined in services/components/components.service.ts:35

sub

● sub: Subject<ComponentTypeRef<any>>

Defined in services/components/components.service.ts:34

The purpose of the bootstrap directives is to conveniently register initialization data objects with the BootstrapService.

RenderingContextBootstrap

This directive declares a static property of type RenderingContext as a bootrapped data set and registers it with the BootstrapService. The registration will automatically take the id into account.

class MyDataSet {
  @RenderingContextBootstrap()
  static myContent: RenderingContext = {...};
}

SiteBootstrap

This directive declares a static property of type Site as a bootrapped data set and registers it with the BootstrapService. The registration will automatically take the id into account.

class MyDataSet {
  @SiteBootstrap()
  static mySite: Site = {...};
}

Alternatively you can import the Site directly from a JSON file, the default Angular CLI build process is able to integrate this into the final bundle. This approach is more convenient, since it keeps data and code separate at development time. The JSON file can also be generated as part of a build step via the create site command from the ibm-wch-sdk-cli.

  • Make sure to define the Site JSON as a module in the typings.d.ts file, e.g. like this:
declare module "*/site.json" {
  const value: any;
  export default value;
}
  • import the JSON file in your application, e.g. in the AppModule and declare the bootstrap:
import { Site, SiteBootstrap } from 'ibm-wch-sdk-ng';
import * as DEFAULT_SITE from './../assets/delivery/v1/rendering/sites/site.json';

...

export class AppModule {

  @SiteBootstrap({siteId: 'default'})
  static mySite = DEFAULT_SITE;
}

SdkRouter

The SDK router allows to navigate to WCH pages or components.

Methods

  • navigateByPath(path: string): PromiseLike<boolean>: navigates to a WCH component given its path. The path can be read from the site information in the RenderingContext. The return value indicates when this navigation has completed.
  • activeRoute(): Observable<SitePage>: returns the active route in form of a page reference
  • activeRenderingContext(): Observable<RenderingContext>: returns the active rendering context

SdkJsonp

Support layer for making JSONP calls. This service provides means to register callback functions.

Methods

  • addCallback(url: string, cb: Function): string: registers a callback function to handle the JSONP data callback for the given URL. The method will not send any request, but will only register the callback. The resulting value is the name of the callback. Make sure to unregister the callback after it is no longer used.
  • removeCallback(aName: string): boolean: unregisters a previously registered callback. Pass in the value returned by the addCallback method.

Async Pipes vs Value Bindings

In a layout component your HTML template will need to access aspects of the RenderingContext and probably also data derived from the context.

UrlsService

Single page applications running on WCH conceptually need to distinguish the following URLs:

  • apiUrl: the base URL used to make requests against the WCH REST service. Use this URL as a prefix for all routes defined in the API documentation.
  • deliveryUrl: the base URL used to load generic static resources (e.g. images, CSS or config files) from WCH.
  • baseUrl: the URL prefix for all page URLs, i.e. this prefix is preserved when generating and recognizing URLs. The route property of a page is a suffix of this URL.
  • resourceUrl: the base URL used to load the application binaries.

In the following section we show how and where these URLs are used. Note all base URLs end with a trailing slash by convention, to allow the use of relative URLs.

Index file

The index file (aka kicker file) is an HTML file that provides the bootstrap markup for an application and that loads the required javascript and styles files. Its generic structure is as follows:

<!doctype html>
<html lang="en">
<head>
  <base href="${resourceUrl}">
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <app-root></app-root>
  <script type="text/javascript" src="main.js">
</body>
</html>

The file defines the base URL it uses to load its resources via the <base> tag. This URL is conceptually the resourceUrl. The references to the script and CSS files are then loaded via relative references.

The index file itself is loaded implicitly by the WCH router via the baseUrl, i.e. all URLs of the following form will result in loading the index.html file:

${baseUrl}(segment/)*

Page Routing

Individual pages in the SPA are addressed via URLs of the following format:

${baseUrl}(segment/)*

where the suffix to the ${baseUrl} is the (relative) route to the pages. The route can be controlled by the business user when creating and managing pages.

API URL

The ${apiUrl} is used to make REST calls to WCH services. In many cases such calls are made by the WCH SDK implicitly or via APIs exposed by the SDK. In this case the API URL is handled internally by the SDK. In all other cases the application uses the WchInfoService to access the API URL or - if available - the context.hub.apiUrl property of the current rendering context.

Delivery URL

The ${deliveryUrl} is used to access static resources on WCH, e.g. to load image assets. All URLs in the rendering context that reference static assets are a suffix to this delivery URL. The application accesses this URL either via the WchInfoService of - if available - from the context.hub.deliveryUrl property of the current rendering context.

Examples

Let's have a look at example combinations of these URLs.

Application hosted on WCH, no custom hostname

TypeURL
apiUrlhttps://my10.digitalexperience.ibm.com/api/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/
deliveryUrlhttps://my10.digitalexperience.ibm.com/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/
baseUrlhttps://my10.digitalexperience.ibm.com/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/
resourceUrlhttps://my10.digitalexperience.ibm.com/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/

Application hosted on WCH, with custom hostname

TypeURL
apiUrlhttps://my.host.com/api/
deliveryUrlhttps://my.host.com/
baseUrlhttps://my.host.com/
resourceUrlhttps://my.host.com/

Application hosted on custom domain

TypeURL
apiUrlhttps://my10.digitalexperience.ibm.com/api/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/
deliveryUrlhttps://my10.digitalexperience.ibm.com/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/
baseUrlhttps://my.host.com/
resourceUrlhttps://my.host.com/

Application hosted on custom domain alternative

TypeURL
apiUrlhttps://my10.digitalexperience.ibm.com/api/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/
deliveryUrlhttps://my10.digitalexperience.ibm.com/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/
baseUrlhttps://my.host.com/
resourceUrlhttps://my.cdn.host.com/appRoot/

Application hosted on WCH, multi site support

TypeURL
apiUrlhttps://my10.digitalexperience.ibm.com/api/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/dxsites/mysite/
deliveryUrlhttps://my10.digitalexperience.ibm.com/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/dxsites/mysite/
baseUrlhttps://my10.digitalexperience.ibm.com/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/dxsites/mysite/
resourceUrlhttps://my10.digitalexperience.ibm.com/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/

Application hosted on WCH, multi site, multi app support

TypeURL
apiUrlhttps://my10.digitalexperience.ibm.com/api/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/dxsites/mysite/
deliveryUrlhttps://my10.digitalexperience.ibm.com/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/dxsites/mysite/
baseUrlhttps://my10.digitalexperience.ibm.com/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/dxsites/mysite/
resourceUrlhttps://my10.digitalexperience.ibm.com/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/appRoot/

Local Development mode

TypeURL
apiUrlhttps://my10.digitalexperience.ibm.com/api/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/dxsites/mysite/
deliveryUrlhttps://my10.digitalexperience.ibm.com/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/dxsites/mysite/
baseUrlhttp://localhost:4200/
resourceUrlhttp://localhost:4200/

Configuration

In this section we discuss how to configure the different URLs. The goal of the configuration is to allow for each configuration option mentioned above, while keeping the redundancy at a minimum.

Resource URL

The resource URL is part of the <base> tag of the index.html file. It is typically added by the build process. Note that per spec the URL needs to be absolute. In practice however server relative URLs also work, so if the origin of the baseUrl matches that of the resourceUrl you can omit the origin for simplicity reasons.

The Angular CLI allows to specify this URL via the --base-href command line parameter.

Example

This Angular build command

ng build --base-href /6f0ce0ff-8a25-4fac-b66a-5d42516247eb/

creates an index.html file similar to the following:

<!doctype html>
<html lang="en">
<head>
  <base href="/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/">
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <app-root></app-root>
  <script type="text/javascript" src="main.js">
</body>
</html>

API URL and Delivery URL

Either of the URLs can be derived from the other, so it is only required to configure one of them (if any).

Only configure these URLs if the deliveryUrl is NOT a prefix of the baseUrl. Otherwise the deliveryUrl and the apiUrl will be decoded from the baseUrl, automatically. This avoids redundancy and allows you to move your application across hosts without recompilation.

If required, the configuration is done via the WchNgModule.forRoot(...) options. We recommend to distinguish between configuration for the local development mode and remote production mode, because for local development mode the URLs have always to be configured, for production mode only for externally hosted applications.

Angular supports the concept of environments to distinguish between these development modes.

Example

For the development setup configure the file in /src/environments/environment.ts as follows:

export const environment = {
  apiUrl: 'https://my10.digitalexperience.ibm.com/api/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/',
  production: false
};

in the same project define the production environment in /src/environments/environment.prod.ts as follows:

export const environment = {
  production: true
};

In /src/app/app.module.ts include the SDK module and use the environment as a configuration object:

import { environment } from '../environments/environment';

@NgModule({
  imports: [
    WchNgModule.forRoot(environment),
  ]
})
export class AppModule {}

The build process will now pick up the correct file depending on your build options.

An alternative way to configure the API URL is via the index.html file by adding a link with rel="wch-config-api-url" which will be used if the WchNgModule.forRoot configuration does not contain a value. This way to configure the URL keeps the JS code independent of absolute URLs (e.g. the tenant or sites information), so you can share the same application across multiple deployments more easily.

Example

In /src/index.html file add the <link rel="wch-config-api-url"> tag:

<!doctype html>
<html lang="en">
<head>
  <base href="${resourceUrl}">
  <link rel="wch-config-api-url" href="${apiUrl}">
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <app-root></app-root>
  <script type="text/javascript" src="main.js">
</body>
</html>

The precedence order of configuration lookups is WchNgModule.forRoot > <link rel="wch-config-api-url"> > window.location.

Base URL

The base URL is the URL to address your pages with. If your application is hosted on WCH, nothing has to be configured, since the index.html file is loaded from the location ${baseUrl}/index.html automatically and WCH detects the base URL, automatically.

If your application is hosted externally, make sure that your external server supports the PathLocationStrategy, i.e. that all URLs that are a suffix of your ${baseUrl} and that address application pages, serve back the content of your index.html file. The exact setup depends on your webserver, for Apache you can find a guide here.

If you ${baseUrl} is not identical to its origin (i.e. if it contains a context root), then you need to configure the base URL in the SDK. Follow the same pattern as for the ${apiUrl} using the token baseUrl.

Example

export const environment = {
  apiUrl: 'https://my10.digitalexperience.ibm.com/api/6f0ce0ff-8a25-4fac-b66a-5d42516247eb/',
  baseUrl: 'https://my.host.com/contextRoot/',
  production: true
};

An alternative way to configure the API URL is via the index.html file by adding a link with rel="wch-config-base-url" which will be used if the WchNgModule.forRoot configuration does not contain a value. This way to configure the URL keeps the JS code independent of absolute URLs (e.g. the tenant or sites information), so you can share the same application across multiple deployments more easily.

<!doctype html>
<html lang="en">
<head>
  <base href="${resourceUrl}">
  <link rel="wch-config-base-url" href="${baseUrl}">
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <app-root></app-root>
  <script type="text/javascript" src="main.js">
</body>
</html>

The precedence order of configuration lookups is WchNgModule.forRoot > <link rel="wch-config-base-url"> > window.location.

In order to integrate with the authoring UI of WCH, you also need to add configuration data to the site record to tell ${baseUrl}, so WCH can launch the application under its correct URL.

Example

In the site.json record, set the property externalURL to your ${baseUrl}:

{
  "name": "Oslo",
  "routingMode": "path",
  "classification": "site",
  "lastModified": "2018-06-11T13:30:36.148Z",
  "lastModifierId": "83167ee6-1775-4d35-9ce2-16d3d6c9ca13",
  "creatorId": "00000000-0000-0000-0000-000000000009",
  "created": "2018-04-06T09:32:46.694Z",
  "id": "default",
  "rev": "4-c81514a9f76f20f4c3386adf180f0f63",

  "externalURL": "https://my.host.com/contextRoot/"
}

Ahead of Time Compilation

The Angular Ahead-of-Time (AOT) compiler converts your Angular HTML and TypeScript code into efficient JavaScript code during the build phase before the browser downloads and runs that code.

Common Interfaces

TODO site docs

FAQs

Package last updated on 31 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts