Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

Dev Guide
Dev GuideUser GuidesGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

ChannelTargetResult

OCP App SDK


OCP App SDK / ChannelTargetResult

Class: ChannelTargetResult

Defined in: src/app/lib/ChannelTargetResult.ts:16

Result of Channel.target.

Extends

Constructors

Constructor

new ChannelTargetResult(targeting?): ChannelTargetResult

Defined in: src/app/lib/ChannelTargetResult.ts:22

Parameters

targeting?

CampaignTargeting[]

the complete set of targeting requirements, if already known

Returns

ChannelTargetResult

Overrides

FormResult.constructor

Properties

errors

protected errors: object = {}

Defined in: src/app/lib/FormResult.ts:4

Index Signature

[field: string]: string[]

Inherited from

FormResult.errors


toasts

protected toasts: object[] = []

Defined in: src/app/lib/FormResult.ts:5

intent

intent: Intent

message

message: string

Inherited from

FormResult.toasts

Methods

addError()

addError(section, field, error): this

Defined in: src/app/lib/ChannelTargetResult.ts:51

Add an error to display to the user for a particular form field (implicitly scoped to the content settings form)

Parameters

section

string

the section within the form that the error applies to

field

string

the field within the section that the error applies to

error

string

message to display to the user

Returns

this


addTargeting()

addTargeting(targeting): this

Defined in: src/app/lib/ChannelTargetResult.ts:31

Add a single targeting requirement

Parameters

targeting

CampaignTargeting

requirement to add

Returns

this


addToast()

addToast(intent, message): this

Defined in: src/app/lib/FormResult.ts:13

Display a toast to user, such as, "Successfully authenticated with " or
"Authentication failed, please check your credentials and try again."

Parameters

intent

Intent

one of the supported intents that will affect how the toast is displayed

message

string

to display in the toast

Returns

this

Inherited from

FormResult.addToast


setTargeting()

setTargeting(targeting): this

Defined in: src/app/lib/ChannelTargetResult.ts:40

Provide the complete set of targeting requirements

Parameters

targeting

CampaignTargeting[]

requirements to provide

Returns

this