Drop down list seems to be working with pre-values :)

This commit is contained in:
Shannon
2013-08-23 18:38:33 +10:00
parent fbaaf7a6cb
commit b1f3e8d8ef
4 changed files with 12 additions and 9 deletions

View File

@@ -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])) {

View File

@@ -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>