Module to attach inline-edit functionality to an WCH based Angular application.
Module to attach inline-edit functionality to an WCH based Angular application. The library exposes the WchNgEditModule module.
Refer to the documentation.
Refer to the documentation.
Install the module via
``bash`
npm install --save @ibm-wch-sdk/ng-edit
Add the module to your root application
`typescript`
@NgModule({
...
imports: [
...
WchNgEditModule.forRoot(environment)
],
...
})
export class AppModule { }
The module exposes the WchEditService and the wchEditable directive.
- @ibm-wch-sdk/ng
- Angular 6 or higher
The directive attaches inline edit functionality to an element that is managed by WCH. The implementation in this library only dispatches the actual realization of the inline-edit functionality to a pluggable service provider.
The directive assumes that the Component contains a onRenderingContext property that exposes the RenderingContext of the item currently edited. This contract is fulfilled automatically if the component extends AbstractRenderingComponent.
The directive requires as a parameter a string identifying the editable property. This string must reference a property on the Component that has been bound to a field of the content item via a @RenderingContextBinding directive. This directive contains the actual selector of the field. Note that this binding is done automatically if the components are generated via the CLI.
`html`{{renderingContext.elements.myField.value}}
assuming the following binding
`typescript`
export class MyComponent extends AbstractRenderingComponent {
@RenderingContextBinding('elements.myField.value') myField: string;
}
The module exposes the directives and services. Per default it provides a service that loads the inline edit functionality from the site composer, when registering the module using the forRoot method.
- forRoot(config?): the method registers the module and provides a service to load inline edit from the site composer. The location to load the edit script from is configurable via the config script, typically used for local debugging of the script via the inlineEditUrl member on the config object. A convenient way to inject this is to add inlineEditUrl to your environment object and then inject the environment object.
`typescript
import { WchNgEditModule } from '@ibm-wch-sdk/ng-edit';
@NgModule({
...
imports: [
...
WchNgEditModule.forRoot(environment),
...
]
})
export class AppModule {
}
`
The service allows to find out if an inline edit operation is taking place. Applications might want to stop any background processing during this period to avoid intercepting with the edit operation.
- onEditing: Observable: the observable that tracks the state of the current inline edit operation. It is a shared observable that dispatches the current state and all subsequent states.
Service providers implement the WchInlineEditService and provide to the module. This service realizes the actual implementation of the inline edit operation.
- registerComponent(el, accessor, onRenderingContext): Observable: this method will be invoked by the [wchEditable] directive for every editable element in the application. The el parameter references the editable DOM element. The accessor is string that represents the Javascript property accessor into the content items for the editable element. onRenderingContext exposes the context of the currently edited item. The method returns an observable of an event emitter. Subscribing to this observable makes the registration active, unsubscribing cancels it. The event emitter is used to listen for edit events.
The following inline edit events are recognized:
- wchEditStart: fired when an element enters into inline edit mode. This is used to track this status by the WchEditInfoService.wchEditEnd
- : fired when an element leaves inline edit mode (no matter whether the edit operation has been canceled or completed). This is used to track this status by the WchEditInfoService.
The default implementation of the WchInlineEditService. If the system is in preview mode, then the service lazily loads an inline edit script from a configurable location. Per default this location points to TODO, it can be overridden by the inlineEditUrl property on the config object for the module.
The inline edit script will be loaded via an HTTP request and executed dynamically. It needs to contain an IIFE that returns a registration object with the following properties:
- register(el, accessor, onRenderingContext): Handle: the register method will be called for every editable element, so the implementation of the method can attach the necessary event handlers to the DOM element to make it editable. The method returns a handle that allows to cancel the registration and to attach event handlers to the inline edit process to monitor it. The method receives the DOM element via the el parameter and an accessor that represents a Javascript property expression for the editable element in the content item. The onRenderingContext observable exposes the current context of the rendered item.
#### Handle
The handle needs to conform to one of the signatures of EventTargetLike from the RXJS spec. In addition it can expose a dispose method.
- dispose: the dispose method on the handle will be invoked to cancel a registration. This happens when the editable element falls out of scope, e.g. because of a page switch or because the application decides to hide it or for any other reason. Implementers need to make sure to unregister all previously registered event handlers.
#### Require
The inline edit script can use a require function that is available in its scope to load extra resources or services exposed by the SDK. The following services are available:
- wch-config: a configuration object containing URLs for the current tenantwch-info
- : the hub configuration exposed to the SDK by the SPAwch-logger
- : access to the SDK logging infrastructure. It is suggested to uses the exposed logger instead of console logs.
In addition the require function will resolve URLs relative to the URL used to load the script and returns the result as text. All return values are exposed as promises.
Example for accessing the config:
`typescript`
const config = require('wch-config');
config.then(c => console.log(c.apiUrl));
Example for loading an extra resource:
`typescript`
const res = require('./myExtraResource.txt');
res.then(console.log);
Example for using the logger:
`typescript`
const logger = require('wch-logger');
logger
.then(logger => logger.get('MyModule'))
.then(log => log.info('some log output'));
Accessor expressions allow to identify the field of a Content Item that the inline edit operation refers to. It is a string in the format of a Javascript property accessor.
- name: accesses the name attribute of a content item.elements.myText.value
- : accesses the value of a single valued element called myText.elements.myTexts.values[2]
- : accesses the third value of a multi valued element called myTexts.
* Improved readme
* Support for Angular 6
* Support for group elements
* Initial version
Module that allows to attach inline edit functionality to a WCH based Angular application.
Install the module
`bash`
npm install --save ibm-wch-sdk-ng-edit
Import the module into your application. Use the environment variable to configure the module, this is the same configuration as for the main WchNgModule module.
`typescript
import {WchNgEditModule} from 'ibm-wch-sdk-ng-edit';
...
@NgModule({
...
imports: [
WchNgEditModule.forRoot(environment)
...
]
`
Annotate your editable components. Pass the selector to the text field as parameter to the directive.
`html`{{renderingContext.elements.myText.value}}
The modules assumes an implementation of the WchInlineEditService. This service must be injected into the main module.
When developing modules that use the SDK, make sure to import the WchNgEditComponentsModule to have access to the components and directives exposed by the SDK.
The module can be configured via the forRoot method or by providing overrides for the individual configuration tokens.
The module exposes the following Components.
* "components/login/abstract.login.component"
* "components/placeholder/placeholder.component"
* "config/config"
* "config/index"
* "directives/editable/abstract.editable.directive"
* "directives/editable/editable.directive"
* "directives/editable/editable.placeholder.directive"
* "index"
* "interfaces/inline.edit.service"
* "module"
* "modules/components.module"
* "modules/services.module"
* "placeholder/placeholder"
* "services/config/default.wch.edit.config"
* "services/config/index"
* "services/config/wch.edit.config"
* "services/edit/wch.inline.edit.service"
* "services/http/http.inline.edit.service"
* "services/http/index"
* "services/index"
* "services/info/index"
* "services/info/wch.edit.info.service"
* "services/info/wch.internal.edit.service"
* "services/placeholders/placeholders.service"
* "services/rendering/index"
* "services/rendering/placeholder.interceptor"
* "services/wch/index"
* "services/wch/wch.edit.service"
* "utils/assert"
* "utils/config"
* "utils/events"
* "utils/placeholder"
* "utils/replacement"
---
@ibm-wch-sdk/ng-edit > "components/login/abstract.login.component"
* LOGGER
---
● LOGGER: "AbstractLoginComponent" = "AbstractLoginComponent"
Defined in components/login/abstract.login.component.ts:17
___
@ibm-wch-sdk/ng-edit > "components/placeholder/placeholder.component"
---
● COUNT: number = 0
Defined in components/placeholder/placeholder.component.ts:49
● LOGGER: "WchPlaceholderComponent" = "WchPlaceholderComponent"
Defined in components/placeholder/placeholder.component.ts:46
___
@ibm-wch-sdk/ng-edit > "config/config"
* WCH_EDIT_HUB_INFO_SERVICE
* WCH_THROTTLE_LOADING
* WCH_TOKEN_DEBUG_PLACEHOLDERS
* WCH_TOKEN_DEFAULT_PLACEHOLDER_TEXT
* WCH_TOKEN_INLINE_EDIT_URL
* WCH_TOKEN_PLACEHOLDER_TAG
---
● WCH_EDIT_HUB_INFO_SERVICE: InjectionToken<EditHubInfoService> = new InjectionToken
'EditHubInfoService'
)
Defined in config/config.ts:46
● WCH_THROTTLE_LOADING: "D1576F60-7D2A-4824-9771-A1EB574771DB" = "D1576F60-7D2A-4824-9771-A1EB574771DB"
Defined in config/config.ts:44
Injection token for placeholder debugging
__see__: EditHubInfoService
● WCH_TOKEN_DEBUG_PLACEHOLDERS: "03066F08-3E5E-41BE-B1E9-B0F31D0C881D" = "03066F08-3E5E-41BE-B1E9-B0F31D0C881D"
Defined in config/config.ts:36
Injection token for placeholder debugging
__see__: EditHubInfoService
● WCH_TOKEN_DEFAULT_PLACEHOLDER_TEXT: "10DDECF4-3818-4B08-BD34-CA073F831E9B" = "10DDECF4-3818-4B08-BD34-CA073F831E9B"
Defined in config/config.ts:14
Injection token for default placeholder text
__see__: EditHubInfoService import { InjectionToken } from '@angular/core';
import { EditHubInfoService } from './../services/config/wch.edit.config';
● WCH_TOKEN_INLINE_EDIT_URL: "0E7D0A87-FBDD-4565-9C8F-DB5909B6D9AF" = "0E7D0A87-FBDD-4565-9C8F-DB5909B6D9AF"
Defined in config/config.ts:22
Injection token for inline edit url
__see__: EditHubInfoService
● WCH_TOKEN_PLACEHOLDER_TAG: "C80F7BDA-438D-49F9-B63B-3BDA1FC13E99" = "C80F7BDA-438D-49F9-B63B-3BDA1FC13E99"
Defined in config/config.ts:29
Injection token for placeholder tag
__see__: EditHubInfoService
___
@ibm-wch-sdk/ng-edit > "config/index"
---
@ibm-wch-sdk/ng-edit > "directives/editable/abstract.editable.directive"
* AbstractWchEditableDirective
* COMPONENT_ACCESSOR
* COUNT
* KEY_ON_RENDERING_CONTEXT
* LOGGER
* ON_COMPONENT_ACCESSOR
---
Ƭ WchEditableType: string \| null
Defined in directives/editable/abstract.editable.directive.ts:80
___
● COMPONENT_ACCESSOR: AccessorType = null
Defined in directives/editable/abstract.editable.directive.ts:83
● COUNT: number = 0
Defined in directives/editable/abstract.editable.directive.ts:73
● KEY_ON_RENDERING_CONTEXT: "onRenderingContext" = "onRenderingContext"
Defined in directives/editable/abstract.editable.directive.ts:75
● LOGGER: "AbstractWchEditableDirective" = "AbstractWchEditableDirective"
Defined in directives/editable/abstract.editable.directive.ts:77
● ON_COMPONENT_ACCESSOR: Observable<string> = of(COMPONENT_ACCESSOR)
Defined in directives/editable/abstract.editable.directive.ts:86
___
@ibm-wch-sdk/ng-edit > "directives/editable/editable.directive"
---
@ibm-wch-sdk/ng-edit > "directives/editable/editable.placeholder.directive"
* WchEditablePlaceholderDirective
* LOGGER
---
Ƭ TEXT_PROPERTY: "innerHTML" \| "innerText"
Defined in directives/editable/editable.placeholder.directive.ts:72
___
● LOGGER: "WchEditablePlaceholderDirective" = "WchEditablePlaceholderDirective"
Defined in directives/editable/editable.placeholder.directive.ts:70
___
▸ _setText(aProp: TEXT_PROPERTY, aLocalizedText: LocalizedText, aElement: ElementRef, aRenderer: Renderer2): void
Defined in directives/editable/editable.placeholder.directive.ts:82
Assigns the text to a value
Parameters:
| Name | Type | Description |
| ------ | ------ | ------ |
| aProp | TEXT_PROPERTY | the property to assign |
| aLocalizedText | LocalizedText | the actual text |ElementRef
| aElement | | the native element |Renderer2
| aRenderer | | render used to assign the text |
Returns: void
▸ _textSetter(aElement: any, aRenderer: Renderer2): (Anonymous function)
Defined in directives/editable/editable.placeholder.directive.ts:113
Binds the element ref and the renderer
Parameters:
| Name | Type | Description |
| ------ | ------ | ------ |
| aElement | any | the eleemnt reference |Renderer2
| aRenderer | | the renderer |
Returns: (Anonymous function)
function that only takes the property name and the
___
@ibm-wch-sdk/ng-edit > "index"
---
@ibm-wch-sdk/ng-edit > "interfaces/inline.edit.service"
* EVENT_EDIT_END
* EVENT_EDIT_START
* EVENT_INLINE_EDIT_END
* EVENT_INLINE_EDIT_START
* WchInlineEditServiceToken
---
● EVENT_EDIT_END: "wchEditEnd" = "wchEditEnd"
Defined in interfaces/inline.edit.service.ts:7
● EVENT_EDIT_START: "wchEditStart" = "wchEditStart"
Defined in interfaces/inline.edit.service.ts:6
● EVENT_INLINE_EDIT_END: "wchInlineEditEnd" = "wchInlineEditEnd"
Defined in interfaces/inline.edit.service.ts:10
● EVENT_INLINE_EDIT_START: "wchInlineEditStart" = "wchInlineEditStart"
Defined in interfaces/inline.edit.service.ts:9
● WchInlineEditServiceToken: InjectionToken<WchInlineEditService> = new InjectionToken<
WchInlineEditService
>('WchInlineEditServiceToken')
Defined in interfaces/inline.edit.service.ts:15
___
@ibm-wch-sdk/ng-edit > "module"
---
● WCH_RC_INTERCEPTOR_TOKEN: "8453750A-4519-4184-840B-D490E909D23E" = "8453750A-4519-4184-840B-D490E909D23E"
Defined in module.ts:32
___
@ibm-wch-sdk/ng-edit > "modules/components.module"
---
@ibm-wch-sdk/ng-edit > "modules/services.module"
---
@ibm-wch-sdk/ng-edit > "placeholder/placeholder"
---
● REL_PATH_TYPE_BY_ID: "delivery/v1/rendering/type/" = "delivery/v1/rendering/type/"
Defined in placeholder/placeholder.ts:8
___
▸ loadAuthoringType(aService: WchHttpService, aTypeId: string): Observable<AuthoringType>
Defined in placeholder/placeholder.ts:10
Parameters:
| Name | Type |
| ------ | ------ |
| aService | WchHttpService |string
| aTypeId | |
Returns: Observable<AuthoringType>
___
@ibm-wch-sdk/ng-edit > "services/config/default.wch.edit.config"
* DEFAULT_DEBUG_PLACEHOLDERS
* DEFAULT_INLINE_EDIT_URL
---
● DEFAULT_DEBUG_PLACEHOLDERS: false = false
Defined in services/config/default.wch.edit.config.ts:8
● DEFAULT_INLINE_EDIT_URL: "${authoringUIBaseUrl.protocol}//${authoringUIBaseUrl.host}/authoring-sites-ui/inline-edit/inline-edit.js" = "${authoringUIBaseUrl.protocol}//${authoringUIBaseUrl.host}/authoring-sites-ui/inline-edit/inline-edit.js"
Defined in services/config/default.wch.edit.config.ts:4
___
@ibm-wch-sdk/ng-edit > "services/config/index"
---
@ibm-wch-sdk/ng-edit > "services/config/wch.edit.config"
* selectDebugPlaceholder
* selectDefaultPlaceholder
* selectInlineEditURL
* selectPlaceholderTag
* selectThrottleLoading
---
▸ selectDebugPlaceholder(aConfig?: EditHubInfoService): boolean
Defined in services/config/wch.edit.config.ts:47
Parameters:
| Name | Type |
| ------ | ------ |
| Optional aConfig | EditHubInfoService |
Returns: boolean
▸ selectDefaultPlaceholder(aConfig?: EditHubInfoService): WchDefaultPlaceholder
Defined in services/config/wch.edit.config.ts:41
Parameters:
| Name | Type |
| ------ | ------ |
| Optional aConfig | EditHubInfoService |
Returns: WchDefaultPlaceholder
▸ selectInlineEditURL(aConfig?: EditHubInfoService): HubInfoUrlProvider
Defined in services/config/wch.edit.config.ts:51
Parameters:
| Name | Type |
| ------ | ------ |
| Optional aConfig | EditHubInfoService |
Returns: HubInfoUrlProvider
▸ selectPlaceholderTag(aConfig?: EditHubInfoService): string
Defined in services/config/wch.edit.config.ts:57
Parameters:
| Name | Type |
| ------ | ------ |
| Optional aConfig | EditHubInfoService |
Returns: string
▸ selectThrottleLoading(aConfig?: EditHubInfoService): number
Defined in services/config/wch.edit.config.ts:61
Parameters:
| Name | Type |
| ------ | ------ |
| Optional aConfig | EditHubInfoService |
Returns: number
___
@ibm-wch-sdk/ng-edit > "services/edit/wch.inline.edit.service"
* WchInlineEditRegistrationService
* LOGGER
---
● LOGGER: "WchInlineEditRegistrationService" = "WchInlineEditRegistrationService"
Defined in services/edit/wch.inline.edit.service.ts:25
___
@ibm-wch-sdk/ng-edit > "services/http/http.inline.edit.service"
* EMPTY_REGISTRATION
* LOGGER
* REG_ID
* _dummyFromEvent
* _fromHubInfoUrlProvider
* _registerDummyComponent
* _createEmptyRegistration
* _createRegistration
* _createWchInlineEditEvent
* _getAbsoluteUrl
* _registerForEvent
* EMPTY_WCH_INLINE_EDIT_SERVICE
---
● EMPTY_REGISTRATION: NodeStyleEventEmitter \| JQueryStyleEventEmitter \| HasEventTargetAddRemove<any> \| NodeStyleEventEmitter & Disposable \| JQueryStyleEventEmitter & Disposable \| HasEventTargetAddRemove<any> & Disposable = _createEmptyRegistration()
Defined in services/http/http.inline.edit.service.ts:138
● LOGGER: "WchHttpInlineEditService" = "WchHttpInlineEditService"
Defined in services/http/http.inline.edit.service.ts:73
● REG_ID: number = 0
Defined in services/http/http.inline.edit.service.ts:141
● _dummyFromEvent: function = constGenerator(EMPTY)
Defined in services/http/http.inline.edit.service.ts:228
Dummy callback
__param__:
#### Type declaration
▸<T>(): Observable<T>
Type parameters:
#### T
Returns: Observable<T>
● _fromHubInfoUrlProvider: UnaryFunction<string \| URL, string> = compose<
URL | string,
GeneratorOrT
string
>(
urlToString,
fromGeneratorOrT
)
Defined in services/http/http.inline.edit.service.ts:251
Converts the provider into a URL
__param__: the provider
__returns__: the URL if available
● _registerDummyComponent: function = constGenerator(of(EMPTY_REGISTRATION))
Defined in services/http/http.inline.edit.service.ts:237
Registers a dummy component
__param__: the native element
__param__: the accesor
__param__: rendering context
#### Type declaration
▸(): T
Returns: T
___
▸ _createEmptyRegistration(): WchInlineEditRegistrationResult
Defined in services/http/http.inline.edit.service.ts:85
Creates an empty registration result as fallback
Returns: WchInlineEditRegistrationResult
▸ _createRegistration(aRegisterMethod: WchInlineEditRegistration, nativeElement: any, accessor: AccessorType, onRenderingContext: Observable<RenderingContext>, logger: Logger): Observable<EventTargetLike<any>>
Defined in services/http/http.inline.edit.service.ts:153
Constructs the registration for a native element
Parameters:
| Name | Type | Description |
| ------ | ------ | ------ |
| aRegisterMethod | WchInlineEditRegistration | registration callback method |any
| nativeElement | | the native element |AccessorType
| accessor | | accessor string |Observable
| onRenderingContext | <RenderingContext> | rendering context |Logger
| logger | |
Returns: Observable<EventTargetLike<any>>
observable of the registration result in form of an event emitter
▸ _createWchInlineEditEvent(aType: string, aData: any): WchInlineEditEvent
Defined in services/http/http.inline.edit.service.ts:102
Constructs the event
Parameters:
| Name | Type | Description |
| ------ | ------ | ------ |
| aType | string | the event type |any
| aData | | the event data |
Returns: WchInlineEditEvent
the event object
▸ _getAbsoluteUrl(base: string, relative: string): string
Defined in services/http/http.inline.edit.service.ts:199
Resolves a relative URL against a base URL
Parameters:
| Name | Type | Description |
| ------ | ------ | ------ |
| base | string | the base URL |string
| relative | | the relative URL |
Returns: string
the result
▸ _registerForEvent(aType: string, aEmitter: EventTargetLike<any>, aLogger: Logger): Observable<WchInlineEditEvent>
Defined in services/http/http.inline.edit.service.ts:121
Registers for an event
Parameters:
| Name | Type | Description |
| ------ | ------ | ------ |
| aType | string | the event type |EventTargetLike
| aEmitter | <any> | the event emitter |Logger
| aLogger | |
Returns: Observable<WchInlineEditEvent>
the sequence of events
___
EMPTY_WCH_INLINE_EDIT_SERVICE: object
Defined in services/http/http.inline.edit.service.ts:240
#### fromEvent
● fromEvent: function = _dummyFromEvent
Defined in services/http/http.inline.edit.service.ts:242
#### Type declaration
▸<T>(): Observable<T>
Type parameters:
#### T
Returns: Observable<T>
#### registerComponent
● registerComponent: function = _registerDummyComponent
Defined in services/http/http.inline.edit.service.ts:241
#### Type declaration
▸(): T
Returns: T
___
___
@ibm-wch-sdk/ng-edit > "services/http/index"
---
@ibm-wch-sdk/ng-edit > "services/index"
---
@ibm-wch-sdk/ng-edit > "services/info/index"
---
@ibm-wch-sdk/ng-edit > "services/info/wch.edit.info.service"
* LOGGER
---
● LOGGER: "WchEditInfoService" = "WchEditInfoService"
Defined in services/info/wch.edit.info.service.ts:10
___
@ibm-wch-sdk/ng-edit > "services/info/wch.internal.edit.service"
* DEFAULT_EDITING
* DEFAULT_INLINE_EDIT
---
● DEFAULT_EDITING: false = false
Defined in services/info/wch.internal.edit.service.ts:9
● DEFAULT_INLINE_EDIT: false = false
Defined in services/info/wch.internal.edit.service.ts:10
___
@ibm-wch-sdk/ng-edit > "services/placeholders/placeholders.service"
* WchPlaceholderImpl
* WchPlaceholderService
* LOGGER
* _selectFromWchPlaceholder
* opOnAccessor
* opOnData
* opOnFormattedText
* opOnPlaceholder
* opOnPlainText
* opOnType
* selectOnAccessor
* selectOnData
* selectOnFormattedText
* selectOnPlaceholder
* selectOnPlainText
* selectOnType
---
● LOGGER: "WchPlaceholderImpl" = "WchPlaceholderImpl"
Defined in services/placeholders/placeholders.service.ts:94
● _selectFromWchPlaceholder: function = pluckProperty
Defined in services/placeholders/placeholders.service.ts:339
some type magic
#### Type declaration
▸<K>(aKey: K): UnaryFunction<WchPlaceholder, WchPlaceholder[K]>
Type parameters:
#### K : keyof WchPlaceholder
Parameters:
| Name | Type |
| ------ | ------ |
| aKey | K |
Returns: UnaryFunction<WchPlaceholder, WchPlaceholder[K]>
● opOnAccessor: OperatorFunction<WchPlaceholder, string> = switchMap(
selectOnAccessor
)
Defined in services/placeholders/placeholders.service.ts:357
● opOnData: OperatorFunction<WchPlaceholder, any> = switchMap(
selectOnData
)
Defined in services/placeholders/placeholders.service.ts:364
● opOnFormattedText: OperatorFunction<WchPlaceholder, LocalizedText> = switchMap(selectOnFormattedText)
Defined in services/placeholders/placeholders.service.ts:371
● opOnPlaceholder: OperatorFunction<WchPlaceholder, AuthoringPlaceholder> = switchMap(selectOnPlaceholder)
Defined in services/placeholders/placeholders.service.ts:360
● opOnPlainText: OperatorFunction<WchPlaceholder, LocalizedText> = switchMap(selectOnPlainText)
Defined in services/placeholders/placeholders.service.ts:367
● opOnType: OperatorFunction<WchPlaceholder, string> = switchMap(
selectOnType
)
Defined in services/placeholders/placeholders.service.ts:375
● selectOnAccessor: UnaryFunction<WchPlaceholder, Observable<string>> = _selectFromWchPlaceholder('onAccessor')
Defined in services/placeholders/placeholders.service.ts:347
● selectOnData: UnaryFunction<WchPlaceholder, Observable<any>> = _selectFromWchPlaceholder('onData')
Defined in services/placeholders/placeholders.service.ts:349
● selectOnFormattedText: UnaryFunction<WchPlaceholder, Observable<Object>> = _selectFromWchPlaceholder(
'onFormattedText'
)
Defined in services/placeholders/placeholders.service.ts:351
● selectOnPlaceholder: UnaryFunction<WchPlaceholder, Observable<AuthoringPlaceholder>> = _selectFromWchPlaceholder('onPlaceholder')
Defined in services/placeholders/placeholders.service.ts:348
● selectOnPlainText: UnaryFunction<WchPlaceholder, Observable<Object>> = _selectFromWchPlaceholder('onPlainText')
Defined in services/placeholders/placeholders.service.ts:350
● selectOnType: UnaryFunction<WchPlaceholder, Observable<string>> = _selectFromWchPlaceholder('onType')
Defined in services/placeholders/placeholders.service.ts:354
___
@ibm-wch-sdk/ng-edit > "services/rendering/index"
---
@ibm-wch-sdk/ng-edit > "services/rendering/placeholder.interceptor"
* LOGGER
---
● LOGGER: "PlaceholderInterceptor" = "PlaceholderInterceptor"
Defined in services/rendering/placeholder.interceptor.ts:38
___
@ibm-wch-sdk/ng-edit > "services/wch/index"
---
@ibm-wch-sdk/ng-edit > "services/wch/wch.edit.service"
* TO_ANONYMOUS
* TO_FALSE
* getCurrentTenantUrl
* getCurrentUserUrl
* isAuthenticated
* ANONYMOUS_USER
* HTTP_WITH_CREDENTIALS
* JSON_WITHOUT_CREDENTIALS
* JSON_WITH_CREDENTIALS
---
● FALSE_OBSERVABLE: Observable<boolean> = opFalse
Defined in services/wch/wch.edit.service.ts:74
● LOGGER: "WchEditService" = "WchEditService"
Defined in services/wch/wch.edit.service.ts:72
___
▸ TO_ANONYMOUS(): Observable<User>
Defined in services/wch/wch.edit.service.ts:76
Returns: Observable<User>
▸ TO_FALSE(): Observable<boolean>
Defined in services/wch/wch.edit.service.ts:75
Returns: Observable<boolean>
▸ getCurrentTenantUrl(aBase: string): string
Defined in services/wch/wch.edit.service.ts:90
Parameters:
| Name | Type |
| ------ | ------ |
| aBase | string |
Returns: string
▸ getCurrentUserUrl(aBase: string): string
Defined in services/wch/wch.edit.service.ts:89
Parameters:
| Name | Type |
| ------ | ------ |
| aBase | string |
Returns: string
▸ isAuthenticated(aUser: User): boolean
Defined in services/wch/wch.edit.service.ts:94
Parameters:
| Name | Type |
| ------ | ------ |
| aUser | User |
Returns: boolean
___
ANONYMOUS_USER: object
Defined in services/wch/wch.edit.service.ts:66
#### externalId
● externalId: string = "ibm_anonymous_user@de.ibm.com"
Defined in services/wch/wch.edit.service.ts:69
#### id
● id: string = "00000000-0000-f000-0000-000000000000"
Defined in services/wch/wch.edit.service.ts:67
#### roles
● roles: undefined[] = []
Defined in services/wch/wch.edit.service.ts:68
___
HTTP_WITH_CREDENTIALS: object
Defined in services/wch/wch.edit.service.ts:78
#### withCredentials
● withCredentials: true = true
Defined in services/wch/wch.edit.service.ts:78
___
JSON_WITHOUT_CREDENTIALS: object
Defined in services/wch/wch.edit.service.ts:83
#### responseType
● responseType: "json" = "json"
Defined in services/wch/wch.edit.service.ts:86
#### withCredentials
● withCredentials: false = false
Defined in services/wch/wch.edit.service.ts:86
___
JSON_WITH_CREDENTIALS: object
Defined in services/wch/wch.edit.service.ts:79
#### responseType
● responseType: "json" = "json"
Defined in services/wch/wch.edit.service.ts:82
#### withCredentials
● withCredentials: true = true
Defined in services/wch/wch.edit.service.ts:82
___
___
@ibm-wch-sdk/ng-edit > "utils/assert"
* _assert
---
▸ _assert<T>(aPredicate: function, aFailHandler: function): function
Defined in utils/assert.ts:3
Type parameters:
#### T
Parameters:
| Name | Type |
| ------ | ------ |
| aPredicate | function |function
| aFailHandler | |
Returns: function
___
@ibm-wch-sdk/ng-edit > "utils/config"
---
▸ loadWchConfig(aJsonp: WchHttpService): Observable<WchConfig>
Defined in utils/config.ts:16
Loads the WCH config
Parameters:
| Name | Type | Description |
| ------ | ------ | ------ |
| aJsonp | WchHttpService | the JSONp callback |
Returns: Observable<WchConfig>
the resulting config object
___
@ibm-wch-sdk/ng-edit > "utils/events"
* _createWchEditableEvent
* _registerForEvent
* createWchEditableEvents
---
▸ _createWchEditableEvent(aType: string, aTarget: HTMLElement, aData: any): WchEditableEvent
Defined in utils/events.ts:18
Constructs the event
Parameters:
| Name | Type | Description |
| ------ | ------ | ------ |
| aType | string | the event type |HTMLElement
| aTarget | | the target node |any
| aData | | the event data |
Returns: WchEditableEvent
the event object
▸ _registerForEvent(aType: string, aTarget: HTMLElement, aEmitter: EventTargetLike<any>, aLogger: Logger): Observable<WchEditableEvent>
Defined in utils/events.ts:41
Registers for an event
Parameters:
| Name | Type | Description |
| ------ | ------ | ------ |
| aType | string | the event type |HTMLElement
| aTarget | | the current element |EventTargetLike
| aEmitter | <any> | the event emitter |Logger
| aLogger | |
Returns: Observable<WchEditableEvent>
the sequence of events
▸ createWchEditableEvents(aTarget: HTMLElement, aEmitter: EventTargetLike<any>, aLogger: Logger): Observable<WchEditableEvent>
Defined in utils/events.ts:67
Construct the event stream
Parameters:
| Name | Type | Description |
| ------ | ------ | ------ |
| aTarget | HTMLElement | the target element |EventTargetLike
| aEmitter | <any> | the event emitter |Logger
| aLogger | |
Returns: Observable<WchEditableEvent>
the event stream
___
@ibm-wch-sdk/ng-edit > "utils/placeholder"
* WchDefaultPlaceholder
* WchEditableFormat
* UNDEFINED
* WCH_EDITABLE_AUTO_FORMAT
* WCH_EDITABLE_HTML_FORMAT
* WCH_EDITABLE_TEXT_FORMAT
* phParseExpression
* _anyToString
* _formatFromType
* _missingPlaceholderText
* _phEscapedText
* _phGetDefault
* _phGetLocalizedText
* _phGetStaticDefault
* _showPlaceholder
* phDefaultPlaceholderText
* phFormat
* phFormattedText
* phPlaceholderFromAccessor
* phPlainText
* phShowPlaceholder
* phTypeFromAccessor
---
Ƭ WchDefaultPlaceholder: ObservableOrT<string \| LocalizedText>
Defined in utils/placeholder.ts:43
type for placeholder
Ƭ WchEditableFormat: "text" \| "html" \| "auto"
Defined in utils/placeholder.ts:50
Potential values for the 'wchFormat' field
___
● UNDEFINED: any` = undefined
Defined in utils/placeholder.ts:56
● WCH_EDITABLE_AUTO_FORMAT: "auto" = "auto"
Defined in utils/placeholder.ts:53
● WCH_EDITABLE_HTML_FORMAT: "html" = "html"
Defined in utils/placeholder.ts:54
● WCH_EDITABLE_TEXT_FORMAT: "text" = "text"
Defined in utils/placeholder.ts:52
___
<