I'm writing a boardgame hub as a personal project, to learn/discover more about AngularJS.
I tried to go for a generic implementation, so I have a generic partial that shows a square grid and a generic controller, with all actual game logic residing in a service. I've written one such service for each boardgame I've implemented (currently 2). The one thing I can't solve in a generic manner is a cell in the grid. Depending on the game, its content may be a letter, a number, a picture, or even some (quite complex) HTML. I could use a getter function, that would call the service, that would assemble the HTML for each cell, but this feels really not-Angular-ish. So I thought of defining a directive for each type of cell. How do I place a directive conditionally in the page (based on the game type, decided in the controller)?
If you can come up with a more elegant solution, which does not require this hack-ish thing, I'd be glad to hear it.