Q:

Materialize select muliple "Check/Uncheck All" event

I have following markup
<select ng-model="sltStatus" id="sltStatusFilter" multiple class="right">
    <option value="0">View All</option>
    <option value="1">Study 1</option>
    <option value="2">Study 2</option>
    <option value="3">Study 3</option>
    <option value="4">Study 4</option>
</select>

And below is the JavaScript code
$('select').material_select();

Materialize use checkboxes for this. 
fiddle
How can I have check/uncheck all functionality, I Googled a lot but din't find anything related. 

A:

MaterializeCSS does not support this feature internally.  However, this can be implemented using jQuery's DOM manipulation methods. 

Bind click event: The plugin will add initialized class on the <select> and a unique ID to the corresponding <ul> which starts with select-options-.  We can use this knowledge to select the first <li> children i.e. "Check All" option from the dropdown. 
Check if "Check All" is selected or not: The plugin will add the active class on the selected items.  Using hasClass(), we can check if active class is added to the first option in the select. 
Selecting/Deselecting other options: Using the previous step, we can get the status of "Check All".  Using this, we can iterate over other options and trigger click event on appropriate elements. 
Bonus Updating the options text: To update the option text, get the text using text() method and compare with Check All.  Using contents() and textContent the text can be updated easily. 

Note: This code completely depends on the DOM elements created by the third-party plugin.  If after an update, the plugin changes the HTML structure this code will not work or need to update accordingly. 
Demo

$('select').material_select();

$('select[select-all].initialized').prev('ul[id^="select-options-"]').children('li:first').on('click', function() {
  var selector = 'li.active';
  if ($(this).hasClass('active')) {
    selector = 'li:not(".active")';
  }

  $(this).siblings(selector).each(function() {
    $(this).click();
  });

  $('span', this).contents().last()[0].textContent = $(this).text().trim() === 'Check All' ? ' Uncheck All' : 'Check All';
  // Check values of selected options
  console.log($(this).parent().next().val());
});
<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.96.0/css/materialize.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/js/materialize.min.js"></script>


With "select-all" option
<div class="input-field col s5">
  <select multiple select-all searchable="search here..">
    <option value="0">Check All</option>
    <option value="1">Yellow</option>
    <option value="2">Green</option>
    <option value="3">Pink</option>
    <option value="4">Orange</option>
  </select>
  <label>Materialize Multiple Select</label>
</div>


<br />
Without "Select All" option
<div class="input-field col s5">
  <select multiple searchable="Animals">
    <option value="0">Cat</option>
    <option value="1">Dog</option>
    <option value="2">Horse</option>
    <option value="3">Pig</option>
    <option value="4">Lion</option>
  </select>
  <label>Materialize Multiple Select</label>
</div>

A:

As I understand from your comments, I think that this is what you want
$('ul.dropdown-content li').first().click(function(){    
  $('ul.dropdown-content li:not(:first-child)').each(function(index) {
           $(this).find("input[type=checkbox]").prop("checked", $('ul.dropdown-content li').first().find("input[type=checkbox]").prop("checked"));                       
        });
});

updated fiddle https://jsfiddle.net/xv0p06d3/21/
just be carefull with this because I'm using what it seems to be a class from Materialize...so, if the class change, you'll need to change the code.  You can find a way to use you own code to get the ul/li elements. 
Hope it helps. 
UPDATE
the answer above is pure jquery (as your fiddle as just jquery)...one way for you to make this work with angular is create a directive like this. 
app.directive('selectMultiple', function() {
    return {
        restrict: 'A',
        link: function(scope, element, attrs) {
            $(element).find('select').material_select();
            $(element).find("ul li").first().click(function(){  
            $(element).find("ul li:not(:first-child)").each(function(index) {
                   $(this).find("input[type=checkbox]").prop("checked", $(element).find("ul li").first().find("input[type=checkbox]").prop("checked"));                      
                 });
            });
        }
    };
});

Check Angular fiddle http://jsfiddle.net/TH87t/1545/
Kind regards.