for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
/**
getHtml
Simple component to retrieve the HTML value of a resource.
@namespace Components
*/
'use strict';
angular.module('game').component('dashboardList', {
templateUrl: 'views/dashboard-list.html',
controller: ['data','state','util','visibility', dashboardList],
controllerAs: 'ct'
});
function dashboardList(data, state, util, visibility) {
let ct = this;
ct.data = data;
ct.state = state;
ct.util = util;
ct.searchText = '';
ct.resourcesForElement = function(currentElement) {
return visibility.visible(data.resources, filter, currentElement);
};
function filter(name, currentElement) {
if(!state.player.resources[name].unlocked){
return false;
}
if(ct.searchText && name.toLowerCase().indexOf(ct.searchText.toLowerCase()) === -1){
// This is for global resources e.g. protons, which do not
// belong to any element
let elements = data.resources[name].elements;
if (Object.keys(elements).length === 0 && currentElement === '') {
return true;
for (let element in elements) {
if (currentElement === element) {