Please help. I am fresh out of sanity.
See codepen here for an example.
I have a <timer>
from angular-timer that exposes seconds
on to the local scope and updates it every second, which is pretty nice. Something like this:
<timer> {{seconds}} </timer>
So, I thought it would also be pretty nice to then use a <progressbar>
from angular-ui-bootstrap and have it update the value
on each tick. So, I've gone and done something like this:
<timer>
<progressbar value="seconds"></progressbar>
</timer>
This, much to my amazement, does not work.
So, I went ahead and thought about it for what seems like two full days. That's probably because it's been two days of banging away at this and I still have no idea what in the world is going on. Anyway, I thought "hey, maybe somehow seconds
isn't reeeeeally exposed on the scope, so let's find out if it is, OK? OK." (maybe talking to myself isn't helping.)
So, I proceeded to type these things:
<timer>
{{seconds}}
<progressbar value="seconds"></progressbar>
</timer>
and there they are, in all their glory, the seconds. On my page. Just not in my progressbar. Where I want them. Of course.
So, seconds
is definitely exposed on the scope.
Then, I thought "okay. Seconds is on the scope. Maybe progressbar has an isolated scope that isn't inheriting seconds
or something. Maybe. But no. I do not believe this is the case. That would make too much sense.
Any help would be like an oasis in a vast desert of frustration.
$parent.seconds
would work? Because that doesn't work either. I tried adding a$watch
onseconds
in a new controller, updating a property and then using that, but that doesn't work either. I've updated the pen to reflect these scenarios. – Nick Aug 14 at 14:01