Skip to content

Instantly share code, notes, and snippets.

@ToJans
Created June 4, 2013 15:28
Show Gist options
  • Save ToJans/5706806 to your computer and use it in GitHub Desktop.
Save ToJans/5706806 to your computer and use it in GitHub Desktop.
exploring how I would design a simple MEF with angularjs
function BOM($scope) {
$scope.Materials = [
{ "id": "MAT/TOMATOSOUP",
"name": "Tomato soup",
"unit": "L",
"Precision": 0.01
}, {
"id": "MAT/ONION",
"name": "Onion",
"unit": "PCS",
"Precision": 1
}];
$scope.Recipies = [
{ "id": "REC/TOMATOSOUP",
"produces": "MAT/TOMATOSOUP",
"unit": "PCS",
"Quantity": "1000",
"Steps": [
"BOM": [
{ "id": "REC/TOMATO", "Quantity": 0.5 },
{ "id": "REC/ONION", "Quantity": 4 }
],
"BOR": [
{ "id": "RES/MACHINE1", "Quantity": 1 },
{ "id": "RES/MACHINE2", "Quantity": 2 }
]
]
}];
$scope.Units = [
{ "id": "L", "Name": "Liters", },
{ "id": "PCS", "Name": "Pieces", },
{ "id": "H","Name":"Hours","Precision":1/6}
];
$scope.Resources = [
{ "id": "RES/MACHINE1", "Name":"Line 1","Precision": 1 },
{ "id": "RES/MACHINE2", "Name": "Line 1", "Precision": 1 }
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment