Best JavaScript code snippet using ng-mocks
createItems.js
Source:createItems.js
1function createItems() {2 //First greek elements slot.3 createEle("gElements1", "gre1t1", 1, "images/blank.png", 0, "greek", "true");4 createEle("gElements1", "gre1t2", 1, "images/greek/fire.png", 1, "greek", "true");5 createEle("gElements1", "gre1t3", 1, "images/greek/water.png", 2, "greek", "true");6 createEle("gElements1", "gre1t4", 1, "images/greek/earth.png", 3, "greek", "true");7 createEle("gElements1", "gre1t5", 1, "images/greek/air.png", 4, "greek", "true");8 createBre("gElements1");9 createEle("gElements1", "gre1t6", 1, "images/greek/steam.png", 5, "greek", "false");10 //Second greek elements slot.11 createEle("gElements2", "gre2t1", 2, "images/blank.png", 0, "greek", "true");12 createEle("gElements2", "gre2t2", 2, "images/greek/fire.png", 1, "greek", "true");13 createEle("gElements2", "gre2t3", 2, "images/greek/water.png", 2, "greek", "true");14 createEle("gElements2", "gre2t4", 2, "images/greek/earth.png", 3, "greek", "true");15 createEle("gElements2", "gre2t5", 2, "images/greek/air.png", 4, "greek", "true");16 createBre("gElements2");17 createEle("gElements2", "gre2t6", 2, "images/greek/steam.png", 5, "greek", "false");18 //First american elements slot.19 createEle("aElements1", "ame1t1", 3, "images/blank.png", 0, "greek", "true");20 createEle("aElements1", "ame1t2", 3, "images/american/hydrogen.png", 1, "american", "false");21 createEle("aElements1", "ame1t3", 3, "images/american/helium.png", 2, "american", "false");22 createEle("aElements1", "ame1t4", 3, "images/american/lithium.png", 3, "american", "false");23 createEle("aElements1", "ame1t5", 3, "images/american/beryllium.png", 4, "american", "false");24 createBre("aElements1");25 createEle("aElements1", "ame1t6", 3, "images/american/boron.png", 5, "american", "false");26 createEle("aElements1", "ame1t7", 3, "images/american/carbon.png", 6, "american", "false");27 createEle("aElements1", "ame1t8", 3, "images/american/nitrogen.png", 7, "american", "false");28 createEle("aElements1", "ame1t9", 3, "images/american/oxygen.png", 8, "american", "false");29 createEle("aElements1", "ame1t10", 3, "images/american/fluorine.png", 9, "american", "false");30 createBre("aElements1");31 createEle("aElements1", "ame1t11", 3, "images/american/neon.png", 10, "american", "false");32 createEle("aElements1", "ame1t12", 3, "images/american/sodium.png", 11, "american", "false");33 createEle("aElements1", "ame1t13", 3, "images/american/magnesium.png", 12, "american", "false");34 createEle("aElements1", "ame1t14", 3, "images/american/aluminium.png", 13, "american", "false");35 createEle("aElements1", "ame1t15", 3, "images/american/silocon.png", 14, "american", "false");36 createBre("aElements1");37 createEle("aElements1", "ame1t16", 3, "images/american/phosphorus.png", 15, "american", "false");38 createEle("aElements1", "ame1t17", 3, "images/american/sulfur.png", 16, "american", "false");39 createEle("aElements1", "ame1t18", 3, "images/american/chlorine.png", 17, "american", "false");40 createEle("aElements1", "ame1t19", 3, "images/american/argon.png", 18, "american", "false");41 createEle("aElements1", "ame1t20", 3, "images/american/potassium.png", 19, "american", "false");42 createBre("aElements1");43 createEle("aElements1", "ame1t21", 3, "images/american/calcium.png", 20, "american", "false");44 createEle("aElements1", "ame1t22", 3, "images/american/scandium.png", 21, "american", "false");45 createEle("aElements1", "ame1t23", 3, "images/american/titanium.png", 22, "american", "false");46 createEle("aElements1", "ame1t24", 3, "images/american/vanadium.png", 23, "american", "false");47 createEle("aElements1", "ame1t25", 3, "images/american/chromium.png", 24, "american", "false");48 createBre("aElements1");49 createEle("aElements1", "ame1t26", 3, "images/american/manganese.png", 25, "american", "false");50 createEle("aElements1", "ame1t27", 3, "images/american/iron.png", 26, "american", "false");51 createEle("aElements1", "ame1t28", 3, "images/american/cobalt.png", 27, "american", "false");52 createEle("aElements1", "ame1t29", 3, "images/american/nickel.png", 28, "american", "false");53 createEle("aElements1", "ame1t30", 3, "images/american/copper.png", 29, "american", "false");54 createBre("aElements1");55 createEle("aElements1", "ame1t31", 3, "images/american/zinc.png", 30, "american", "false");56 createEle("aElements1", "ame1t32", 3, "images/american/gallium.png", 31, "american", "false");57 createEle("aElements1", "ame1t33", 3, "images/american/germanium.png", 32, "american", "false");58 createEle("aElements1", "ame1t34", 3, "images/american/arsenic.png", 33, "american", "false");59 createEle("aElements1", "ame1t35", 3, "images/american/selenium.png", 34, "american", "false");60 createBre("aElements1");61 createEle("aElements1", "ame1t36", 3, "images/american/bromine.png", 35, "american", "false");62 createEle("aElements1", "ame1t37", 3, "images/american/krypton.png", 36, "american", "false");63 createEle("aElements1", "ame1t38", 3, "images/american/rubidium.png", 37, "american", "false");64 createEle("aElements1", "ame1t39", 3, "images/american/strontium.png", 38, "american", "false");65 createEle("aElements1", "ame1t40", 3, "images/american/yttrium.png", 39, "american", "false");66 createBre("aElements1");67 createEle("aElements1", "ame1t41", 3, "images/american/zirconium.png", 40, "american", "false");68 createEle("aElements1", "ame1t42", 3, "images/american/niobium.png", 41, "american", "false");69 createEle("aElements1", "ame1t43", 3, "images/american/molybdenium.png", 42, "american", "false");70 createEle("aElements1", "ame1t44", 3, "images/american/technetium.png", 43, "american", "false");71 createEle("aElements1", "ame1t45", 3, "images/american/ruthenium.png", 44, "american", "false");72 createBre("aElements1");73 createEle("aElements1", "ame1t46", 3, "images/american/rhodium.png", 45, "american", "false");74 createEle("aElements1", "ame1t47", 3, "images/american/palladium.png", 46, "american", "false");75 createEle("aElements1", "ame1t48", 3, "images/american/silver.png", 47, "american", "false");76 createEle("aElements1", "ame1t49", 3, "images/american/cadmium.png", 48, "american", "false");77 createEle("aElements1", "ame1t50", 3, "images/american/indium.png", 49, "american", "false");78 createBre("aElements1");79 createEle("aElements1", "ame1t51", 3, "images/american/tin.png", 50, "american", "false");80 createEle("aElements1", "ame1t52", 3, "images/american/antimony.png", 51, "american", "false");81 createEle("aElements1", "ame1t53", 3, "images/american/tellurium.png", 52, "american", "false");82 createEle("aElements1", "ame1t54", 3, "images/american/iodine.png", 53, "american", "false");83 createEle("aElements1", "ame1t55", 3, "images/american/xenon.png", 54, "american", "false");84 createBre("aElements1");85 createEle("aElements1", "ame1t56", 3, "images/american/caesium.png", 55, "american", "false");86 createEle("aElements1", "ame1t57", 3, "images/american/barium.png", 56, "american", "false");87 createEle("aElements1", "ame1t58", 3, "images/american/lanthanium.png", 57, "american", "false");88 createEle("aElements1", "ame1t59", 3, "images/american/cerium.png", 58, "american", "false");89 createEle("aElements1", "ame1t60", 3, "images/american/praseodymium.png", 59, "american", "false");90 createBre("aElements1");91 createEle("aElements1", "ame1t61", 3, "images/american/neodymium.png", 60, "american", "false");92 createEle("aElements1", "ame1t62", 3, "images/american/promethium.png", 61, "american", "false");93 createEle("aElements1", "ame1t63", 3, "images/american/samarium.png", 62, "american", "false");94 createEle("aElements1", "ame1t64", 3, "images/american/europium.png", 63, "american", "false");95 createEle("aElements1", "ame1t65", 3, "images/american/gadolinium.png", 64, "american", "false");96 createBre("aElements1");97 createEle("aElements1", "ame1t66", 3, "images/american/terbium.png", 65, "american", "false");98 createEle("aElements1", "ame1t67", 3, "images/american/dysprosium.png", 66, "american", "false");99 createEle("aElements1", "ame1t68", 3, "images/american/holmium.png", 67, "american", "false");100 createEle("aElements1", "ame1t69", 3, "images/american/erbium.png", 68, "american", "false");101 createEle("aElements1", "ame1t70", 3, "images/american/thulium.png", 69, "american", "false");102 createBre("aElements1");103 createEle("aElements1", "ame1t71", 3, "images/american/ytterbium.png", 70, "american", "false");104 createEle("aElements1", "ame1t72", 3, "images/american/lutetium.png", 71, "american", "false");105 createEle("aElements1", "ame1t73", 3, "images/american/hafnium.png", 72, "american", "false");106 createEle("aElements1", "ame1t74", 3, "images/american/tantalum.png", 73, "american", "false");107 createEle("aElements1", "ame1t75", 3, "images/american/tungsten.png", 74, "american", "false");108 createBre("aElements1");109 createEle("aElements1", "ame1t76", 3, "images/american/rhenium.png", 75, "american", "false");110 createEle("aElements1", "ame1t77", 3, "images/american/osmium.png", 76, "american", "false");111 createEle("aElements1", "ame1t78", 3, "images/american/iridium.png", 77, "american", "false");112 createEle("aElements1", "ame1t79", 3, "images/american/platinum.png", 78, "american", "false");113 createEle("aElements1", "ame1t80", 3, "images/american/gold.png", 79, "american", "false");114 createBre("aElements1");115 createEle("aElements1", "ame1t81", 3, "images/american/mercury.png", 80, "american", "false");116 createEle("aElements1", "ame1t82", 3, "images/american/thallium.png", 81, "american", "false");117 createEle("aElements1", "ame1t83", 3, "images/american/lead.png", 82, "american", "false");118 createEle("aElements1", "ame1t84", 3, "images/american/bismuth.png", 83, "american", "false");119 createEle("aElements1", "ame1t85", 3, "images/american/polonium.png", 84, "american", "false");120 createBre("aElements1");121 createEle("aElements1", "ame1t86", 3, "images/american/astatine.png", 85, "american", "false");122 createEle("aElements1", "ame1t87", 3, "images/american/radon.png", 86, "american", "false");123 createEle("aElements1", "ame1t88", 3, "images/american/francium.png", 87, "american", "false");124 createEle("aElements1", "ame1t89", 3, "images/american/radium.png", 88, "american", "false");125 createEle("aElements1", "ame1t90", 3, "images/american/actinium.png", 89, "american", "false");126 createBre("aElements1");127 createEle("aElements1", "ame1t91", 3, "images/american/thorium.png", 90, "american", "false");128 createEle("aElements1", "ame1t92", 3, "images/american/protactinium.png", 91, "american", "false");129 createEle("aElements1", "ame1t93", 3, "images/american/uranium.png", 92, "american", "false");130 createEle("aElements1", "ame1t94", 3, "images/american/neptunium.png", 93, "american", "false");131 createEle("aElements1", "ame1t95", 3, "images/american/plutonium.png", 94, "american", "false");132 createBre("aElements1");133 createEle("aElements1", "ame1t96", 3, "images/american/americium.png", 95, "american", "false");134 createEle("aElements1", "ame1t97", 3, "images/american/curium.png", 96, "american", "false");135 createEle("aElements1", "ame1t98", 3, "images/american/berkelium.png", 97, "american", "false");136 createEle("aElements1", "ame1t99", 3, "images/american/californium.png", 98, "american", "false");137 createEle("aElements1", "ame1t100", 3, "images/american/einsteinium.png", 99, "american", "false");138 createBre("aElements1");139 createEle("aElements1", "ame1t101", 3, "images/american/fermium.png", 100, "american", "false");140 createEle("aElements1", "ame1t102", 3, "images/american/mendelevium.png", 101, "american", "false");141 createEle("aElements1", "ame1t103", 3, "images/american/nobelium.png", 102, "american", "false");142 createEle("aElements1", "ame1t104", 3, "images/american/lawrencium.png", 103, "american", "false");143 createEle("aElements1", "ame1t105", 3, "images/american/rutherfordium.png", 104, "american", "false");144 createBre("aElements1");145 createEle("aElements1", "ame1t106", 3, "images/american/dubnium.png", 105, "american", "false");146 createEle("aElements1", "ame1t107", 3, "images/american/seaborgium.png", 106, "american", "false");147 createEle("aElements1", "ame1t108", 3, "images/american/bohrium.png", 107, "american", "false");148 createEle("aElements1", "ame1t109", 3, "images/american/hassium.png", 108, "american", "false");149 createEle("aElements1", "ame1t110", 3, "images/american/meitnerium.png", 109, "american", "false");150 createBre("aElements1");151 createEle("aElements1", "ame1t111", 3, "images/american/darmstadtium.png", 110, "american", "false");152 createEle("aElements1", "ame1t112", 3, "images/american/roentgenium.png", 111, "american", "false");153 createEle("aElements1", "ame1t113", 3, "images/american/copernicium.png", 112, "american", "false");154 createEle("aElements1", "ame1t114", 3, "images/american/nihonium.png", 113, "american", "false");155 createEle("aElements1", "ame1t115", 3, "images/american/flerovium.png", 114, "american", "false");156 createBre("aElements1");157 createEle("aElements1", "ame1t116", 3, "images/american/moscovium.png", 115, "american", "false");158 createEle("aElements1", "ame1t117", 3, "images/american/livermorium.png", 116, "american", "false");159 createEle("aElements1", "ame1t118", 3, "images/american/tennessine.png", 117, "american", "false");160 createEle("aElements1", "ame1t119", 3, "images/american/oganesson.png", 118, "american", "false");161 //Second american elements slot.162 createEle("aElements2", "ame2t1", 4, "images/blank.png", 0, "greek", "true");163 createEle("aElements2", "ame2t2", 4, "images/american/hydrogen.png", 1, "american", "false");164 createEle("aElements2", "ame2t3", 4, "images/american/helium.png", 2, "american", "false");165 createEle("aElements2", "ame2t4", 4, "images/american/lithium.png", 3, "american", "false");166 createEle("aElements2", "ame2t5", 4, "images/american/beryllium.png", 4, "american", "false");167 createBre("aElements2");168 createEle("aElements2", "ame2t6", 4, "images/american/boron.png", 5, "american", "false");169 createEle("aElements2", "ame2t7", 4, "images/american/carbon.png", 6, "american", "false");170 createEle("aElements2", "ame2t8", 4, "images/american/nitrogen.png", 7, "american", "false");171 createEle("aElements2", "ame2t9", 4, "images/american/oxygen.png", 8, "american", "false");172 createEle("aElements2", "ame2t10", 4, "images/american/fluorine.png", 9, "american", "false");173 createBre("aElements2");174 createEle("aElements2", "ame2t11", 4, "images/american/neon.png", 10, "american", "false");175 createEle("aElements2", "ame2t12", 4, "images/american/sodium.png", 11, "american", "false");176 createEle("aElements2", "ame2t13", 4, "images/american/magnesium.png", 12, "american", "false");177 createEle("aElements2", "ame2t14", 4, "images/american/aluminium.png", 13, "american", "false");178 createEle("aElements2", "ame2t15", 4, "images/american/silocon.png", 14, "american", "false");179 createBre("aElements2");180 createEle("aElements2", "ame2t16", 4, "images/american/phosphorus.png", 15, "american", "false");181 createEle("aElements2", "ame2t17", 4, "images/american/sulfur.png", 16, "american", "false");182 createEle("aElements2", "ame2t18", 4, "images/american/chlorine.png", 17, "american", "false");183 createEle("aElements2", "ame2t19", 4, "images/american/argon.png", 18, "american", "false");184 createEle("aElements2", "ame2t20", 4, "images/american/potassium.png", 19, "american", "false");185 createBre("aElements2");186 createEle("aElements2", "ame2t21", 4, "images/american/calcium.png", 20, "american", "false");187 createEle("aElements2", "ame2t22", 4, "images/american/scandium.png", 21, "american", "false");188 createEle("aElements2", "ame2t23", 4, "images/american/titanium.png", 22, "american", "false");189 createEle("aElements2", "ame2t24", 4, "images/american/vanadium.png", 23, "american", "false");190 createEle("aElements2", "ame2t25", 4, "images/american/chromium.png", 24, "american", "false");191 createBre("aElements2");192 createEle("aElements2", "ame2t26", 4, "images/american/manganese.png", 25, "american", "false");193 createEle("aElements2", "ame2t27", 4, "images/american/iron.png", 26, "american", "false");194 createEle("aElements2", "ame2t28", 4, "images/american/cobalt.png", 27, "american", "false");195 createEle("aElements2", "ame2t29", 4, "images/american/nickel.png", 28, "american", "false");196 createEle("aElements2", "ame2t30", 4, "images/american/copper.png", 29, "american", "false");197 createBre("aElements2");198 createEle("aElements2", "ame2t31", 4, "images/american/zinc.png", 30, "american", "false");199 createEle("aElements2", "ame2t32", 4, "images/american/gallium.png", 31, "american", "false");200 createEle("aElements2", "ame2t33", 4, "images/american/germanium.png", 32, "american", "false");201 createEle("aElements2", "ame2t34", 4, "images/american/arsenic.png", 33, "american", "false");202 createEle("aElements2", "ame2t35", 4, "images/american/selenium.png", 34, "american", "false");203 createBre("aElements2");204 createEle("aElements2", "ame2t36", 4, "images/american/bromine.png", 35, "american", "false");205 createEle("aElements2", "ame2t37", 4, "images/american/krypton.png", 36, "american", "false");206 createEle("aElements2", "ame2t38", 4, "images/american/rubidium.png", 37, "american", "false");207 createEle("aElements2", "ame2t39", 4, "images/american/strontium.png", 38, "american", "false");208 createEle("aElements2", "ame2t40", 4, "images/american/yttrium.png", 39, "american", "false");209 createBre("aElements2");210 createEle("aElements2", "ame2t41", 4, "images/american/zirconium.png", 40, "american", "false");211 createEle("aElements2", "ame2t42", 4, "images/american/niobium.png", 41, "american", "false");212 createEle("aElements2", "ame2t43", 4, "images/american/molybdenium.png", 42, "american", "false");213 createEle("aElements2", "ame2t44", 4, "images/american/technetium.png", 43, "american", "false");214 createEle("aElements2", "ame2t45", 4, "images/american/ruthenium.png", 44, "american", "false");215 createBre("aElements2");216 createEle("aElements2", "ame2t46", 4, "images/american/rhodium.png", 45, "american", "false");217 createEle("aElements2", "ame2t47", 4, "images/american/palladium.png", 46, "american", "false");218 createEle("aElements2", "ame2t48", 4, "images/american/silver.png", 47, "american", "false");219 createEle("aElements2", "ame2t49", 4, "images/american/cadmium.png", 48, "american", "false");220 createEle("aElements2", "ame2t50", 4, "images/american/indium.png", 49, "american", "false");221 createBre("aElements2");222 createEle("aElements2", "ame2t51", 4, "images/american/tin.png", 50, "american", "false");223 createEle("aElements2", "ame2t52", 4, "images/american/antimony.png", 51, "american", "false");224 createEle("aElements2", "ame2t53", 4, "images/american/tellurium.png", 52, "american", "false");225 createEle("aElements2", "ame2t54", 4, "images/american/iodine.png", 53, "american", "false");226 createEle("aElements2", "ame2t55", 4, "images/american/xenon.png", 54, "american", "false");227 createBre("aElements2");228 createEle("aElements2", "ame2t56", 4, "images/american/caesium.png", 55, "american", "false");229 createEle("aElements2", "ame2t57", 4, "images/american/barium.png", 56, "american", "false");230 createEle("aElements2", "ame2t58", 4, "images/american/lanthanium.png", 57, "american", "false");231 createEle("aElements2", "ame2t59", 4, "images/american/cerium.png", 58, "american", "false");232 createEle("aElements2", "ame2t60", 4, "images/american/praseodymium.png", 59, "american", "false");233 createBre("aElements2");234 createEle("aElements2", "ame2t61", 4, "images/american/neodymium.png", 60, "american", "false");235 createEle("aElements2", "ame2t62", 4, "images/american/promethium.png", 61, "american", "false");236 createEle("aElements2", "ame2t63", 4, "images/american/samarium.png", 62, "american", "false");237 createEle("aElements2", "ame2t64", 4, "images/american/europium.png", 63, "american", "false");238 createEle("aElements2", "ame2t65", 4, "images/american/gadolinium.png", 64, "american", "false");239 createBre("aElements2");240 createEle("aElements2", "ame2t66", 4, "images/american/terbium.png", 65, "american", "false");241 createEle("aElements2", "ame2t67", 4, "images/american/dysprosium.png", 66, "american", "false");242 createEle("aElements2", "ame2t68", 4, "images/american/holmium.png", 67, "american", "false");243 createEle("aElements2", "ame2t69", 4, "images/american/erbium.png", 68, "american", "false");244 createEle("aElements2", "ame2t70", 4, "images/american/thulium.png", 69, "american", "false");245 createBre("aElements2");246 createEle("aElements2", "ame2t71", 4, "images/american/ytterbium.png", 70, "american", "false");247 createEle("aElements2", "ame2t72", 4, "images/american/lutetium.png", 71, "american", "false");248 createEle("aElements2", "ame2t73", 4, "images/american/hafnium.png", 72, "american", "false");249 createEle("aElements2", "ame2t74", 4, "images/american/tantalum.png", 73, "american", "false");250 createEle("aElements2", "ame2t75", 4, "images/american/tungsten.png", 74, "american", "false");251 createBre("aElements2");252 createEle("aElements2", "ame2t76", 4, "images/american/rhenium.png", 75, "american", "false");253 createEle("aElements2", "ame2t77", 4, "images/american/osmium.png", 76, "american", "false");254 createEle("aElements2", "ame2t78", 4, "images/american/iridium.png", 77, "american", "false");255 createEle("aElements2", "ame2t79", 4, "images/american/platinum.png", 78, "american", "false");256 createEle("aElements2", "ame2t80", 4, "images/american/gold.png", 79, "american", "false");257 createBre("aElements2");258 createEle("aElements2", "ame2t81", 4, "images/american/mercury.png", 80, "american", "false");259 createEle("aElements2", "ame2t82", 4, "images/american/thallium.png", 81, "american", "false");260 createEle("aElements2", "ame2t83", 4, "images/american/lead.png", 82, "american", "false");261 createEle("aElements2", "ame2t84", 4, "images/american/bismuth.png", 83, "american", "false");262 createEle("aElements2", "ame2t85", 4, "images/american/polonium.png", 84, "american", "false");263 createBre("aElements2");264 createEle("aElements2", "ame2t86", 4, "images/american/astatine.png", 85, "american", "false");265 createEle("aElements2", "ame2t87", 4, "images/american/radon.png", 86, "american", "false");266 createEle("aElements2", "ame2t88", 4, "images/american/francium.png", 87, "american", "false");267 createEle("aElements2", "ame2t89", 4, "images/american/radium.png", 88, "american", "false");268 createEle("aElements2", "ame2t90", 4, "images/american/actinium.png", 89, "american", "false");269 createBre("aElements2");270 createEle("aElements2", "ame2t91", 4, "images/american/thorium.png", 90, "american", "false");271 createEle("aElements2", "ame2t92", 4, "images/american/protactinium.png", 91, "american", "false");272 createEle("aElements2", "ame2t93", 4, "images/american/uranium.png", 92, "american", "false");273 createEle("aElements2", "ame2t94", 4, "images/american/neptunium.png", 93, "american", "false");274 createEle("aElements2", "ame2t95", 4, "images/american/plutonium.png", 94, "american", "false");275 createBre("aElements2");276 createEle("aElements2", "ame2t96", 4, "images/american/americium.png", 95, "american", "false");277 createEle("aElements2", "ame2t97", 4, "images/american/curium.png", 96, "american", "false");278 createEle("aElements2", "ame2t98", 4, "images/american/berkelium.png", 97, "american", "false");279 createEle("aElements2", "ame2t99", 4, "images/american/californium.png", 98, "american", "false");280 createEle("aElements2", "ame2t100", 4, "images/american/einsteinium.png", 99, "american", "false");281 createBre("aElements2");282 createEle("aElements2", "ame2t101", 4, "images/american/fermium.png", 100, "american", "false");283 createEle("aElements2", "ame2t102", 4, "images/american/mendelevium.png", 101, "american", "false");284 createEle("aElements2", "ame2t103", 4, "images/american/nobelium.png", 102, "american", "false");285 createEle("aElements2", "ame2t104", 4, "images/american/lawrencium.png", 103, "american", "false");286 createEle("aElements2", "ame2t105", 4, "images/american/rutherfordium.png", 104, "american", "false");287 createBre("aElements2");288 createEle("aElements2", "ame2t106", 4, "images/american/dubnium.png", 105, "american", "false");289 createEle("aElements2", "ame2t107", 4, "images/american/seaborgium.png", 106, "american", "false");290 createEle("aElements2", "ame2t108", 4, "images/american/bohrium.png", 107, "american", "false");291 createEle("aElements2", "ame2t109", 4, "images/american/hassium.png", 108, "american", "false");292 createEle("aElements2", "ame2t110", 4, "images/american/meitnerium.png", 109, "american", "false");293 createBre("aElements2");294 createEle("aElements2", "ame2t111", 4, "images/american/darmstadtium.png", 110, "american", "false");295 createEle("aElements2", "ame2t112", 4, "images/american/roentgenium.png", 111, "american", "false");296 createEle("aElements2", "ame2t113", 4, "images/american/copernicium.png", 112, "american", "false");297 createEle("aElements2", "ame2t114", 4, "images/american/nihonium.png", 113, "american", "false");298 createEle("aElements2", "ame2t115", 4, "images/american/flerovium.png", 114, "american", "false");299 createBre("aElements2");300 createEle("aElements2", "ame2t116", 4, "images/american/moscovium.png", 115, "american", "false");301 createEle("aElements2", "ame2t117", 4, "images/american/livermorium.png", 116, "american", "false");302 createEle("aElements2", "ame2t118", 4, "images/american/tennessine.png", 117, "american", "false");303 createEle("aElements2", "ame2t119", 4, "images/american/oganesson.png", 118, "american", "false");...
ng-module.js
Source:ng-module.js
1(function() {2 function initNgModules(element) {3 var elements = [element],4 moduleElements = [],5 modules = [],6 names = ['ng:module', 'ng-module', 'x-ng-module', 'data-ng-module', 'ng:modules', 'ng-modules', 'x-ng-modules', 'data-ng-modules'],7 NG_MODULE_CLASS_REGEXP = /\sng[:\-]module[s](:\s*([\w\d_]+);?)?\s/;8 function append(element) {9 element && elements.push(element);10 }11 for(var i = 0; i < names.length; i++) {12 var name = names[i];13 names[i] = true;14 append(document.getElementById(name));15 name = name.replace(':', '\\:');16 if (element.querySelectorAll) {17 var elements2;18 elements2 = element.querySelectorAll('.' + name);19 for(var j = 0; j < elements2.length; j++) append(elements2[j]);20 21 elements2 = element.querySelectorAll('.' + name + '\\:');22 for(var j = 0; j < elements2.length; j++) append(elements2[j]);23 24 elements2 = element.querySelectorAll('[' + name + ']');25 for(var j = 0; j < elements2.length; j++) append(elements2[j]);26 }27 }28 for(var i = 0; i < elements.length; i++) {29 var element = elements[i];30 var className = ' ' + element.className + ' ';31 var match = NG_MODULE_CLASS_REGEXP.exec(className);32 if (match) {33 moduleElements.push(element);34 modules.push((match[2] || '').replace(/\s+/g, ','));35 } else {36 if(element.attributes) {37 for (var attrName in element.attributes) {38 if(attrName == "length") continue;39 var attr = { name: attrName, value: element.attributes[attrName].value };40 41 if (names[attr.name]) {42 moduleElements.push(element);43 modules.push(attr.value);44 }45 }46 }47 }48 }49 50 for(var i = 0; i < moduleElements.length; i++) {51 var moduleElement = moduleElements[i];52 if (typeof(modules[i]) != 'undefined') {53 var module = modules[i].replace(/ /g,'').split(",");54 angular.bootstrap(moduleElement, module);55 }56 }57 }58 angular.element(document).ready(function() {59 initNgModules(document);60 });...
angular.ng-modules.js
Source:angular.ng-modules.js
1(function() {2 function initNgModules(element) {3 var elements = [element],4 moduleElements = [],5 modules = [],6 names = ['ng:module', 'ng-module', 'x-ng-module', 'data-ng-module', 'ng:modules', 'ng-modules', 'x-ng-modules', 'data-ng-modules'],7 NG_MODULE_CLASS_REGEXP = /\sng[:\-]module[s](:\s*([\w\d_]+);?)?\s/;8 function append(element) {9 element && elements.push(element);10 }11 for(var i = 0; i < names.length; i++) {12 var name = names[i];13 names[i] = true;14 append(document.getElementById(name));15 name = name.replace(':', '\\:');16 if (element.querySelectorAll) {17 var elements2;18 elements2 = element.querySelectorAll('.' + name);19 for(var j = 0; j < elements2.length; j++) append(elements2[j]);20 21 elements2 = element.querySelectorAll('.' + name + '\\:');22 for(var j = 0; j < elements2.length; j++) append(elements2[j]);23 24 elements2 = element.querySelectorAll('[' + name + ']');25 for(var j = 0; j < elements2.length; j++) append(elements2[j]);26 }27 }28 for(var i = 0; i < elements.length; i++) {29 var element = elements[i];30 var className = ' ' + element.className + ' ';31 var match = NG_MODULE_CLASS_REGEXP.exec(className);32 if (match) {33 moduleElements.push(element);34 modules.push((match[2] || '').replace(/\s+/g, ','));35 } else {36 if(element.attributes) {37 for (var attrName in element.attributes) {38 if(attrName == "length") continue;39 var attr = { name: attrName, value: element.attributes[attrName].nodeValue };40 41 if (names[attr.name]) {42 moduleElements.push(element);43 modules.push(attr.value);44 }45 }46 }47 }48 }49 50 for(var i = 0; i < moduleElements.length; i++) {51 var moduleElement = moduleElements[i];52 var module = modules[i].replace(/ /g,'').split(",");53 angular.bootstrap(moduleElement, module);54 }55 }56 angular.element(document).ready(function() {57 initNgModules(document);58 });...
Using AI Code Generation
1import { elements2 } from 'ng-mocks';2import { MyComponent } from './my.component';3import { MyModule } from './my.module';4describe('MyComponent', () => {5 it('should render', () => {6 const fixture = MockRender(MyComponent, MyModule);7 const elements = elements2('h1');8 expect(elements.length).toEqual(1);9 });10});11import { NgModule } from '@angular/core';12import { MyComponent } from './my.component';13@NgModule({14})15export class MyModule {}16import { Component } from '@angular/core';17@Component({18})19export class MyComponent {}20I’m not sure if it’s a bug or if I’m doing something wrong. I’m trying to mock a component that uses the @Input() decorator. Here is my test:21import { MockBuilder, MockRender } from 'ng-mocks';22import { AppComponent } from './app.component';23import { AppService } from './app.service';24describe('AppComponent', () => {25 beforeEach(() => MockBuilder(AppComponent, AppService));26 it('should render', () => {27 const fixture = MockRender(AppComponent);28 const element = fixture.debugElement.nativeElement;29 expect(element.querySelector('h1').textContent).toContain('Welcome to my-app!');30 });31});32I’m not sure how to provide an NgModule using the imports option. Here is my component:33import { Component, Input } from '@angular/core';34@Component({35})36export class AppComponent {37 @Input() title = 'my-app';38}39Hi, I’m trying to mock a component that uses the @Input() decorator. Here is my test:40import { MockBuilder, MockRender } from 'ng-mocks';41import { AppComponent } from './app.component';42import { AppService } from './app.service';43describe('AppComponent', () => {44 beforeEach(() => MockBuilder(AppComponent, AppService));45 it('should render
Using AI Code Generation
1import { elements2 } from 'ng-mocks';2import { findInstance } from 'ng-mocks';3import { findComponent } from 'ng-mocks';4describe('AppComponent', () => {5 let fixture: ComponentFixture<AppComponent>;6 beforeEach(async(() => {7 TestBed.configureTestingModule({8 }).compileComponents();9 }));10 beforeEach(() => {11 fixture = TestBed.createComponent(AppComponent);12 fixture.detectChanges();13 });14 it('should create the app', () => {15 const app = fixture.debugElement.componentInstance;16 expect(app).toBeTruthy();17 });18 it('should have as title \'test\'', () => {19 const app = fixture.debugElement.componentInstance;20 expect(app.title).toEqual('test');21 });22 it('should render title in a h1 tag', () => {23 const compiled = fixture.debugElement.nativeElement;24 expect(compiled.querySelector('h1').textContent).toContain('Welcome to test!');25 });26 it('should have a button', () => {27 const compiled = fixture.debugElement.nativeElement;28 expect(compiled.querySelector('button')).toBeTruthy();29 });30 it('should have a button with the text \'get data\'', () => {31 const compiled = fixture.debugElement.nativeElement;32 expect(compiled.querySelector('button').textContent).toContain('get data');33 });34 it('should have a button with the text \'get data\'', () => {35 const compiled = fixture.debugElement.nativeElement;36 expect(compiled.querySelector('button').textContent).toContain('get data');37 });38 it('should have a button with the text \'get data\'', () => {39 const compiled = fixture.debugElement.nativeElement;40 expect(compiled.querySelector('button').textContent).toContain('get data');41 });42 it('should have a button with the text \'get data\'', () => {43 const compiled = fixture.debugElement.nativeElement;44 expect(compiled.querySelector('button').textContent).toContain('get data');45 });
Using AI Code Generation
1import {elements2} from 'ng-mocks';2import {MockBuilder, MockRender} from 'ng-mocks';3describe('test', () => {4 beforeEach(() => MockBuilder(testcomponent));5 it('test', () => {6 const fixture = MockRender(testcomponent);7 const elements = elements2('div');8 expect(elements.length).toBe(1);9 expect(elements[0].nativeElement.innerText).toBe('test');10 });11});12import {MockBuilder, MockRender} from 'ng-mocks';13describe('testcomponent', () => {14 beforeEach(() => MockBuilder(testcomponent));15 it('test', () => {16 const fixture = MockRender(testcomponent);17 const elements = fixture.debugElement.queryAll(By.css('div'));18 expect(elements.length).toBe(1);19 expect(elements[0].nativeElement.innerText).toBe('test');20 });21});
Using AI Code Generation
1import { elements2 } from 'ng-mocks';2describe('test', () => {3 it('should have 2 elements', () => {4 const elements = elements2('div');5 expect(elements.length).toBe(2);6 });7});8import { elements2 } from 'ng-mocks';9describe('test', () => {10 it('should have 2 elements', () => {11 const elements = elements2('div');12 expect(elements.length).toBe(2);13 });14});15import { elements2 } from 'ng-mocks';16describe('test', () => {17 it('should have 2 elements', () => {18 const elements = elements2('div');19 expect(elements.length).toBe(2);20 });21});22import { elements2 } from 'ng-mocks';23describe('test', () => {24 it('should have 2 elements', () => {25 const elements = elements2('div');26 expect(elements.length).toBe(2);27 });28});29import { elements2 } from 'ng-mocks';30describe('test', () => {31 it('should have 2 elements', () => {32 const elements = elements2('div');33 expect(elements.length).toBe(2);34 });35});36import { elements2 } from 'ng-mocks';37describe('test', () => {38 it('should have 2 elements', () => {39 const elements = elements2('div');40 expect(elements.length).toBe(2);41 });42});43import { elements2 } from 'ng-mocks';44describe('test', () => {45 it('should have 2 elements', () => {46 const elements = elements2('div');47 expect(elements.length).toBe(2);48 });49});50import { elements2 } from 'ng-mocks';
Using AI Code Generation
1const elements2 = require('ng-mocks').elements2;2const mockElement = require('ng-mocks').mockElement;3const MockRender = require('ng-mocks').MockRender;4const MockInstance = require('ng-mocks').MockInstance;5const MockProvider = require('ng-mocks').MockProvider;6const MockRender = require('ng-mocks').MockRender;7const MockProvider = require('ng-mocks').MockProvider;8const MockInstance = require('ng-mocks').MockInstance;9const MockRender = require('ng-mocks').MockRender;10const MockInstance = require('ng-mocks').MockInstance;11const MockProvider = require('ng-mocks').MockProvider;12const MockRender = require('ng-mocks').MockRender;13const MockProvider = require('ng-mocks').MockProvider;14const MockInstance = require('ng-mocks').MockInstance;15const MockRender = require('ng-mocks').MockRender;16const MockInstance = require('ng-mocks').MockInstance;17const MockProvider = require('ng-mocks').MockProvider;18const MockRender = require('ng-mocks').MockRender;19const MockInstance = require('ng-mocks').MockInstance;20const MockProvider = require('ng-mocks').MockProvider;
Using AI Code Generation
1const elements2 = require('ng-mocks').elements2;2const fixture = TestBed.createComponent(ExampleComponent);3const elements = elements2(fixture.debugElement, 'input');4expect(elements.length).toBe(1);5import { elements2 } from 'ng-mocks';6const elements2 = require('ng-mocks').elements2;7const fixture = TestBed.createComponent(ExampleComponent);8const elements = elements2(fixture.debugElement, 'input');9expect(elements.length).toBe(1);10import { elements2 } from 'ng-mocks';11const elements2 = require('ng-mocks').elements2;12const fixture = TestBed.createComponent(ExampleComponent);13const elements = elements2(fixture.debugElement, 'input');14expect(elements.length).toBe(1);15import { elements2 } from 'ng-mocks';16const elements2 = require('ng-mocks').elements2;17const fixture = TestBed.createComponent(ExampleComponent);18const elements = elements2(fixture.debugElement, 'input');19expect(elements.length).toBe(1);20import { elements2 } from 'ng-mocks';21const elements2 = require('ng-mocks').elements2;22const fixture = TestBed.createComponent(ExampleComponent);23const elements = elements2(fixture.debugElement, 'input');24expect(elements.length).toBe(1);25import { elements2 } from 'ng-mocks';26const elements2 = require('ng-mocks').elements2;27const fixture = TestBed.createComponent(ExampleComponent);28const elements = elements2(fixture.debugElement, 'input');29expect(elements.length).toBe(1);
Using AI Code Generation
1import { elements2 } from 'ng-mocks';2const elements = elements2('my-component');3import { elements2 } from 'ng-mocks';4const elements = elements2('my-component');5import { elements2 } from 'ng-mocks';6const elements = elements2('my-component');7import { elements2 } from 'ng-mocks';8const elements = elements2('my-component');9import { elements2 } from 'ng-mocks';10const elements = elements2('my-component');11import { elements2 } from 'ng-mocks';12const elements = elements2('my-component');13import { elements2 } from 'ng-mocks';14const elements = elements2('my-component');15import { elements2 } from 'ng-mocks';16const elements = elements2('my-component');17import { elements2 } from 'ng-mocks';18const elements = elements2('my-component');19import { elements2 } from 'ng-mocks';20const elements = elements2('my-component');
Using AI Code Generation
1import { TestBed } from '@angular/core/testing';2import { TestService } from './test.service';3import { MockElementRef } from 'ng-mocks';4describe('TestService', () => {5 beforeEach(() => TestBed.configureTestingModule({6 {7 useValue: {8 nativeElement: {9 style: {10 },11 },12 },13 },14 }));15 it('should be created', () => {16 const service: TestService = TestBed.get(TestService);17 expect(service).toBeTruthy();18 });19});20import { ElementRef } from '@angular/core';21import { TestBed } from '@angular/core/testing';22import { elements2 } from 'ng-mocks';23export class TestService {24 constructor(private element: ElementRef) { }25 public getDisplayValue(): string {26 return this.element.nativeElement.style.display;27 }28}29describe('TestService', () => {30 beforeEach(() => TestBed.configureTestingModule({31 {32 useValue: {33 nativeElement: {34 style: {35 },36 },37 },38 },39 }));40 it('should be created', () => {41 const service: TestService = TestBed.get(TestService);42 expect(service).toBeTruthy();43 });44 it('should get display value', () => {45 const service: TestService = TestBed.get(TestService);46 const displayValue = service.getDisplayValue();47 expect(displayValue).toEqual('none');48 });49});
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!