var getUnits = function(store_id){
$http.get($rootScope.api + '/api/v2/stores/'+ store_id + '/unit_groups')
.success(function(data){
let units = data.unit_groups.filter(unit_group => unit_group.name == "weight")
let options = units[0].units.map(unit=> unit.name)
// ["g", "mg", "kg"]
})
}
网友评论