Better typing for the map-extension example

This PR improves the typing in the `map-extension` example. It also shows that the directive controller can be defined using `module.controller`.