I have a custom datatype with a single configuration property PropertyAlias
. The datatype is configured via c# with the following implementation:
[DataEditor(
alias: "MyProject.PaymentMethodDropdown",
name: "Payment Method Dropdown",
view: "/App_Plugins/MyProject/backoffice/PropertyEditors/PaymentMethodDropdown/editor.html",
Icon = "icon-indent",
ValueType = ValueTypes.Json
)]
public class PaymentMethodDropdownPropertyEditor : DataEditor
{
private readonly IIOHelper _ioHelper;
private readonly IEditorConfigurationParser _configParser;
public PaymentMethodDropdownPropertyEditor(
IDataValueEditorFactory dataValueEditorFactory,
IIOHelper ioHelper,
IEditorConfigurationParser configParser)
: base(dataValueEditorFactory)
{
_ioHelper = ioHelper;
_configParser = configParser;
}
/// <inheritdoc />
protected override IDataValueEditor CreateValueEditor()
{
var editor = base.CreateValueEditor();
return editor;
}
/// <inheritdoc />
protected override IConfigurationEditor CreateConfigurationEditor()
{
return new PaymentMethodDropdownConfigurationEditor(_ioHelper, _configParser);
}
}
public class PaymentMethodDropdownConfigurationEditor : ConfigurationEditor<PaymentMethodDropdownConfiguration>
{
public PaymentMethodDropdownConfigurationEditor(IIOHelper ioHelper) : base(ioHelper) { }
public PaymentMethodDropdownConfigurationEditor(IIOHelper ioHelper,
IEditorConfigurationParser editorConfigurationParser) : base(ioHelper, editorConfigurationParser) { }
}
public class PaymentMethodDropdownConfiguration
{
[ConfigurationField("propertyAlias", "Property Alias", "textstring",
Description = "The alias of the property from which we want to get the list of options")]
public string PropertyAlias { get; set; }
}
I have 2 datatypes in Umbraco using the editor with each configured to target a different property alias.
I have a content type that contains 2 properties which each use one of the two datatypes. The problem I have is that the $scope.model.config.propertyAlias
in my angular controller does not appear to be isolated with each instance returning the same propertyTypeAlias.
If I write out $scope.model.id
to the console they are different but $scope.model.config
is the same when it shouldn’t be.
Is there something I am missing?