-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Here's what I'm using to generically build a controller out of a Fay module.
# CoffeeScript
angModule = angular.module("angModule", [])
angModule.controller("FooCtl", ($scope) ->
$scope[k] = v for own k, v of Strict.HaskModule
)
Assuming this is even a good starting point, is there a way to package up that code into Fay action? Say, for instance,
angularModule :: Text -- ^ module's name
-> [AngularModule] -- ^ module deps
-> Fay AngularModule
addController :: Text -- ^ controller name
-> Text -- ^ Haskell module to use (FIXME, obviously(?))
-> AngularModule -- ^ Angular module to attach the controller to
-> Fay ()
and then:
main = do
angMod <- angularModule "angModule"
addController "FooCtl" "HaskModule" angMod
Metadata
Metadata
Assignees
Labels
No labels