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

Dev Guide
Dev GuideUser GuidesLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

ChannelTargetResult

OCP App SDK / ChannelTargetResult

ChannelTargetResult

Result of target.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor()

Signature

new ChannelTargetResult(targeting?: CampaignTargeting[]): ChannelTargetResult;

Parameters

NameTypeDescription
targeting?CampaignTargeting[]the complete set of targeting requirements, if already known

Returns

ChannelTargetResult

Overrides: FormResult.constructor

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

Properties

errors

Protected object = {}

Index signature

[field: string]: string[]

Type declaration

Inherited from: FormResult.errors

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

toasts

Protected {

`intent`: [`Intent`](app-sdk-api-reference-types-intent);
`message`: `string`;

}[] = []

Inherited from: FormResult.toasts

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

Methods

addError()

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

Signature

addError(section: string, field: string, error: string): ChannelTargetResult;

Parameters

NameTypeDescription
sectionstringthe section within the form that the error applies to
fieldstringthe field within the section that the error applies to
errorstringmessage to display to the user

Returns

ChannelTargetResult

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

addTargeting()

Add a single targeting requirement

Signature

addTargeting(targeting: CampaignTargeting): ChannelTargetResult;

Parameters

NameTypeDescription
targetingCampaignTargetingrequirement to add

Returns

ChannelTargetResult

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

addToast()

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

Signature

addToast(intent: Intent, message: string): ChannelTargetResult;

Parameters

NameTypeDescription
intentIntentone of the supported intents that will affect how the toast is displayed
messagestringto display in the toast

Returns

ChannelTargetResult

Inherited from: FormResult.addToast

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

setTargeting()

Provide the complete set of targeting requirements

Signature

setTargeting(targeting: CampaignTargeting[]): ChannelTargetResult;

Parameters

NameTypeDescription
targetingCampaignTargeting[]requirements to provide

Returns

ChannelTargetResult

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