content

AMD: require(["esri/popup/content"], (content) => { /* code goes here */ });
ESM: import * as content from "@arcgis/core/popup/content.js";
Object: esri/popup/content
Since: ArcGIS Maps SDK for JavaScript 4.11

A convenience module for importing Content classes when developing with TypeScript. For example, rather than importing content elements one at a time like this:

import TextContent from "esri/popup/content/TextContent";
import MediaContent from "esri/popup/content/MediaContent";
import FieldsContent from "esri/popup/content/FieldsContent";
import AttachmentsContent from "esri/popup/content/AttachmentsContent";
import CustomContent from "esri/popup/content/CustomContent";
import ExpressionContent from "esri/popup/content/ExpressionContent";
import RelationshipContent from "esri/popup/content/RelationshipContent";

You can use this module to import them on a single line:

import { TextContent, MediaContent, FieldsContent, AttachmentsContent, CustomContent, ExpressionContent, RelationshipContent } from "esri/popup/content";

This module also allows you to implement type guards on the content elements, making your code smarter.

import { Content } from "esri/popup/content";

function logContentElement(content: Content): void {
  if (content.type === "media") {
    console.log("Content type is media");
  }
  else {
    // The compiler knows the content element must be `text | fields | media | attachment | custom`
    console.log("The value is not a valid popup content element.")
  }
}

Type Definitions

AttachmentsContent

Type Definition
AttachmentsContent AttachmentsContent

AttachmentsContent represents an attachment element associated with a feature.

CustomContent

Type Definition
CustomContent CustomContent

CustomContent represents a custom content element associated with a feature.

ExpressionContent

Type Definition
ExpressionContent ExpressionContent

ExpressionContent represents an expression element associated with a feature.

FieldsContent

Type Definition
FieldsContent FieldsContent

FieldsContent represents the FieldInfo associated with a feature.

MediaContent

Type Definition
MediaContent MediaContent

MediaContent contains an individual or array of chart and/or image media elements to display within a popup's content.

RelationshipContent

Type Definition
RelationshipContent RelationshipContent

RelationshipContent represents an relationship element associated with a feature.

TextContent

Type Definition
TextContent TextContent

TextContent defines descriptive text as an element within the PopupTemplate's content.

UtilityNetworkAssociationsContent

Type Definition
UtilityNetworkAssociationsContent UtilityNetworkAssociationsContent

UtilityNetworkAssociationsContent represents an utility network associations element associated with a feature.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.