Something that I loved in the 0.9.8 series was using App.router.currentState
and its name
and currentPath
properties to get the router state and then do something simple with it. A basic example might be to keep track of breadcrumbs or “where am i.”
I have not found this same datum (easily) anywhere in RC6. I eventually did find a way to get at it but it was so buried and convoluted that, it seems to me, the core is signaling don’t do this.
As a practical example consider a view with
<div {{bindAttr class="isCurrent"}}>
etc
</div>
and
isCurrent: function() {
App.router.currentState.get('path') === this.get('myPath');
}.property()
Not compiled and tested code
So my questions are:
- Is the obfuscation of this datum intentional
- Should I be using a different access pattern?
- Is anyone doing anything like this successfully?
Thanks
Steven