Files
doormanserver/static/coffee/controllers/apispecCtrl.coffee
T
2015-02-06 22:03:05 -08:00

29 lines
916 B
CoffeeScript

define ["app", "angularAMD"], (app, angularAMD) ->
app.controller "ApispecCtrl", ($scope) ->
$scope.methods =
get: "GET"
post: "POST"
angularAMD.directive "wabMethod", () ->
directive =
restrict: 'E',
scope:
method: '@'
link: (scope, element) ->
scope.methods =
get: "GET"
put: "PUT"
delete: "DELETE"
post: "POST"
template: '<code style="width:5em; display: block; text-align: center;">{{ methods[method] }}</code>'
return directive
angularAMD.directive "wabApi", () ->
directive =
restrict: 'E',
scope:
endpoint: '@'
template: '<a>/api{{ endpoint }}</a>'
return directive