Creating a MEAN prototype - part 6
This post has been a while coming because I jumped down a couple of rabbit-holes while working on it. I have concluded that client side stuff is not as bad as it was during the worst days of the browser wars, and I still like angularjs but creating polished rich web applications is still much more difficult than implementing server side business rules. I will have some future posts about what I found down those rabbit-holes but first I wanted to finish this series.
The first step I took to extend the application was to create a new route (this creates a ui-router state with a url) using:
yo angular-fullstack:route thing
I also modified the server side thing API to require the Stormpath login for all operations but GET in this commit.
Next I spent some time thinking about a problem I had with the application design. The MainCtrl
controller was currently getting things from the API, where that now seemed to be more correctly the job of the ThingCtrl
controller. In addition, the view defined in the main.html
template depends on things too. I decided a better solution offered by the ui-router was to use a nested view. Then I changed my mind and decided to use a named view. I encourage you to read all about these concepts on the ui-router wiki. There is a lot there to understand and I am afraid I haven't figured out a way to distill any of that into easily digestible tidbits for this blog yet.