fix binding of documenttypes and templates

This commit is contained in:
Mads Rasmussen
2018-12-07 13:10:50 +01:00
parent bb5a561932
commit a411d13d0e
2 changed files with 11 additions and 3 deletions

View File

@@ -54,11 +54,21 @@
// get all doc types
contentTypeResource.getAll().then(documentTypes => {
// a package stores the id as a string so we
// need to convert all ids to string for comparison
documentTypes.forEach(documentType => {
documentType.id = documentType.id.toString();
});
vm.documentTypes = documentTypes;
});
// get all templates
templateResource.getAll().then(templates => {
// a package stores the id as a string so we
// need to convert all ids to string for comparison
templates.forEach(template => {
template.id = template.id.toString();
});
vm.templates = templates;
});

View File

@@ -132,13 +132,12 @@
</umb-control-group>
<umb-control-group label="Document Types">
<pre>{{vm.documentTypes | json }} </pre>
<div ng-repeat="doctype in vm.documentTypes">
<label>
<input
type="checkbox"
ng-model="doctype.selected"
checklist-model="vm.package.contentTypes"
checklist-model="vm.package.documenttypes"
checklist-value="doctype.id" />
{{doctype.name}}
</label>
@@ -146,7 +145,6 @@
</umb-control-group>
<umb-control-group label="Templates">
<pre>{{vm.templates | json }} </pre>
<div ng-repeat="template in vm.templates">
<label>
<input