Billy,

The plunk you just linked in, still has the css to hide the stuff, and it 
works as you remove the css.
You should not load data into scope in a directive, I might seem a good 
idea to you now, but trust me on this, it really isn’t. This should be done 
in a controller.
If the data is really local to the directive, add a controller to the 
directive.
The service you are using to load the data, can also ‘preload’ the data 
into the same factory, so it’s available without refetching it every time 
you need it.
something like:

   .factory("DropdownFactory", ["$http",
      function($http) {
         factory = {
            times: {},
            dates: [
               "May 20, 2014",
               "May 21, 2014",
               "May 22, 2014",
               "May 23, 2014",
               "May 24, 2014",
               "May 25, 2014",
               "May 26, 2014"
            ],
            types: []
         };

         factory.getTimes = function() {
            return $http.get('times.json').then(function(response) {
               // add error handling and stuff here!!!
               factory.times = response.data;
               return response;
            });
         };

         factory.getServiceTypes = function() {
            return $http.get('appointment_types.json').then(function(response) {
               // add error handling and stuff here!!!
               factory.types = response.data;
               return response;
            });
         };

         factory.getTimes();
         factory.getServiceTypes();

         return factory;
      }
   ])

Regards
Sander

-- 
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 http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to