Property Editor help

I’m trying to create a simple property editor that pulls values from an api and displays them as a drop down list.

Largely everything has gone okay and the list is displayed and when selected the value is saved in the database. The problem is that when you go to edit the document type again it doesn’t set the selected item in the list.

My controller looks like this:

angular.module("umbraco")
.controller("Emailer.PickerController",
    function ($scope, $http) {
        $http.get("/umbraco/backoffice/api/EmailerApi/GetAll/").success(function (data) {
            $scope.forms = data;
        }).error(function () {
            
        });
    });

And my view looks like this:

<div ng-controller="Emailer.PickerController">
<select class="umb-editor umb-dropdown" required>
    <option ng-repeat="form in forms" value="{{form.Reference}}" ng-selected="{{form.Reference == model.value}}">{{form.Name}}</option>
</select>
<textarea ng-model="model.value"></textarea>

And my package manifest looks like this:

{
propertyEditors: [
    {
        alias: "Emailer.Picker",
        name: "Emailer Picker",
        editor: {
            view: "~/App_Plugins/Emailer/picker.html",
			valueType: "STRING"
        }
    }
],

javascript: [
	"~/App_Plugins/Emailer/picker.controller.js"
]

}

Any body got any ideas where I’m going wrong?


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/72419-property-editor-help