The simplest way is to enable default popup templates for your layers:
view.popup.defaultPopupTemplateEnabled = true;
See the following CodePen for a live demo: https://codepen.io/arnofiva/pen/ddf9a71a85ec46fd291e38c8cc259fd6?editors=1010
You can also define customized popups by setting FeatureLayer.popupTemplate
, see PopupTemplate for samples and more information.
solved How to show fields from an ArcGIS Online feature layer in a popup using javascript? [closed]