Drop down list seems to be working with pre-values :)
This commit is contained in:
@@ -8,12 +8,14 @@ angular.module("umbraco").controller("Umbraco.Editors.DropdownController",
|
||||
keyName: "alias",
|
||||
valueName: "name"
|
||||
};
|
||||
|
||||
|
||||
//map the user config
|
||||
angular.extend(config, $scope.model.config);
|
||||
//map back to the model
|
||||
$scope.model.config = config;
|
||||
|
||||
$scope.selectExpression = "e." + config.keyName + " as e." + config.valueName + " for e in model.config.items";
|
||||
|
||||
//now we need to format the items in the array because we always want to have a dictionary
|
||||
for (var i = 0; i < $scope.model.config.items.length; i++) {
|
||||
if (angular.isString($scope.model.config.items[i])) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<div ng-controller="Umbraco.Editors.DropdownController">
|
||||
<select name="dropDownList"
|
||||
ng-model="model.value"
|
||||
required
|
||||
ng-options="e.alias as e.name for e in model.config.items"></select>
|
||||
ng-options="{{selectExpression}}"></select>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user