-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
In commit 2956a4b (branch example-templating) I'm trying to generate Angular controller code via Fay ffi,
In src/Angular.hs there is:
data StateController a = SC
{ muts :: [(a -> a)]
, gets :: [Text]
}
stateController :: StateController a -> a -> Fay ()
stateController = ffi "\
\ (function($scope) { \
\ $scope.state = %2; \
\ var sc = %1; \
\ \
...which is called in examples/todo/todo.js:
TodoCtrl = Strict.Angular.stateController(Strict.TodoFay.todoSC,Strict.TodoFay.initialState);However this fails with:
Error: Argument 'TodoCtrl' is not a function, got Fay$$Monad
The goal is to generate all the Angular code required for a Controller (and later, for a Directive etc.) from a Haskell specification, so fay-angular would need to generate various javascript classes/functions that are structured in the required way, with argument name $scope etc. Any suggestions about where the best place to implement this would be? is it possible from within a fay library, or will it require some modification to the fay compiler itself?
Metadata
Metadata
Assignees
Labels
No labels