Created
October 13, 2014 19:47
-
-
Save abjerner/b737a9af6a7aeb89457c to your computer and use it in GitHub Desktop.
Example of a quick Umbraco package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
propertyEditors: [ | |
{ | |
alias: "ExamplePropertyEditor", | |
name: "Example", | |
editor: { | |
view: "~/App_Plugins/Example/PropertyEditor.html", | |
hideLabel: false, | |
valueType: "JSON" | |
}, | |
prevalues: { | |
fields: [ | |
{ | |
label: "Config", | |
description: "Some description about the configuration.", | |
key: "config", | |
view: "~/App_Plugins/Example/PreValueEditor.html" | |
} | |
] | |
} | |
} | |
], | |
javascript: [ | |
'~/App_Plugins/Example/scripts.js' | |
], | |
css: [ | |
'~/App_Plugins/Example/styles.css' | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-controller="PreValueEditor.Controller"> | |
<label> | |
<input type="checkbox" ng-model="model.value.a" /> | |
Option A | |
</label> | |
<label> | |
<input type="checkbox" ng-model="model.value.b" /> | |
Option B | |
</label> | |
<pre>{{model | json}}</pre> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-controller="PropertyEditor.Controller"> | |
<input type="text" ng-model="model.value" /> | |
<br /><br /> | |
<pre>{{model | json}}</pre> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('umbraco').controller('PropertyEditor.Controller', ['$scope', function ($scope) { | |
}]); | |
angular.module('umbraco').controller('PreValueEditor.Controller', ['$scope', function ($scope) { | |
if (!$scope.model.value) { | |
$scope.model.value = { | |
a: false, | |
b: false | |
}; | |
} | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment