Closed fabm22 closed 8 years ago
I'm a little confused what you're suggesting. You can wrap $stateProvider.state
in your own function and do whatever stuff you want (such as access controllers/views by some sort of convention) but I have been happy explicitly spelling out almost everything I put into my state definitions and have not really needed more 'automagic'.
Also, although you always start off with what seems like a basic implementation, you ALWAYS inevitably end up refactoring. Just try to get some reuse out of your templates and make your controllers edit/add agnostic and you should find there is very little non-dry code.
For example for the last advice :
Could we imagine a linter through regexps which would 'assert', check, that in a $stateProvider's $state declaration there would be a check for data entries (or/and _resolve_s ? Not sure I'm sure about whether one or other) with values suffixed with some typical keywords (possibly delcared in a whitelist), as there are not finally that many possibilites when you think about it ( rendering, editing, uploading, loading, saving, persisting )... We could even assume all $states regarding a feature (ie. = a module) would typically be declared in the same physical file, letting the checker find the _data_s/_resolve_s chain..
Not sure.. Is it looking too hard in it ? The idea would be to tend to something like a typical "blueprint" of the use of $states and architecture of an app through those.