What's up fellas.
I am having an issue with a mix of things. Directive + isolate scope +
dynamic element + ng-options etc
Let me explain what this is for...
I have an app that allows for 'providers' to have a schedule. When they
chose their schedule they do it by day. So for example someone who works
Monday and Tuesday will look like this...
[
{
name: "Monday",
start_time: "12:00 AM",
end_time: "11:30 PM",
lunch_time: "11:30 AM",
lunch_length: "30"
},
{
name: "Tuesday",
start_time: "01:00 AM" ,
end_time: "12:00 PM",
lunch_time: "10:30 AM",
lunch_length: "60"
}
];
I have created all the logic to allow them to register and create their
schedule's just fine. What I am trying to do now is allow them to UPDATE
their schedule's once they have logged into their dashboards.
Inside my directive I am creating html that should generate the list of
times in a drop down using ng-options and then also use for example 'track
by' to display the time a provider has chosen for say 'start_time' on a
given day to be the default option...
[
"12:00 AM",
"12:30 AM",
"01:00 AM",
"01:30 AM",
...
"11:30 PM"
]
The problem comes when trying to sort of generate this dynamically using a
list of times from the PARENT scope ($scope.schedule) inside a directive
The select statement with all the proper properties are generated but the
OPTIONS are not generated properly
My guess is that the combination of a parent scope trying to be used inside
of an element that was created dynamically (with ng-options) and compiled
using $compile is where the problem lies but I don't know how to get around
it
Please take a look at the jsfiddle
https://jsfiddle.net/figuer25/9vr8y0ff/
Even if you don't understand what I just explained, what I basically want
is to see some options on the selects in the js fiddle using the
'formTimes' and then eventually have a default that comes from the
providers day schedule using maybe 'track by'
--
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.