Skip to content

Instantly share code, notes, and snippets.

@perploug
Created November 14, 2017 14:33
Show Gist options
  • Save perploug/603b3137d181938a46be0c01958108e1 to your computer and use it in GitHub Desktop.
Save perploug/603b3137d181938a46be0c01958108e1 to your computer and use it in GitHub Desktop.
exercise 7
angular.module("umbraco")
.controller("My.Workshop.EditController", function ($routeParams) {
var vm = this;
vm.workshop = {};
vm.buttonState = "init";
vm.properties = {
description: { label: "Description", description: "Workshop description" }
};
vm.save = function () {
vm.buttonState = "success";
};
});
<form novalidate name="contentForm"
ng-controller="My.Workshop.EditController as vm"
ng-submit="vm.save()">
<umb-editor-view>
<umb-editor-header name="'hello'"
hide-alias="true"
hide-description="true"
hide-icon="true">
</umb-editor-header>
<umb-editor-container class="form-horizontal">
<umb-property property="vm.properties.description">
</umb-property>
</umb-editor-container>
<umb-editor-footer>
<umb-editor-footer-content-right>
<umb-button action="vm.save()"
type="button"
button-style="success"
state="vm.buttonState"
shortcut="ctrl+s"
label="Save workshop"
disabled="vm.buttonState === 'busy'">
</umb-button>
</umb-editor-footer-content-right>
</umb-editor-footer>
</umb-editor-view>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment