How to use tplFooter method in ng-mocks

Best JavaScript code snippet using ng-mocks

events.js

Source:events.js Github

copy

Full Screen

1define(['jquery', 'underscore', 'domReady', 'app',2 'tpl!templates/home.html',3 'tpl!templates/analytics/projectAnalyticsFT.html',4 'tpl!templates/analytics/earnedSchedule.html',5 'tpl!templates/analytics/scheduleVAR.html',6 'tpl!templates/analytics/spa.html',7 'tpl!templates/analytics/spiCPI.html',8 'tpl!templates/footers/reportsFooter.html',9 'tpl!templates/footers/blankFooter.html',10 'tpl!templates/footers/analyticsFooterA.html',11 'tpl!templates/footers/analyticsFooterB.html',12 'tpl!templates/spinner.html',13 'tpl!templates/reports/cpr1.html',14 'tpl!templates/reports/cpr2.html',15 'tpl!templates/reports/cpr3.html',16 'tpl!templates/reports/cpr4.html',17 'tpl!templates/reports/cpr5.html',18 'tpl!templates/reports/cprTWBS.html',19 'tpl!templates/reports/cprTOBS.html',20 'moment', 'kendo', 'FileSaver', 'en-GB', 'bootstrap-select',21 'Blob', 'base64', 'jszip',22 'jquery.table2excel', 'bootstrap'], function ($, _, domReady, App,23 homeTpl, projectAnalyticsFTTpl, earnedScheduleTpl, scheduleTpl, spaTpl, spiCPITpl,24 reportFooterTpl, blankFooterTpl, analyticsFooterATpl, analyticsFooterBTpl,25 spinnerTpl, cpr1, cpr2, cpr3, cpr4a, cpr4b, cpr5, cprTWBS, cprTOBS, moment) {26 domReady(function () {27 kendo.culture('en-GB');28 var doc = $(document),29 bkgChange = $('.bkgChange'),30 mainBody = $('div.mainBody'),31 footer = $('div.footer'),32 tplFooter = '',33 tplId = '',34 loadingWheel = spinnerTpl,35 combineData = [];36 console.log(App.serviceRoot);37 /** ON LOAD **/38 App.SpinnerTpl(loadingWheel, 1);//Add spinner on load39 App.getUsername();40 var hierarchySets = App.projectData();41 $.when(hierarchySets).done(function (hData) {42 if (_.isObject(hData)) {43 combineData.push(hData.d.results);44 console.log(combineData);45 } else {46 combineData.push(_.first(hData).d.results);47 }48 mainBody.html(homeTpl({'combineData': combineData}));49 footer.html(blankFooterTpl);50 if (combineData[0].length > 1) {51 doc.find('.menuItem').addClass('menu-disabled');52 } else {53 var project = _.first(combineData[0]);54 App.setProjectID(project.ProjectSelection);55 App.setVersion();56 App.setSnapshotList();57 }58 App.SpinnerTpl(loadingWheel, 0);//remove spinner after load + 1 sec59 });60 /** END ON LOAD **/61 /** Updated Code to allow for Selects to work inside Bootstrap Dropdown **/62 /*doc.on('click','.dropdown',function(e){63 e.stopPropagation();64 });*/65 doc.on('change', '#projectSets', function (e) {66 e.preventDefault();67 var value = $("#projectSets").val();68 console.log(value);69 if (_.isEmpty(value)) {70 doc.find('.menuItem').addClass('menu-disabled');71 value = undefined;72 App.setProjectID(value);73 } else {74 App.setProjectID(value);75 App.setVersion();76 if (!_.isEmpty(App.projectID) || !_.isUndefined(App.projectID)) {77 doc.find('.menuItem').removeClass('menu-disabled');78 }79 App.ClearDataStore();80 }81 console.log('Project ID: ' + App.projectID);82 console.log('Project URLs: ' + App.urlSnapshotSet + ' ' + App.urlHierarchySet + ' ' + App.urlHierarchySelectionSet);83 });84 doc.on('click', 'body', function (e) {85 var target = $(e.target);86 if (target.parents('.bootstrap-select').length) {87 e.stopPropagation();88 $('.bootstrap-select.open').removeClass('open');89 }90 });91 /* SPA change hierarchy event */92 doc.on('change', '#hChange', function (e) {93 e.preventDefault();94 var selected = $(this),95 Hier = selected.val(),96 chartType = selected.find(':selected').attr('data-chartType'),97 selectedTitle = selected.find(':selected').attr('data-title'),98 hierarchyList = doc.find("div#treelist"),99 chartDataSource,100 self = $(this),101 $treeList = doc.find("div#treelist").data("kendoTreeList"),102 $chartGraph = doc.find("div#chart").data("kendoChart");103 console.log(Hier + ' ' + chartType);104 if (App.HierarchySelectionID === Hier) {105 console.log('hit HierarchySelectionID is same');106 alert('Your selection ' + selectedTitle + ' is the same as the default');107 return;108 } else {109 console.log('hit HierarchySelectionID is differnt');110 App.HierarchySelectionID = Hier;111 if (App.CheckHierarchyId()) {112 return;113 } else {114 App.ClearDataStore();115 App.setHierarchySelection(chartType.toUpperCase());116 selected.val(App.HierarchySelectionID);117 }118 }119 App.setVersion();120 App.SpinnerTpl(loadingWheel, 1);121 var hierData = App.HierarchySet();122 var chartData = App.SnapshotSet();123 $.when(hierData, chartData).done(function (hData, cData) {124 /** Error handler **/125 if (App.apiErrorHandler(e.currentTarget, loadingWheel, chartData)) {126 return;127 }128 /** Error handler **/129 /**130 * New Global Datastore set function131 **/132 App.DataStore.setData(cData, hData);133 /** Clear Hierarchy and Chart **/134 /**/135 if (!_.isUndefined($treeList)) {136 }137 $treeList.destroy();138 $chartGraph.destroy();139 doc.find("div#chart").empty();140 hierarchyList.empty();141 // hierarchyList.off('click');142 // $chartGraph.dataSource = App.DataStore.chart;143 if (chartType.toUpperCase() === 'SPICPI') {144 var cpiSpiTrendData = App.cpiSpiTrend(App.DataStore.chart.options.data, 'Quantity');145 var cpiSpiTrend = App.AssignStore(cpiSpiTrendData);146 App.createSpiCpiChart(cpiSpiTrend, App.CpiSpiSeries, false);147 } else {148 var refined = App.FilterChartData(App.DataStore.chart.options.data, 'Quantity');149 App.DataStore.chart = App.AssignStore(refined.graph);150 App.createChart(App.DataStore.chart, App.series, false, 'Quantity');151 }152 App.hierListInitialize(App.DataStore.hierarchy);153 /** Clear Hierarchy and Chart **/154 $(document).bind("kendo:skinChange", App.createChart);155 $(".chart-type-chooser").bind("change", App.refreshChart);156 $('.dataTypeAnalytics').val('Quantity');157 $('.costType').hide();158 /*App.refreshChart();*/159 // App.hierEvent(hierarchyList,'Quantity',chartType.toUpperCase());//event for changing chart data160 App.analyticsTplConfig(self);161 _.debounce(App.expandTreeList(hierarchyList), 500);162 _.debounce(App.SpinnerTpl(loadingWheel, 0), 1000);163 });164 });165 /* CPI SPI change hierarchy event */166 doc.on('change', '#cpiSpiChange', function (e) {167 e.preventDefault();168 var selected = $(this),169 Hier = selected.val(),170 chartType = selected.find(':selected').attr('data-chartType'),171 selectedTitle = selected.find(':selected').attr('data-title'),172 hierarchyList = doc.find("div#treelist"),173 chartDataSource,174 self = $(this),175 $treeList = doc.find("div#treelist").data("kendoTreeList"),176 $chartGraph = doc.find("div#chart").data("kendoChart");177 App.dataType = 'Quantity';178 console.log(Hier + ' ' + chartType);179 if (App.HierarchySelectionID === Hier) {180 console.log('hit HierarchySelectionID is same');181 alert('Your selection ' + selectedTitle + ' is the same as the default');182 return;183 } else {184 console.log('hit HierarchySelectionID is differnt');185 App.HierarchySelectionID = Hier;186 if (App.CheckHierarchyId()) {187 return;188 } else {189 App.DataStore.clearSpiCpiData();//clears cpiSpi data from storage190 App.setHierarchySelection(chartType.toUpperCase());191 selected.val(App.HierarchySelectionID);192 }193 }194 // App.setVersion();195 App.setDataSelection();196 var svData = App.SVSet();// get SnapShot Cost Data197 var hierData = App.HierarchySet();//get hierarchy Data198 $.when(hierData, svData).done(function (hData, sData) {199 if (App.apiErrorHandler(e.currentTarget, loadingWheel, sData)) {200 return;201 }202 App.DataStore.setSpiCpiData(sData,hData);203 $treeList.destroy();204 $chartGraph.destroy();205 doc.find("div#chart").empty();206 hierarchyList.empty();207 // hierarchyList.off('click');208 App.createSpiCpiChart(App.DataStore.spiCpiChart, App.CpiSpiSeries, false,App.dataType);209 App.hierListInitialize(App.DataStore.hierarchySv);210 /** Clear Hierarchy and Chart **/211 $(document).bind("kendo:skinChange", App.createSpiCpiChart);212 $(".chart-type-chooser").bind("change", App.refreshChart);213 $('.dataTypeAnalytics').val('Quantity');214 $('.costType').hide();215 /*App.refreshChart();*/216 // App.hierEvent(hierarchyList,'Quantity',chartType.toUpperCase());//event for changing chart data217 App.analyticsTplConfig(self);218 _.debounce(App.expandTreeList(hierarchyList), 500);219 _.debounce(App.SpinnerTpl(loadingWheel, 0), 1000);220 });221 });222 /** Updated Code from 100 to 267 - 072815**/223 doc.on('click', '.homeTpl', function (e) {224 e.preventDefault();225 var combineData = [];226 var hierarchySets = App.projectData();227 $.when(hierarchySets).done(function (hData) {228 combineData.push(hData.d.results);229 App.SpinnerTpl(loadingWheel, 1);230 var id = $(this).data('temp'),231 name = $(this).data('name');232 bkgChange.attr('id', 'indexBG');233 App.Project(homeTpl, blankFooterTpl, combineData);234 $("#projectSets").val(App.projectID);235 App.SpinnerTpl(loadingWheel, 0);236 });237 });238 doc.on('click', '.getAnalytics', function (e) {239 e.preventDefault();240 if (App.CheckProdId()) {241 return;242 }243 App.addSpinner(e.currentTarget);//bkg loading244 App.SpinnerTpl(loadingWheel, 1);245 var self = $(this),246 combineData = [],247 chartData = [],248 esData = [],249 svData = [],250 hierData = [],251 vData = [],252 version = '',253 chartDataSource = '',254 id = self.data('temp'),//Name of DIV255 name = self.data('name');//File Name to Export As256 /* this is to reset global dataType upon entry*/257 console.log(id);258 App.dataType = 'Quantity';259 App.setHierarchySelection(id.toUpperCase());260 var List = App.HierarchyListSet();261 App.HierarchySelectionID = '';262 $.when(List).done(function (lData) {263 App.DataStore.hierarchyList = lData.d.results;264 var defList = $.grep(App.DataStore.hierarchyList, function (item) {265 if (App.DataStore.hierarchyList.length === 1) {266 return item;267 }268 return item.Default === "X";269 });270 console.log(defList);271 if (defList.length >= 1) {272 App.HierarchySelectionID = _.first(defList).HierarchySelection;273 }274 console.log('HierarchySelectionID Selection: ' + App.HierarchySelectionID);275 /**GET REPORT TPL ON THE FLY**/276 var retrieveTpl = 'tpl!templates/analytics/' + id + '.html';277 requirejs([retrieveTpl], function (tempTpl) {278 tplId = tempTpl;279 switch (name) {280 case 'projectAnalytics':281 tplFooter = analyticsFooterATpl;282 break;283 default:284 tplFooter = analyticsFooterBTpl;285 break;286 };287 combineData[0] = App.DataStore.hierarchyList;288 App.Project(tplId, tplFooter, combineData);289 //$("#hChange").val(App.projectID);290 switch (name) {291 case 'earnedSchedule':292 App.setDataSelection();293 esData = App.ESSet();294 $.when(esData).done(function (eData) {295 App.createSplittersFT();296 if (App.apiErrorHandler(e.currentTarget, loadingWheel, eData)) {297 return;298 }299 var filteredEs = App.ESfilter(eData.d.results,App.dataType);300 var dataStore = App.AssignStore(filteredEs);301 App.createSpiCpiChart(dataStore, App.seriesES, true, App.dataType);302 $(document).bind("kendo:skinChange", App.createSpiCpiChart);303 $(".chart-type-chooser").bind("change", App.refreshChart);304 App.analyticsTplConfig(self);305 //_.debounce(App.expandTreeList(hierarchyList), 500);306 _.debounce(App.SpinnerTpl(loadingWheel, 0), 1000);307 });308 break;309 case 'spiCPI':310 App.setDataSelection();311 svData = App.SVSet();// get SnapShot Cost Data312 hierData = App.HierarchySet();//get hierarchy Data313 $.when(hierData, svData).done(function (hData, sData) {314 App.createSplittersFT();315 if (App.apiErrorHandler(e.currentTarget, loadingWheel, sData)) {316 return;317 }318 App.DataStore.setSpiCpiData(sData,hData);319 App.hierListInitialize(App.DataStore.hierarchySv);320 App.createSpiCpiChart(App.DataStore.spiCpiChart, App.CpiSpiSeries, false,App.dataType);321 var projectName = App.DataStore.hierarchySv[0].ExtID;322 $(document).bind("kendo:skinChange", App.createSpiCpiChart);323 //$(".chart-type-chooser").bind("change", App.refreshChart);324 var hierarchyList = $("div#treelist");325 App.hierSpiCpiEvent(hierarchyList);//event for changing chart data326 App.analyticsTplConfig(self);327 $('#cpiSpiChange').val(App.HierarchySelectionID);328 _.debounce(App.expandTreeList(hierarchyList), 500);329 _.debounce(App.SpinnerTpl(loadingWheel, 0), 1000);330 });331 break;332 case 'spa':333 if (_.isEmpty(App.DataStore.chart)) {334 App.setDataSelection();335 chartData = App.SnapshotSet();// get SnapShot Cost Data336 }337 hierData = App.HierarchySet();//get hierarchy Data338 $.when(hierData, chartData).done(function (hData, cData) {339 App.createSplittersFT();340 if (App.apiErrorHandler(e.currentTarget, loadingWheel, cData)) {341 return;342 }343 if (!_.isEmpty(cData)) {344 App.DataStore.setData(cData, hData);345 }346 var refined = App.FilterChartData(App.DataStore.chart.options.data, App.dataType);347 App.DataStore.chart = App.AssignStore(refined.graph);348 App.DataStore.hierarchy = _.first(hData).d.results;349 App.hierListInitialize(App.DataStore.hierarchy);350 App.createChart(App.DataStore.chart, App.series, false, App.dataType);351 var projectName = App.DataStore.hierarchy[0].ExtID;352 $(document).bind("kendo:skinChange", App.createChart);353 //$(".chart-type-chooser").bind("change", App.refreshChart);354 var hierarchyList = $("div#treelist");355 App.hierEvent(hierarchyList, App.dataType, name);//event for changing chart data356 App.analyticsTplConfig(self);357 $('#hChange').val(App.HierarchySelectionID);358 _.debounce(App.expandTreeList(hierarchyList), 500);359 _.debounce(App.SpinnerTpl(loadingWheel, 0), 1000);360 });361 break;362 case 'scheduleVAR':363 if (_.isEmpty(App.DataStore.chart)) {364 console.log('hit empty chart request');365 App.setDataSelection();366 chartData = App.SnapshotSet();// get SnapShot Cost Data367 }368 hierData = App.HierarchySet();//get hierarchy Data369 $.when(hierData, chartData).done(function (hData, cData) {370 App.createSplittersFT();371 if (App.apiErrorHandler(e.currentTarget, loadingWheel, cData)) {372 return;373 }374 if (!_.isEmpty(cData)) {375 App.DataStore.setData(cData, hData);376 }377 App.DataStore.hierarchy = _.first(hData).d.results;378 App.hierListInitialize(App.DataStore.hierarchy);379 var refined = App.FilterChartData(App.DataStore.chart.options.data, App.dataType);380 App.DataStore.chart = App.AssignStore(refined.graph);381 App.createChart(App.DataStore.chart, App.seriesSV, true, App.dataType);382 var projectName = App.DataStore.hierarchy[0].ExtID;383 $(document).bind("kendo:skinChange", App.createChart);384 //$(".chart-type-chooser").bind("change", App.refreshChart);385 App.analyticsTplConfig(self);386 //_.debounce(App.expandTreeList(hierarchyList), 500);387 _.debounce(App.SpinnerTpl(loadingWheel, 0), 1000);388 });389 break;390 default:391 console.log('hit default');392 break;393 }394 });395 });//when hierarchy default found396 });397 doc.on('click', '.getReport', function (e) {398 e.preventDefault();399 if (App.CheckProdId()) {400 return;401 }402 /* this is to reset global dataType upon entry*/403 ;404 App.addSpinner(e.currentTarget);//bkg loading405 App.SpinnerTpl(loadingWheel, 1);406 var combineData = [],407 self = $(this),408 id = self.data('temp'),409 sheet = self.data('sheet'),//Worksheet Name410 version = '', projectData = '', hierData = '', vData = '', hier = '', costs = '', chartData = '',411 totals = '', gauges = '', chartDataSource = '', currentVersion = [],412 retrieveTpl = 'tpl!templates/reports/' + id + '.html';413 console.log(id);414 App.setHierarchySelection(id.toUpperCase());415 var List = App.HierarchyListSet();416 App.HierarchySelectionID = '';417 $.when(List).done(function (lData) {418 App.DataStore.hierarchyList = lData.d.results;419 var defList = $.grep(App.DataStore.hierarchyList, function (item) {420 if (App.DataStore.hierarchyList.length === 1) {421 return item;422 }423 return item.Default === "X";424 });425 console.log(defList);426 if (defList.length >= 1) {427 App.HierarchySelectionID = _.first(defList).HierarchySelection;428 }429 console.log('HierarchySelectionID Selection: ' + App.HierarchySelectionID);430 App.setDataSelection();431 requirejs([retrieveTpl], function (tempTpl) {432 /********* Data Processing *************/433 if (_.isEmpty(App.DataStore.chart)) {434 console.log('hit empty chart request');435 chartData = App.SnapshotSet();// get SnapShot Cost Data436 projectData = App.projectData();//get project Data437 hierData = App.HierarchySet();//get hierarchy Data438 }439 $.when(projectData, hierData, chartData).done(function (pData, hData, cData) {//holds on for async data calls440 /** Error handler **/441 if (App.apiErrorHandler(e.currentTarget, loadingWheel, cData)) {442 return;443 }444 /** Error handler **/445 if (!_.isEmpty(cData)) {446 App.DataStore.project = _.first(pData).d.results;447 App.DataStore.setData(cData, hData);448 }449 hier = App.DataStore.hierarchy;450 costs = App.DataStore.chart.options.data;451 App.dataType = 'Quantity';452 switch (sheet) {453 case 'CPR-1':454 console.log('hit 1');455 combineData[0] = App.DataStore.project;456 combineData[1] = App.formatOneTotals(hier, costs, App.dataType);//Return Totals for format one457 /********* Template Processing *********/458 tplId = tempTpl;459 tplFooter = reportFooterTpl;460 App.Project(tplId, tplFooter, combineData);461 bkgChange.attr('id', 'cprBG');462 App.reportTplConfig(self);463 /********* End Template Processing *****/464 App.SpinnerTpl(loadingWheel, 0);465 break;466 case 'CPR-2':467 console.log('hit 2');468 /********* Data Processing *************/469 combineData[1] = App.formatOneTotals(hier, costs, App.dataType);//Return Totals for format one470 /********* Template Processing *********/471 tplId = tempTpl;472 tplFooter = reportFooterTpl;473 App.Project(tplId, tplFooter, combineData);474 bkgChange.attr('id', 'cprBG');475 App.reportTplConfig(self);476 /********* End Template Processing *****/477 App.SpinnerTpl(loadingWheel, 0);478 break;479 case 'CPR-3':480 console.log('hit 3');481 /********* Template Processing *********/482 combineData[0] = App.formatThreeTotals(costs,App.dataType);483 tplId = tempTpl;484 tplFooter = reportFooterTpl;485 App.Project(tplId, tplFooter, combineData);486 bkgChange.attr('id', 'cprBG');487 App.reportTplConfig(self);488 /********* End Template Processing *****/489 App.SpinnerTpl(loadingWheel, 0);490 break;491 case 'CPR-4':492 console.log('hit 4');493 /********* Template Processing *********/494 combineData[0] = App.DataStore.project;495 combineData[1] = App.formatFourTotals(costs);496 combineData[2] = {"months": App.unit.months};497 console.log(combineData[1]);498 tplId = tempTpl;499 tplFooter = reportFooterTpl;500 App.Project(tplId, tplFooter, combineData);501 bkgChange.attr('id', 'cprBG');502 App.reportTplConfig(self);503 /********* End Template Processing *****/504 App.SpinnerTpl(loadingWheel, 0);505 break;506 case 'CPR-5':507 console.log('hit 5');508 var data = App.FilterChartData(costs, App.dataType);509 combineData[0] = App.DataStore.project;510 combineData[1] = App.formatFiveTotals(data);511 /********* Template Processing *********/512 tplId = tempTpl;513 tplFooter = reportFooterTpl;514 App.Project(tplId, tplFooter, combineData);515 bkgChange.attr('id', 'cprBG');516 App.reportTplConfig(self);517 /********* End Template Processing *****/518 App.SpinnerTpl(loadingWheel, 0);519 break;520 case 'CPR-TWBS':521 console.log('hit TW');522 combineData[0] = App.DataStore.project;523 combineData[1] = App.formatOneTotals(hier, costs, App.dataType);//Return Totals for format one524 /********* Template Processing *********/525 tplId = tempTpl;526 tplFooter = reportFooterTpl;527 App.Project(tplId, tplFooter, combineData);528 bkgChange.attr('id', 'cprBG');529 App.reportTplConfig(self);530 /********* End Template Processing *****/531 App.SpinnerTpl(loadingWheel, 0);532 break;533 case 'CPR-TOBS':534 console.log('hit TO');535 combineData[0] = App.DataStore.project;536 combineData[1] = App.formatOneTotals(hier, costs, App.dataType);//Return Totals for format one537 /********* Template Processing *********/538 tplId = tempTpl;539 tplFooter = reportFooterTpl;540 App.Project(tplId, tplFooter, combineData);541 bkgChange.attr('id', 'cprBG');542 App.reportTplConfig(self);543 /********* End Template Processing *****/544 App.SpinnerTpl(loadingWheel, 0);545 break;546 default:547 console.log('hit default');548 break;549 }550 });//end of when clause551 /********* End Data Processing *********/552 });//end of template require553 });//when hierarchy default found554 });555 doc.on('click', 'span.export-excel', function (e) {556 e.preventDefault();557 var tableName = $(this).data('id'),558 sheet = $(this).data('sheet'),559 name = $(this).data('name');560 App.ExportTable('#' + tableName, sheet, name);561 });562 doc.on('click', 'span.export-chart-pdf', function (e) {563 e.preventDefault();564 var fileName = $(this).data('id');565 kendo.drawing.drawDOM($('#chart')).then(function (group) {566 kendo.drawing.pdf.saveAs(group, fileName + ".pdf");567 });568 });569 doc.on('click', 'span.export-report-pdf', function (e) {570 e.preventDefault();571 var fileName = $(this).data('id');572 kendo.drawing.drawDOM($('.exportTable')).then(function (group) {573 kendo.drawing.pdf.saveAs(group, fileName + ".pdf");574 });575 });576 doc.on('click', 'a#clearRAG', function (e) {577 e.preventDefault();578 doc.find('.rag').each(function (key, value) {579 $(this).css('background-color', '');580 });581 $('#applyRAGButton').show();582 $('#clearRAGButton').hide();583 });584 doc.on('click', 'a#applyRAG', function (e) {585 e.preventDefault();586 doc.find('.rag').each(function (key, value) {587 var ragColour = $(this).data('colour');588 $(this).css('background-color', ragColour);589 });590 $('#applyRAGButton').hide();591 $('#clearRAGButton').show();592 });593 doc.on('change', '.dataType', function (e) {594 e.preventDefault();595 App.SpinnerTpl(loadingWheel, 1);596 var self = $(this).find(':selected'),597 dataType = self.val(),598 logic = self.attr('data-sheet'),599 reportType = self.attr('data-temp');600 console.log('type: ' + dataType + ' and Report: ' + reportType);601 App.dataType = dataType;602 if (dataType === 'Quantity') {603 $('.costType').hide();604 } else if (dataType === 'Costs') {605 dataType = 'IntValProjCurr';606 $('.costType').show();607 //App.SpinnerTpl(loadingWheel, 0);608 //return;609 } else {610 }611 var retrieveTpl = 'tpl!templates/reports/' + reportType + '.html';612 var hier = App.DataStore.hierarchy;613 var costs = App.DataStore.chart.options.data;614 requirejs([retrieveTpl], function (tempTpl) {615 switch (logic) {616 case 'CPR-1':617 console.log('hit 1');618 combineData[0] = App.DataStore.project;619 combineData[1] = App.formatOneTotals(hier, costs, dataType);//Return Totals for format one620 /********* Template Processing *********/621 tplId = tempTpl;622 tplFooter = reportFooterTpl;623 App.Project(tplId, tplFooter, combineData);624 //bkgChange.attr('id', 'cprBG');625 App.reportTplConfig(self);626 console.log(dataType);627 if (dataType === 'Quantity') {628 $('.costType').hide();629 $('#units').html('HRS');630 $('#cpr1Title').html('CPR FORMAT 1 - WBS (MANHOURS)');631 } else {632 $('.costType').show();633 $('#units').html('£');634 $('#cpr1Title').html('CPR FORMAT 1 - WBS (MATERIAL)');635 $('.dataType').val('Costs');636 if (dataType === 'IntValProjCurr') {637 $('.costType').val('IntValProjCurr');638 } else {639 $('.costType').val('ExtValProjCurr');640 }641 }642 /********* End Template Processing *****/643 App.SpinnerTpl(loadingWheel, 0);644 break;645 case 'CPR-2':646 console.log('hit 2');647 /********* Data Processing *************/648 combineData[0] = App.DataStore.project;649 combineData[1] = App.formatOneTotals(hier, costs, dataType);//Return Totals for format one650 /********* Template Processing *********/651 tplId = tempTpl;652 tplFooter = reportFooterTpl;653 App.Project(tplId, tplFooter, combineData);654 //bkgChange.attr('id', 'cprBG');655 App.reportTplConfig(self);656 if (dataType === 'Quantity') {657 $('.costType').hide();658 $('#units').html('HRS');659 $('#cpr2Title').html('CPR FORMAT 2 - OBS (MANHOURS)');660 } else {661 $('.costType').show();662 $('#units').html('£');663 $('#cpr2Title').html('CPR FORMAT 2 - OBS (MATERIAL)');664 $('.dataType').val('Costs');665 if (dataType === 'IntValProjCurr') {666 $('.costType').val('IntValProjCurr');667 } else {668 $('.costType').val('ExtValProjCurr');669 }670 }671 /********* End Template Processing *****/672 App.SpinnerTpl(loadingWheel, 0);673 break;674 case 'CPR-3':675 console.log('hit 3');676 /********* Template Processing *********/677 combineData[0] = App.formatThreeTotals(costs,dataType);678 tplId = tempTpl;679 tplFooter = reportFooterTpl;680 App.Project(tplId, tplFooter, combineData);681 bkgChange.attr('id', 'cprBG');682 App.reportTplConfig(self);683 if (dataType === 'Quantity') {684 $('.costType').hide();685 $('#units').html('HRS');686 $('#cpr3Title').html('CPR FORMAT 3 - BASELINE (MANHOURS)');687 } else {688 $('.costType').show();689 $('#units').html('£');690 $('#cpr3Title').html('CPR FORMAT 3 - BASELINE (MATERIAL)');691 $('.dataType').val('Costs');692 if (dataType === 'IntValProjCurr') {693 $('.costType').val('IntValProjCurr');694 } else {695 $('.costType').val('ExtValProjCurr');696 }697 }698 /********* End Template Processing *****/699 App.SpinnerTpl(loadingWheel, 0);700 break;701 case 'CPR-4':702 console.log('hit 4');703 /********* Template Processing *********/704 combineData[0] = App.DataStore.project;705 combineData[1] = App.formatFourTotals(costs, dataType);706 combineData[2] = {"months": App.unit.months};707 console.log(combineData[1]);708 tplId = tempTpl;709 tplFooter = reportFooterTpl;710 App.Project(tplId, tplFooter, combineData);711 //bkgChange.attr('id', 'cprBG');712 App.reportTplConfig(self);713 if (dataType === 'Quantity') {714 $('.costType').hide();715 $('#units').html('HRS');716 $('#cpr4Title').html('CPR FORMAT 4 - STAFFING/FORECAST (MANHOURS)');717 } else {718 $('.costType').show();719 $('#units').html('£');720 $('#cpr4Title').html('CPR FORMAT 4 - STAFFING/FORECAST (MATERIAL)');721 $('.dataType').val('Costs');722 if (dataType === 'IntValProjCurr') {723 $('.costType').val('IntValProjCurr');724 } else {725 $('.costType').val('ExtValProjCurr');726 }727 }728 /********* End Template Processing *****/729 App.SpinnerTpl(loadingWheel, 0);730 break;731 case 'CPR-5':732 console.log('hit 5');733 /* var totals = App.DataStore.chartTotals;734 var gauges = App.DataStore.gaugesData;*/735 var data = App.FilterChartData(costs, dataType);736 combineData[0] = App.DataStore.project;737 combineData[1] = App.formatFiveTotals(data);738 /********* Template Processing *********/739 tplId = tempTpl;740 tplFooter = reportFooterTpl;741 App.Project(tplId, tplFooter, combineData);742 //bkgChange.attr('id', 'cprBG');743 App.reportTplConfig(self);744 if (dataType === 'Quantity') {745 $('.costType').hide();746 $('#units').html('HRS');747 $('#cpr5Title').html('CPR FORMAT 5 - VAR (MANHOURS)');748 } else {749 $('.costType').show();750 $('#units').html('£');751 $('#cpr5Title').html('CPR FORMAT 5 - VAR (MATERIAL)');752 $('.dataType').val('Costs');753 if (dataType === 'IntValProjCurr') {754 $('.costType').val('IntValProjCurr');755 } else {756 $('.costType').val('ExtValProjCurr');757 }758 }759 /********* End Template Processing *****/760 App.SpinnerTpl(loadingWheel, 0);761 break;762 case 'CPR-TWBS':763 console.log('hit TW');764 combineData[0] = App.DataStore.project;765 combineData[1] = App.formatOneTotals(hier, costs, dataType);//Return Totals for format one766 /********* Template Processing *********/767 tplId = tempTpl;768 tplFooter = reportFooterTpl;769 App.Project(tplId, tplFooter, combineData);770 //bkgChange.attr('id', 'cprBG');771 App.reportTplConfig(self);772 if (dataType === 'Quantity') {773 $('.costType').hide();774 $('#units').html('HRS');775 $('#cprTWTitle').html('CPR FORMAT TREND - WBS (MANHOURS)');776 } else {777 $('.costType').show();778 $('#units').html('£');779 $('#cprTWTitle').html('CPR FORMAT TREND - WBS (MATERIAL)');780 $('.dataType').val('Costs');781 if (dataType === 'IntValProjCurr') {782 $('.costType').val('IntValProjCurr');783 } else {784 $('.costType').val('ExtValProjCurr');785 }786 }787 /********* End Template Processing *****/788 App.SpinnerTpl(loadingWheel, 0);789 break;790 case 'CPR-TOBS':791 console.log('hit TO');792 combineData[0] = App.DataStore.project;793 combineData[1] = App.formatOneTotals(hier, costs, dataType);//Return Totals for format one794 /********* Template Processing *********/795 tplId = tempTpl;796 tplFooter = reportFooterTpl;797 App.Project(tplId, tplFooter, combineData);798 //bkgChange.attr('id', 'cprBG');799 App.reportTplConfig(self);800 if (dataType === 'Quantity') {801 $('.costType').hide();802 $('#units').html('HRS');803 $('#cprTOTitle').html('CPR FORMAT TREND - OBS (MANHOURS)');804 } else {805 $('.costType').show();806 $('#units').html('£');807 $('#cprTOTitle').html('CPR FORMAT TREND - OBS (MATERIAL)');808 $('.dataType').val('Costs');809 if (dataType === 'IntValProjCurr') {810 $('.costType').val('IntValProjCurr');811 } else {812 $('.costType').val('ExtValProjCurr');813 }814 }815 /********* End Template Processing *****/816 App.SpinnerTpl(loadingWheel, 0);817 break;818 default:819 console.log('hit default');820 break;821 }822 });823 });824 doc.on('change', '.dataTypeAnalytics', function (e) {825 e.preventDefault();826 App.SpinnerTpl(loadingWheel, 1);827 var self = $(this).find(':selected'),828 dataType = self.val(),829 $chartGraph = doc.find("div#chart"),830 logic = self.attr('data-name'),831 combineData = [],832 hier = '';833 costs = '';834 reportType = self.attr('data-temp');835 console.log('type: ' + dataType + ' and Report: ' + reportType);836 App.dataType = dataType;837 if (dataType === 'Quantity') {838 $('.costType').hide();839 } else if (dataType === 'Costs') {840 dataType = 'IntValProjCurr';841 $('.costType').show();842 } else {843 }844 var retrieveTpl = 'tpl!templates/analytics/' + reportType + '.html';845 /* send hierarchy list to template*/846 combineData[0] = App.DataStore.hierarchyList;847 switch (logic) {848 case 'projectAnalytics':849 tplFooter = analyticsFooterATpl;850 break;851 default:852 tplFooter = analyticsFooterBTpl;853 break;854 }855 requirejs([retrieveTpl], function (tempTpl) {856 tplId = tempTpl;857 App.Project(tplId, tplFooter, combineData);858 switch (logic) {859 case 'spa':860 hier = App.DataStore.hierarchy;861 costs = App.DataStore.chart.options.data;862 console.log(combineData);863 App.createSplittersFT();864 App.hierListInitialize(hier);865 var refined = App.FilterChartData(costs, dataType);866 App.DataStore.chart = App.AssignStore(refined.graph);867 App.createChart(App.DataStore.chart, App.series, false, dataType);868 var projectName = App.DataStore.hierarchy[0].ExtID;869 $(document).bind("kendo:skinChange", App.createChart);870 $(".chart-type-chooser").bind("change", App.refreshChart);871 var hierarchyList = $("div#treelist");872 App.hierEvent(hierarchyList, dataType);//event for changing chart data873 App.analyticsTplConfig(self);874 console.warn("Selected Type " + dataType);875 if (dataType === 'Quantity') {876 $('.costType').hide();877 } else {878 $('.costType').show();879 $('.dataTypeAnalytics').val('Costs');880 if (dataType === 'IntValProjCurr') {881 $('.costType').val('IntValProjCurr');882 } else {883 $('.costType').val('ExtValProjCurr');884 }885 }886 $('#hChange').val(App.HierarchySelectionID);887 _.debounce(App.expandTreeList(hierarchyList), 500);888 _.debounce(App.SpinnerTpl(loadingWheel, 0), 1000);889 break;890 case 'earnedSchedule':891 App.setDataSelection();892 esData = App.ESSet();893 $.when(esData).done(function (eData) {894 App.createSplittersFT();895 if (App.apiErrorHandler(e.currentTarget, loadingWheel, eData)) {896 return;897 }898 var filteredEs = App.ESfilter(eData.d.results, dataType);899 var dataStore = App.AssignStore(filteredEs);900 App.createSpiCpiChart(dataStore, App.seriesES, true, dataType);901 $(document).bind("kendo:skinChange", App.createSpiCpiChart);902 $(".chart-type-chooser").bind("change", App.refreshChart);903 App.analyticsTplConfig(self);904 console.log("Selected Type " + dataType);905 if (dataType === 'Quantity') {906 $('.costType').hide();907 } else {908 $('.costType').show();909 $('.dataTypeAnalytics').val('Costs');910 if (dataType === 'IntValProjCurr') {911 $('.costType').val('IntValProjCurr');912 } else {913 $('.costType').val('ExtValProjCurr');914 }915 }916 _.debounce(App.SpinnerTpl(loadingWheel, 0), 1000);917 });918 break;919 case 'scheduleVAR':920 hier = App.DataStore.hierarchy;921 costs = App.DataStore.chart.options.data;922 App.createSplittersFT();923 var refined = App.FilterChartData(costs, dataType);924 App.DataStore.chart = App.AssignStore(refined.graph);925 App.createChart(App.DataStore.chart, App.seriesSV, true, dataType);926 var projectName = App.DataStore.hierarchy[0].ExtID;927 $(document).bind("kendo:skinChange", App.createChart);928 $(".chart-type-chooser").bind("change", App.refreshChart);929 App.analyticsTplConfig(self);930 console.log("Selected Type " + dataType);931 if (dataType === 'Quantity') {932 $('.costType').hide();933 } else {934 $('.costType').show();935 $('.dataTypeAnalytics').val('Costs');936 if (dataType === 'IntValProjCurr') {937 $('.costType').val('IntValProjCurr');938 } else {939 $('.costType').val('ExtValProjCurr');940 }941 }942 _.debounce(App.SpinnerTpl(loadingWheel, 0), 1000);943 break;944 case 'spiCPI':945 hier = App.DataStore.hierarchySv;946 costs = App.DataStore.rawspiCpiChartdata;947 App.createSplittersFT();948 App.hierListInitialize(hier);949 var cpiSpiTrendData = App.cpiSpiTrend(costs, dataType);950 var cpiSpiTrend = App.AssignStore(cpiSpiTrendData);951 App.createSpiCpiChart(cpiSpiTrend, App.CpiSpiSeries, false);952 var projectName = App.DataStore.hierarchySv[0].ExtID;953 $(document).bind("kendo:skinChange", App.createChart);954 $(".chart-type-chooser").bind("change", App.refreshChart);955 var hierarchyList = $("div#treelist");956 App.hierSpiCpiEvent(hierarchyList, dataType);//event for changing chart data957 App.analyticsTplConfig(self);958 console.log("Selected Type " + dataType);959 if (dataType === 'Quantity') {960 $('.costType').hide();961 } else {962 $('.costType').show();963 $('.dataTypeAnalytics').val('Costs');964 if (dataType === 'IntValProjCurr') {965 $('.costType').val('IntValProjCurr');966 } else {967 $('.costType').val('ExtValProjCurr');968 }969 }970 $('#cpiSpiChange').val(App.HierarchySelectionID);971 _.debounce(App.expandTreeList(hierarchyList), 500);972 _.debounce(App.SpinnerTpl(loadingWheel, 0), 1000);973 break;974 default:975 console.log('hit default');976 break;977 }978 });979 });980 /*981 doc.on('click','a#clearPicker',function(e){982 e.preventDefault();983 doc.find('tr').removeClass('isTrColor');984 doc.find('td').each(function(i,v) {985 if(!$(this).hasClass('no-paint')){986 $(this).css(App.paint.tdCssTransparent).removeClass('tdpainted');987 }988 });989 });990 doc.on('dblclick','tr:has(td)',function(e){991 e.preventDefault();992 console.log('hit '+ e.target.nodeName);993 App.paint.setTRHighlight['background-color'] = App.picker.value();//colorpicker.value();994 var self = $(this);995 var trNearby = $(self),996 currentTr = $(e.currentTarget),997 trChild = trNearby.children('td');998 if(trNearby.hasClass('isTrColor')){999 trChild.each(function(){1000 if(!$(this).hasClass('tdpainted')){1001 if(!$(this).hasClass('no-paint')) {1002 $(this).css(App.paint.trCssTransparent).blur();1003 }1004 }1005 });1006 if(!currentTr.hasClass('tdpainted')) {1007 currentTr.css(App.paint.trCssTransparent).blur();1008 }1009 // currentTr.css(trCssTransparent);1010 trNearby.removeClass('isTrColor').blur();1011 } else {1012 trNearby.addClass('isTrColor').blur();1013 trChild.each(function(){1014 if(!$(this).hasClass('tdpainted')) {1015 if(!$(this).hasClass('no-paint')) {1016 $(this).css(App.paint.setTRHighlight);1017 }1018 }1019 });1020 if(!currentTr.hasClass('tdpainted')) {1021 currentTr.css(App.paint.trCssTransparent);1022 }1023 }1024 });1025 doc.on('click','td.single',function(e){1026 e.preventDefault();1027 console.log('hit '+ e.target.nodeName);1028 var target = $(e.currentTarget);1029 App.paint.setHighlight['background-color'] = App.picker.value();// colorpicker.value();1030 if(target.hasClass('tdpainted')){1031 if(target.parent().hasClass('isTrColor')){1032 target.css(App.paint.tdCssTransparent).removeClass('tdpainted');1033 return;1034 }1035 target.css(App.paint.tdCssTransparent).removeClass('tdpainted');1036 } else {1037 if(!target.hasClass('no-paint')) {1038 if(target.parent().hasClass('isTrColor')){1039 target.css(App.paint.setHighlight).addClass('tdpainted');1040 return;1041 }1042 target.css(App.paint.setHighlight).addClass('tdpainted');1043 } else {1044 alert('Can not paint this section.');1045 }1046 }1047 });*/1048 });//end dom ready...

Full Screen

Full Screen

add-amd-wrapper.js

Source:add-amd-wrapper.js Github

copy

Full Screen

1#!/usr/bin/env node2var fs = require( 'fs' );3var path = require( 'path' );4function updateFiles() {5 var langPath = '../src/lang';6 var files = fs.readdirSync( langPath );7 files.forEach(function( file ) {8 if ( path.extname(file) === '.js' ) {9 file = path.resolve(__dirname, langPath, file);10 addAMDWrapper(file);11 }12 });13}14function addAMDWrapper( file ) {15 var tplHeader = '// Wrapper Header\ndefine(function(require, exports, module) {\n\n';16 var tplFooter = '\n// Wrapper Footer\n});\n';17 var str = fs.readFileSync( file, {18 encoding: 'UTF-8'19 });20 str = tplHeader + str + tplFooter;21 fs.writeFileSync( file, str, {22 encoding: 'UTF-8'23 });24}...

Full Screen

Full Screen

footer.directive.ts

Source:footer.directive.ts Github

copy

Full Screen

1angular.module('Home')2.directive('sbFooter', sbFooter);3function sbFooter(){4 const tplFooter = <string> require('../views/footer.html');5 return {6 template: tplFooter,7 replace: true8 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1import { tplFooter } from 'ng-mocks';2import { tplHeader } from 'ng-mocks';3import { tplContent } from 'ng-mocks';4import { tplFooter } from 'ng-mocks';5import { tplHeader } from 'ng-mocks';6import { tplContent } from 'ng-mocks';7import { tplFooter } from 'ng-mocks';8import { tplHeader } from 'ng-mocks';9import { tplContent } from 'ng-mocks';10import { tplFooter } from 'ng-mocks';11import { tplHeader } from 'ng-mocks';12import { tplContent } from 'ng-mocks';13import { tplFooter } from 'ng-mocks';14import { tplHeader } from 'ng-mocks';15import { tplContent } from 'ng-mocks';16import { tplFooter } from 'ng-mocks';17import { tplHeader } from 'ng-mocks';18import { tplContent } from 'ng-mocks';19import { tplFooter } from 'ng-mocks';20import { tplHeader } from 'ng-mocks';21import { tplContent } from 'ng-mocks';22import { tplFooter } from 'ng-mocks';

Full Screen

Using AI Code Generation

copy

Full Screen

1import { tplFooter } from 'ng-mocks';2import { FooterComponent } from './footer.component';3describe('FooterComponent', () => {4 it('should render', () => {5 const fixture = tplFooter(FooterComponent);6 expect(fixture.nativeElement.innerHTML).toContain('Footer');7 });8});9import { Component } from '@angular/core';10@Component({11})12export class FooterComponent {}13import { FooterComponent } from './footer.component';14import { ComponentFixture, TestBed } from '@angular/core/testing';15import { tplFooter } from 'ng-mocks';16describe('FooterComponent', () => {17 let fixture: ComponentFixture<FooterComponent>;18 beforeEach(() => {19 TestBed.configureTestingModule({20 });21 fixture = tplFooter(FooterComponent);22 });23 it('should render', () => {24 expect(fixture.nativeElement.innerHTML).toContain('Footer');25 });26});27import { FooterComponent } from './footer.component';28import { ComponentFixture, TestBed } from '@angular/core/testing';29import { tplFooter } from 'ng-mocks';30describe('FooterComponent', () => {31 let fixture: ComponentFixture<FooterComponent>;32 beforeEach(() => {33 TestBed.configureTestingModule({34 });35 fixture = tplFooter(FooterComponent);36 });37 it('should render', () => {38 expect(fixture.nativeElement.innerHTML).toContain('Footer');39 });40});41import { FooterComponent } from './footer.component';42import { ComponentFixture, TestBed } from '@angular/core/testing';43import { tplFooter } from 'ng-mocks';44describe('FooterComponent', () => {45 let fixture: ComponentFixture<FooterComponent>;46 beforeEach(() => {47 TestBed.configureTestingModule({48 });49 fixture = tplFooter(FooterComponent);50 });51 it('should render', () => {52 expect(fixture.nativeElement.innerHTML).toContain('Footer');53 });54});55import { FooterComponent } from './footer.component';56import { ComponentFixture, TestBed } from '@angular/core/testing';57import { tplFooter } from 'ng-mocks';58describe('FooterComponent', () => {59 let fixture: ComponentFixture<FooterComponent>;60 beforeEach(() => {61 TestBed.configureTestingModule({

Full Screen

Using AI Code Generation

copy

Full Screen

1import { tplFooter } from 'ng-mocks';2import { MyComponent } from './my.component';3describe('MyComponent', () => {4 it('should have a footer', () => {5 const fixture = MockRender(MyComponent);6 const footer = tplFooter(fixture.debugElement);7 expect(footer).toBeDefined();8 });9});10import { Component } from '@angular/core';11@Component({12})13export class MyComponent {}14import { tplFooter } from 'ng-mocks';15import { MyComponent } from './my.component';16describe('MyComponent', () => {17 it('should have a footer', () => {18 const fixture = MockRender(MyComponent);19 const footer = tplFooter(fixture.debugElement);20 expect(footer).toBeDefined();21 });22});23import { tplFooter } from 'ng-mocks';24import { MyComponent } from './my.component';25describe('MyComponent', () => {26 it('should have a footer', () => {27 const fixture = MockRender(MyComponent);28 const footer = tplFooter(fixture.debugElement);29 expect(footer).toBeDefined();30 });31});32import { tplFooter } from 'ng-mocks';33import { MyComponent } from './my.component';34describe('MyComponent', () => {35 it('should have a footer', () => {36 const fixture = MockRender(MyComponent);37 const footer = tplFooter(fixture.debugElement);38 expect(footer).toBeDefined();39 });40});41import { tplFooter } from 'ng-mocks';42import { MyComponent } from './my.component';43describe('MyComponent', () => {44 it('should have a footer', () => {45 const fixture = MockRender(MyComponent);46 const footer = tplFooter(fixture.debugElement);47 expect(footer).toBeDefined();48 });49});

Full Screen

Using AI Code Generation

copy

Full Screen

1import { tplFooter } from 'ng-mocks';2describe('MyComponent', () => {3 it('should render footer', () => {4 const fixture = MockRender(MyComponent);5 const footer = tplFooter(fixture.debugElement);6 expect(footer).toBeDefined();7 });8});9@Component({10})11export class MyComponent {}12import { MockRender } from 'ng-mocks';13import { MyComponent } from './my.component';14describe('MyComponent', () => {15 it('should render footer', () => {16 const fixture = MockRender(MyComponent);17 const footer = tplFooter(fixture.debugElement);18 expect(footer).toBeDefined();19 });20});21@Component({22})23export class MyComponent {}

Full Screen

Using AI Code Generation

copy

Full Screen

1import { tplFooter } from 'ng-mocks';2describe('test', () => {3 it('should test', () => {4 const component = tplFooter(MyComponent, {5 });6 });7});8import { Component, Input } from '@angular/core';9@Component({10})11export class MyComponent {12 @Input() public readonly title: string = '';13}14import { tplFooter } from 'ng-mocks';15describe('MyComponent', () => {16 it('should render the component', () => {17 const component = tplFooter(MyComponent, {18 });19 expect(component).toBeDefined();20 });21});22import { tplFooter } from 'ng-mocks';23describe('MyComponent', () => {24 it('should render the component', () => {25 const component = tplFooter(MyComponent, {26 });27 expect(component).toBeDefined();28 });29});30import { tplFooter } from 'ng-mocks';31describe('MyComponent', () => {32 it('should render the component', () => {33 const component = tplFooter(MyComponent, {34 });35 expect(component).toBeDefined();36 });37});38import { tplFooter } from 'ng-mocks';39describe('MyComponent', () => {40 it('should render the component', () => {41 const component = tplFooter(MyComponent, {42 });43 expect(component).toBeDefined();44 });45});46import { tplFooter } from 'ng-mocks';47describe('MyComponent', () => {48 it('should render the component', () => {

Full Screen

Using AI Code Generation

copy

Full Screen

1I'm using Angular 6, and I can't seem to get ng-mocks to work. I've tried installing it via npm and yarn, but I get the same error when I try to import it:2import { MockBuilder, MockRender, ngMocks } from 'ng-mocks';3 Try `npm install @types/ng-mocks` if it exists or add a new declaration (.d.ts) file containing `declare module 'ng-mocks';`4I'm using Angular 6, and I can't seem to get ng-mocks to work. I've tried installing it via npm and yarn, but I get the same error when I try to import it:5import { MockBuilder, MockRender, ngMocks } from 'ng-mocks';6 Try `npm install @types/ng-mocks` if it exists or add a new declaration (.d.ts) file containing `declare module 'ng-mocks';`7I'm using Angular 6, and I can't seem to get ng-mocks to work. I've tried installing it via npm and yarn, but I get the same error when I try to import it:8import { MockBuilder, MockRender, ngMocks } from 'ng-mocks';

Full Screen

Using AI Code Generation

copy

Full Screen

1var tplFooter = ngMocks.getTestBed().get(tplFooter);2var mockFooter = tplFooter();3var footer = ngMocks.find(mockFooter, 'footer');4var tplFooter = ngMocks.getTestBed().get(tplFooter);5var mockFooter = tplFooter();6var footer = ngMocks.find(mockFooter, 'footer');7var tplFooter = ngMocks.getTestBed().get(tplFooter);8var mockFooter = tplFooter();9var footer = ngMocks.find(mockFooter, 'footer');10var tplFooter = ngMocks.getTestBed().get(tplFooter);11var mockFooter = tplFooter();12var footer = ngMocks.find(mockFooter, 'footer');13var tplFooter = ngMocks.getTestBed().get(tplFooter);14var mockFooter = tplFooter();15var footer = ngMocks.find(mockFooter, 'footer');16var tplFooter = ngMocks.getTestBed().get(tplFooter);17var mockFooter = tplFooter();18var footer = ngMocks.find(mockFooter, 'footer');

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run ng-mocks automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful