Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
11 lines (8 sloc) 367 Bytes
@PhoneListCtrl = ($scope, Grails) ->
$scope.phones = Grails.getResource($scope).query({action: 'query'})
$scope.orderProp = 'age'
@PhoneDetailCtrl = ($scope, Grails) ->
$scope.phone = Grails.getResource($scope).get {action: 'query'}, (phone) ->
$scope.setMainImage(phone.images[0])
$scope.setMainImage = (imageUrl) ->
$scope.mainImageUrl = imageUrl