content
require(["esri/popup/content"], function(content) { /* code goes here */ });
Object:
esri/popup/content
Since: ArcGIS API 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 = require("esri/popup/content/TextContent");
import MediaContent = require("esri/popup/content/MediaContent");
import FieldsContent = require("esri/popup/content/FieldsContent");
import AttachmentsContent = require("esri/popup/content/AttachmentsContent");
You can use this module to import them on a single line:
import { TextContent, MediaContent, FieldsContent, AttachmentsContent } 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`
console.log("The value is not a valid popup content element.")
}
}
Type Definitions
- AttachmentsContent
AttachmentsContent represents an attachment element associated with a feature.
Popup content element types.
- FieldsContent FieldsContent
FieldsContent represents the FieldInfo associated with a feature.
- MediaContent MediaContent
MediaContent contains an individual or array of chart and/or image media elements to display within a popup's content.
- TextContent TextContent
TextContent defines descriptive text as an element within the PopupTemplate's content.
Loading...