Skip to content

Instantly share code, notes, and snippets.

@kgiszewski
Created July 2, 2014 13:41
Show Gist options
  • Save kgiszewski/706c08edb56ea2ff81dd to your computer and use it in GitHub Desktop.
Save kgiszewski/706c08edb56ea2ff81dd to your computer and use it in GitHub Desktop.
Store Hours Gist
//manifest
{
"propertyEditors": [
{
"name": "Store Hours",
"alias": "Imulus.StoreHours",
"editor": {
"valueType": "JSON",
"view": "~/App_Plugins/StoreHours/views/store.hours.html"
},
"prevalues": {
}
}
],
"css": [
"~/App_Plugins/StoreHours/css/store.hours.css"
],
"javascript": [
"~/App_Plugins/StoreHours/js/store.hours.js"
]
}
//controller
angular.module('umbraco').controller('StoreHoursController', function ($scope) {
$scope.model.value = $scope.model.value || {
sunday: "",
monday: "",
tuesday: "",
wednesday: "",
thursday: "",
friday: "",
saturday: ""
}
});
//view
<div class="store-hours" ng-controller="StoreHoursController">
<ul>
<li>
<label>Sunday
<input ng-model="model.value.sunday" />
</label>
</li>
<li>
<label>Monday
<input ng-model="model.value.monday" />
</label>
</li>
<li>
<label>Tuesday
<input ng-model="model.value.tuesday" />
</label>
</li>
<li>
<label>Wednesday
<input ng-model="model.value.wednesday" />
</label>
</li>
<li>
<label>Thursday
<input ng-model="model.value.thursday" />
</label>
</li>
<li>
<label>Friday
<input ng-model="model.value.friday" />
</label>
</li>
<li>
<label>Saturday
<input ng-model="model.value.saturday" />
</label>
</li>
</ul>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment