I managed to successfully write a small app using Yesod. Now I am in the phase in which I want to add better interaction to it, and I would like to do this using AngularJS.
As far as I can see, the support for AngularJS in Yesod is still experimental. Moreover, the documentation I found so far is quite unaccessible for me. I don't master all of the Yesod concepts.
So I was wondering, what are possible ways to integrate AngularJS and the Yesod framework. What I'm thinking about doing is:
- Writing the front-end in AngularJS.
- Develop the web-service using Yesod.
- Connect the front-end and the web-service by means of GET and POST http requests. Information can be sent to the server by means of input forms (leveraging some of Yesod capabilities in this way), and information can be sent to the front-end by means of JSON objects.
Ideally I'd like to write everything in Haskell, but in the current state of affairs that may not be a possibility. Thus I wanted to ask if the alternative I have in mind is a good one, and whether there are ways to improving it.
Thank you.
Here are the steps I followed to set up
Followed the Yesod quickstart to set up a Yesod app
brew install haskell-stack
stack new my-project yesod-sqlite && cd my-project
stack install yesod-bin cabal-install --install-ghc
stack build
stack exec -- yesod devel
.bowerrc
bower.json
app.js
layout.html
default-layout-wrapper.hamlet head
default-layout-wrapper.hamlet body
Unfortunately Stackoverflow probably doesn't allow hamlet code snippets so I hade to separate it
Things that might seem like magic
Hope I could make thinks clearer than they were!