// app.shoppingListDirectiveController.js

(function() {
  "use strict";

  angular.module("ShoppingListDirectiveApp")
    .controller("ShoppingListDirectiveController", ShoppingListDirectiveController);

  function ShoppingListDirectiveController() {
    let list = this;

    list.cookiesInList = cookiesInList;

    function cookiesInList() {
      const TRIGGERED_WORD = "cookie";

      if (list.list.items.length) {
        for (let i = 0; i < list.list.items.length; i++) {
          const name = list.list.items[i].name;

          if (name.toLowerCase().indexOf(TRIGGERED_WORD) !== -1) {
            return true;
          }
        }
      }

      return false;
    }
  }
})();

@@ -382,24 +382,58 @@
 e%22;%0A
-%0A
       
-if (list.
+//console.log(this, list.items);%0A%0A      if (
 list
@@ -477,21 +477,16 @@
  0; i %3C 
-list.
 list.ite
@@ -526,21 +526,16 @@
  name = 
-list.
 list.ite

Edit cookiesInList method