<commit_before>angular.module('orderCloud')
    .controller('ProductBrowseCtrl', ProductBrowseController)
;

function ProductBrowseController($state, ocProductBrowse, CategoryList, CategoryTree, Parameters, ocParameters) {
    var vm = this;
    vm.parameters = Parameters;
    vm.categoryList = CategoryList;

    vm.initFilters = function(parameters) {
        vm.parameters.favorites = parameters.favorites;
    };

    //Category Tree Setup
    vm.treeConfig = {};

    vm.treeConfig.treeData = CategoryTree;
    vm.treeConfig.treeOptions = {
        equality: function(node1, node2) {
            if (node2 && node1) {
                return node1.ID === node2.ID;
            } else {
                return node1 === node2;
            }
        }
    };

    vm.treeConfig.selectNode = function(node) {
        $state.go('productBrowse.products', {categoryid:node.ID, page:''});
    };

    //Initiate breadcrumbs is triggered by product list view (child state "productBrowse.products")<commit_msg>F51-428 - Add inline comments for vm.initFilters()<commit_after>angular.module('orderCloud')
    .controller('ProductBrowseCtrl', ProductBrowseController)
;

function ProductBrowseController($state, ocProductBrowse, CategoryList, CategoryTree, Parameters, ocParameters) {
    var vm = this;
    vm.parameters = Parameters;
    vm.categoryList = CategoryList;

    //Init Filters is triggered by the product list view (child state "productBrowse.products")
    vm.initFilters = function(parameters) {
        vm.parameters.favorites = parameters.favorites;
    };

    //Category Tree Setup
    vm.treeConfig = {};

    vm.treeConfig.treeData = CategoryTree;
    vm.treeConfig.treeOptions = {
        equality: function(node1, node2) {
            if (node2 && node1) {
                return node1.ID === node2.ID;
            } else {
                return node1 === node2;
            }
        }
    };

    vm.treeConfig.selectNode = function(node) {
        $state.go('productBrowse.products', {categoryid:node.ID, page:''});
    };

    //Initiate breadcrumbs is triggered by product list view (child state "productBrowse.products")
{'fraction_non_alphanumeric': 0.11468531468531469, 'fraction_numerical': 0.009790209790209791, 'mean_word_length': 2.771528998242531, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1785914', 'n_tokens_mistral': 627, 'n_tokens_neox': 616, 'n_words': 130}