This refactor is way more signicficant than I previously thought. Changes:
Added 'fast-memoize' module. We need it for fast and capable of handling multiple-arguments memoization in order to filter our recipes array. This helps us avoid infinite digest loop. Our problem is similar to the one described here - in our case, the filter is the one comparing its outputs.
Added 'fastMemoizeService.js' file, which contains module, which is later used as a depedency in our splitting filter. It uses 'require' function, which is a node.js component, so it was designed as a server-side module. I used 'Browserify' to make it environment-independent - it produced a code, which is surrounding a 'fastMemoizeModule'.
Added 'appFilters.js' file, with filters module inside, which contains one filter - splitIntoRows, which is splitting recipes array.
Variables, functions and files renamed in order to be more understandable.
Separated 'Add recipe card' and 'Recipe card' to diffrent directives and files.
Deleted 'emptyRecipes' function, and created 'isEmpty' function, which serves the same purpose, but is located in helper and is more universal.
This refactor is way more signicficant than I previously thought. Changes: