Hello!
I'm not sure how to phrase my topic, as I'm not sure if I'm heading the
right direction.
I'm working on a private project with a few timers counting up and down
(for measuring workouts :D)
*CURRENTLY: *
1. I made a "time-component" directive which represents a 'component' of
timer. e.g. "hour" (with min=0, max=24) and "minute" (min... max...).
This directive automatically takes care of the formatting (I'm using
input type="text", a jquery-spinner element and a custom formatter to have
it aligned to two-digits, etc).
2. I made a "stopwatch" controller (!!):
This controller is wrapper around the time-component directives as such:
<div data-ng-controller="stopwatch">
<div data-time-component type="hour"></div>
<div data-time-component type="minute"></div>
</div>
The stopwatch is able to start counting up and updating hour/minute values
in the view.
I even can make multiple of these elements on a page and all of them work
independently & fine.
Now I'd like to make a new 'component' - not sure about WHAT to use now and
if using "stopwatch" controllers so far was 'correct' - that can contain
two stopwatch(es) and if the first stopwatch is expired firing up the next
one (the javascript code to do that isn't the problem for me).
Unfortunately this would mean doing something like (nested controllers):
<div data-ng-controller="chained_watches">
<div data-ng-controller="stopwatch" ng-model="stopwatch1">
<div data-time-component type="hour"></div>
<div data-time-component type="minute"></div>
</div>
<div data-ng-controller="stopwatch" ng-model="stopwatch2">
<div data-time-component type="hour"></div>
<div data-time-component type="minute"></div>
</div>
</div>
Now I'd like to access the different stopwatches as model in my
"ChainedWatches" controller. But that doesn't work.
It would be great if someone could give me hints how to approach my problem
with angularjs.
The idea is to have "stopwatch" functionality (independently counting
up/down) and something that uses their functionality (in order to chain
timers). With that I'd like to use a e.g. "Tabata Timer" that consists of
'preparation timer', 'active timer', 'rest timer'.
I know such projects exist online - but I'd like to finish that as personal
project with AngularJS.
Thank you so much in advance,
stefan
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.