Copyright | (c) 2014-2015, Christopher Reichert |
---|---|
License | BSD3 |
Maintainer | Christopher Reichert <creichert@reichertbrothers.com> |
Stability | unstable |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
This module is based on Michael Snoyman's original work in the https://github.com/snoyberg/yesod-js repository.
- This module currently defaults to Angular 1.2.18. Use
urlAngularJs_
specify your own Angular location. - Example can be found at: https://github.com/snoyberg/yesod-js/tree/master/yesod-angular
- Currently, this module looks for controllers in the `templates/angular` directory.
- class Yesod site => YesodAngular site where
- runAngular :: YesodAngular site => AngularT site () -> HandlerT site IO Html
- addCommand :: (FromJSON input, ToJSON output) => (input -> HandlerT site IO output) -> AngularT site Text
- addCtrl :: Text -> Text -> Q Exp
- addCtrlRaw :: Text -> Text -> HtmlUrl (Route site) -> JavascriptUrl (Route site) -> AngularT site ()
- setDefaultRoute :: Text -> AngularT site ()
- type AngularT site = WriterT (AngularWriter site) (HandlerT site IO)
Documentation
class Yesod site => YesodAngular site where Source
YesodAngular wraps a widget in an ng-app named modname
Nothing
urlAngularJs :: site -> [Either (Route site) Text] Source
Default instance loads `angular.min.js` and `angular-route.min.js` from cloudflare cdn.
wrapAngular :: Text -> WidgetT site IO () -> HandlerT site IO Html Source
wrapAngular
wraps widget in an ng-app named
modname.
runAngular :: YesodAngular site => AngularT site () -> HandlerT site IO Html Source
addCommand :: (FromJSON input, ToJSON output) => (input -> HandlerT site IO output) -> AngularT site Text Source
setDefaultRoute :: Text -> AngularT site () Source