Best Python code snippet using ATX
mydigitalstructure.util.financial-1.0.0.js
Source:mydigitalstructure.util.financial-1.0.0.js  
1/*2    {3        title: "Util; Financial",4    }5*/6/*!7 * ibCom Pty Ltd ATF ibCom Unit Trust & contributors8 * Licensed as Attribution-ShareAlike 4.0 International9 * http://creativecommons.org/licenses/by-sa/4.0/10 *11 * http://www.larryullman.com/2012/12/05/writing-the-javascript-code-for-handling-stripe-payments/12 * https://bootsnipp.com/snippets/featured/responsive-stripe-payment-form13 *14 * Example /paynow;15    <script src="/jscripts/jquery-1.8.3.min.js"></script>16    <script src="https://js.stripe.com/v3/"></script>17    <script src="/site/312/1blankspace.util.site.collect-1.0.0.js"></script>18    <p>Pay Now</p>19    <div id="ns1blankspaceUtilFinancialStripeContainer"></div>20    !!!!! TO BE CONVERTED TO MYDIGITALSRUCTURE NAMESPACE & FACTORY GENERATED CONTROLLERS21    //FLOW22    //Stripe: Elements;23    //1. Create a page with HTML container with data-ui="elements"24    //2. Get the Context; ie the invoice number, amount etc - via hash or direct passed if admin doing it25    //3. Get the stripe public key from financial account based on accountID set in the app options or passed26    //4. User enters card details 27    //5. Details tokenised by stripe28    //6. Tokenised details sent to Stripe with private key via site_collect_payment_stripe method29    //7. Response handled30 */31"use strict";32if (mydigitalstructure._util.financial == undefined) {mydigitalstructure._util.financial = {}}33if (mydigitalstructure._util.financial.collect === undefined) {mydigitalstructure._util.financial.collect = {}}34/*$(document).ready(function()35{  36   mydigitalstructure._util.financial.collect.getContext()37});*/38mydigitalstructure._util.financial.collect =39{40    data: {_publicKey: undefined, _siteAccount: undefined, context: {currency: 'AUD'}},41    option: {autoReceipt: true},42    provider: {},43    getContext: function (param)44    {  45        var hashContexts = [];46        var context = {};47       if (window.location.hash != '')48        {49            hashContexts = window.location.hash.replace('#', '').split('|');50        }51        _.each(hashContexts, function (hashContext)52        {53            context[hashContext.split('=')[0]] = hashContext.split('=')[1]54        })55        mydigitalstructure._util.financial.collect.data.context =56            _.assign(context, mydigitalstructure._util.financial.collect.data.context);57        58        mydigitalstructure._util.financial.collect.init(context)59    },60    init: function (param)61    {    62        if (window.location.protocol == 'http:')63        {64            window.location.href = window.location.href.replace('http', 'https')65        }66        else67        {68        	//Get stripe public key from _scope.69            mydigitalstructure._util.financial.collect.data.context = param;70			var collect = mydigitalstructure._util.financial.collect;71			collect.data.xhtmlContainer = $('#util-financial-collect-container-stripe');72			collect.data.xhtmlContainerSuccess = $('#util-financial-collect-container-stripe-success');73			collect.option.stripe = (collect.data.xhtmlContainer != undefined)74			if (collect.option.stripe && window.Stripe == undefined)75			{76				collect.option.stripe = false77			}78			if (collect.option.stripe)79			{80                if (collect.data._publicKey == undefined)81                {82                    collect.data._publicKey = collect.data.context.publicKey;83                }84				if (collect.data._publicKey == undefined)85				{86					collect.data._publicKey = window.stripePublicKey;87				}88                if (collect.data._siteAccount == undefined)89                {90                    collect.data._siteAccount = collect.data.context.account;91                }92                if (collect.data._siteAccount == undefined)93                {94                    collect.data._siteAccount = window.siteAccount;95                }96				collect.option.elements = (collect.data.xhtmlContainer.attr('data-ui') == 'elements')97				collect.stripe.init(param);98			}    99        }    100    },101    error: function (error)102    {103        mydigitalstructure._util.financial.collect.data.xhtmlContainer.html(error)104    },105    stripe:106    {107        data: {},108        init: function (param, response)109        {110        	var collect = mydigitalstructure._util.financial.collect;111            if (response == undefined)112            {113                if (collect.data._publicKey != undefined)114                {115                    collect.stripe.init(param,116                    {117                        data: {rows: [{apikey: collect.data._publicKey}]},118                        status: 'OK'119                    }); 120                }121                else122                {123                    mydigitalstructure.cloud.search(124                    {125                        object: 'site_funds_transfer_account',126                        fields: ['apikey'],127                        filters:128                        [129                            {130                                field: 'id',131                                value: collect.data._siteAccount132                            }133                        ],134                        callback: mydigitalstructure._util.financial.collect.stripe.init,135                        callbackParam: param136                    });137                }    138            }139            else140            {141                if (response.status == 'OK')142                {143                    if (response.data.rows.length > 0)144                    {145                        collect.data._publicKey = _.first(response.data.rows).apikey;146                        collect.provider.stripe = Stripe(collect.data._publicKey);147                        collect.stripe.render(param);148                    }149                    else150                    {151                        collect.error('Error: No public key set up.')152                    }153                   154                }155                else156                {157                    collect.error('Error in getting key public key.')158                }159            }    160        },161		render: function (param)162		{ 163			var collect = mydigitalstructure._util.financial.collect;164			if (collect.data.xhtmlContainer.html() == '')165			{166				console.log('STRIPE ERROR NO HTML');167                //DO FUNCTION TO CREATE STANDARD HTML AS PER .HTML FILE168				/*$.ajax(169				{170				type: 'GET',171				url: window.location.protocol + '//' + window.location.host + '/site/' + mydigitalstructureSiteId + '/1blankspace.util.site.collect-1.0.0.html',172				dataType: 'text',173				global: false,174				success: function(data)175				{176				if (data != '')177				{178				ns1blankspace.util.site.collect.data.xhtmlContainer.html(data);179				ns1blankspace.util.site.collect.stripe.render(param);180				} 181				},182				error: function(data)183				{184				ns1blankspace.util.site.collect.error('No payment collection template');185				}186				});*/187			}188			else189			{                190				collect.data.xhtmlContainerSuccess.hide();191				collect.data.xhtml = collect.data.xhtmlContainer.html();192                var amount = mydigitalstructure._util.param.get(param, 'amount', {default: ''}).value;193                collect.data.xhtml = collect.data.xhtml.replace(/\[\[Amount\]\]/g, amount);194                195				collect.data.xhtmlContainer.html(collect.data.xhtml);196				if (collect.option.elements)197				{198					collect.stripe.createCard(param);199				}200				else201				{202					collect.stripe.bind(param);203				}204			}205		},206        createCard: function (param)207        {        208            var collect = mydigitalstructure._util.financial.collect;209            collect.provider.elements = collect.provider.stripe.elements();210            collect.data.style =211            {212                base:213                {214                    color: '#32325d',215                    lineHeight: '18px',216                    fontFamily: '"Helvetica Neue", Helvetica, sans-serif',217                    fontSmoothing: 'antialiased',218                    fontSize: '16px',219                    '::placeholder':220                    {221                        color: '#aab7c4'222                    }223                },224                invalid:225                {226                    color: '#fa755a',227                    iconColor: '#fa755a'228                }229            }230            collect.provider.card = collect.provider.elements.create('card',231                {style: collect.data.style});232            collect.provider.card.mount('#card-element');233            collect.stripe.bind(param);234        },235        bind: function (param)236        {237             //CHECK HTML IDS238            var collect = mydigitalstructure._util.financial.collect;239            $("#util-financial-collect-container").submit(function(event)240            {241                event.preventDefault();242                //CHECK ID243                if ($('#myds-financial-collect-collect-process').length == 0)244                {245                    collect.stripe.getToken()246                }   247            });248            /* $("#myds-util-financial-collect-container").submit(function(event)249            {250                event.preventDefault();251                if ($('#myds-financial-collect-collect-process').length == 0)252                {253                    mydigitalstructure._util.financial.collect.stripe.getToken();254                }255            });*/256            $('#util-financial-collect-collect-process').click(function(event)257            {258                var collect = mydigitalstructure._util.financial.collect;259                if (collect.option.elements)260                {261                    collect.stripe.getToken();262                }263                else264                {265                    collect.stripe.process();266                }    267            });268            if (collect.option.elements)269            {270                collect.provider.card.addEventListener('change', function(event)271                {272                    if (event.error)273                    {274                        collect.data.error = true;275                        $('#myds-util-financial-collect-card-errors').addClass('alert alert-danger');276                        $('#myds-util-financial-collect-card-errors').html(event.error.message);277                    }278                    else279                    {280                        collect.data.error = false;281                        $('#myds-util-financial-collect-card-errors').removeClass('alert alert-danger');282                        $('#myds-util-financial-collect-card-errors').html('');283                    }284                });285            }    286        },287        process: function (param)288        {289			//If not using Stripe Elements290            var collect = mydigitalstructure._util.financial.collect;291			if (param == undefined) {param = {}}292			param.error = false;293			param.errorMessages = [];294			param.number = $('.card-number').val();295			if (param.number == undefined) {param.number = $('.number').val()}296			param.cvc = $('.card-cvc').val();297			if (param.cvc == undefined) {param.cvc = $('.cvc').val()}298			param.exp_month = $('.card-expiry-month').val();299			if (param.exp_month == undefined) {param.exp_month = $('.expiry-month').val()}300			param.exp_year = $('.card-expiry-year').val();301			if (param.exp_year == undefined) {param.exp_year = $('.expiry-year').val()}302			if ((param.exp_year == undefined || param.exp_year == '')303			&& (param.exp_month == undefined || param.exp_month == ''))304			{305				param.expiry = $('.expiry').val();306				if (param.expiry != undefined)307				{308					var aExpiry = param.expiry.split('/');309					if (aExpiry.length > 0)310					{311						param.exp_month = aExpiry[0];312						param.exp_year = aExpiry[1];313					}    314				}315			}316			if (!Stripe.card.validateCardNumber(param.number))317			{318				param.error = true;319				param.errorMessages.push('<div>The credit card number appears to be invalid.</div>');320			}321			if (!Stripe.card.validateCVC(param.cvc))322			{323				param.error = true;324				param.errorMessages.push('<div>The CVC number appears to be invalid.</div>');325			}326			if (!Stripe.card.validateExpiry(param.exp_month, param.exp_year))327			{328				param.error = true;329				param.errorMessages.push('<div>The expiration date appears to be invalid.</div>');330			}331			if (!param.error)332			{333				collect.provider.stripe.getToken()334			}335			else336			{337				collect.error(param.errorMessages.join(''));338			}339        },  340        getToken: function (param)341        {342             var collect = mydigitalstructure._util.financial.collect;343            //CHECK ID344            $('#util-financial-collect-process').addClass('disabled').prop('disabled', true);345            collect.provider.stripe.createToken(collect.provider.card)346            .then(function(result)347            {348                if (result.error)349                {350                    collect.stripe.error(result.error.message);351                }352                else353                {354                    collect.stripe.processToken(result.token);355                }356            });357        },358        processToken: function (token)359        {360            var collect = mydigitalstructure._util.financial.collect;361            if (token != undefined)362            {363                var currency = collect.data.context.currency;364                if (currency == undefined) {currency = 'AUD'}365                var data =366                {367                    token: token.id,368                    currency: currency,369                    amount: collect.data.context.amount,370                    invoiceGUID: collect.data.context.invoiceGUID,371                    description: collect.data.context.description,372                    account: collect.data._siteAccount,373                    site: window.mydigitalstructureSiteId374                }375                mydigitalstructure.cloud.invoke(376                {377                    method: 'site_collect_payment_stripe',378                    data: data,379                    callback: mydigitalstructure._util.financial.collect.stripe.processTokenResponse,380                    callbackParam: token381                });382               /* $.ajax(383                {384                    type: 'POST',385                    url: '/rpc/site/?method=SITE_COLLECT_PAYMENT_STRIPE',386                    data: oData,387                    dataType: 'json',388                    success: function (data)389                    {390                        ns1blankspace.util.site.collect.stripe.processComplete(data);391                    },392                    error: function (data)393                    {394                        ns1blankspace.util.site.collect.stripe.error(data.responseJSON.error.errornotes)395                    }396                });*/397            }398            else399            {400                collect.error('Bad token')401            }    402        },403        processTokenResponse: function (param, response)404        {405            var error = false;406            var collect = mydigitalstructure._util.financial.collect;407            if (error)408            {409                console.log('STRIPE ERROR');410                console.log(response);411                collect.error(data.responseJSON.error.errornotes);412            }413            else414            {415                collect.stripe.processComplete(response);416            }417        },418        processComplete: function (response)419        {420            var collect = mydigitalstructure._util.financial.collect;421            if (response.status == 'OK')422            {423                if (response.stripe_status == 'succeeded')424                {425                    if (collect.option.autoReceipt)426                    {   427                        collect.stripe.autoReceipt({chargeToken: response.stripe_id})428                    }429                    else430                    {431                        collect.data.xhtmlContainer.hide();432                        collect.data.xhtmlContainerSuccess.show();433                    }434                }435                else436                {437                    collect.stripe.error(response.stripe_outcome_sellermessage)438                }439            }440            else441            {442               collect.data.xhtmlContainer.html('<h3>There is something wrong with the set up of this page!')443            }444        },445        autoReceipt: function (param, response)446        {447             var collect = mydigitalstructure._util.financial.collect;448            if (response == undefined)449            {450                var data =451                {452                    amount: collect.data.context.amount,453                    guid: collect.data.context.invoiceGUID,454                    description: param.chargeToken  455                }456                // site: window.mydigitalstructureSiteId457                mydigitalstructure.cloud.invoke(458                {459                    method: 'site_auto_receipt',460                    data: data,461                    callback: mydigitalstructure._util.financial.collect.stripe.autoReceipt,462                    callbackParam: param463                });464               /* $.ajax(465                {466                    type: 'POST',467                    url: '/rpc/site/?method=SITE_AUTO_RECEIPT',468                    data: oData,469                    dataType: 'json',470                    success: function (data)471                    {472                        mydigitalstructure._util.financial.collect.stripe.autoReceipt(param, data);473                    }474                });*/475            }476            else477            {478                if (response.status == 'ER')479                {480                    collect.stripe.error(response.error.errornotes)481                }482                else483                {484                    collect.data.xhtmlContainer.hide();485                    collect.data.xhtmlContainerSuccess.show();486                }487            }    488        },489        error: function (message)490        {491            $('#card-errors').html(message).addClass('alert alert-danger');492            $('#site-collect-process').prop('disabled', false);493            return false;494        }495       496    }497}498mydigitalstructure._util.factory.financial = function (param)499{500    app.add(501    [502        {503            name: 'util-financial-collect-initialise',504            code: function (param)505            {506                mydigitalstructure._util.financial.collect.init(param);507            }508        }509    ]);...collector.js
Source:collector.js  
...6    key1: 1,7    key2: 2,8    key3: 3,9  };10  const dc = collect(3)11    .done((err, result) => {12      test.error(err);13      test.strictSame(result, expectedResult);14      test.end();15    })16    .timeout(1000);17  dc('key1', null, 1);18  dc('key2', null, 2);19  dc('key3', null, 3);20});21metatests.test('data collector method', test => {22  const expectedResult = {23    key1: 1,24    key2: 2,25    key3: 3,26  };27  const dc = collect(3)28    .done((err, result) => {29      test.error(err);30      test.strictSame(result, expectedResult);31      test.end();32    })33    .timeout(1000);34  dc.collect('key1', null, 1);35  dc.collect('key2', null, 2);36  dc.collect('key3', null, 3);37});38metatests.test('data collector', test => {39  const expectedResult = {40    key1: 1,41    key2: 2,42    key3: 3,43  };44  const kc = collect(['key1', 'key2', 'key3'])45    .done((err, result) => {46      test.error(err);47      test.strictSame(result, expectedResult);48      test.end();49    })50    .timeout();51  kc.collect('key1', null, 1);52  kc.collect('key2', null, 2);53  kc.collect('key3', null, 3);54});55metatests.test('distinct data collector', test => {56  const expectedResult = {57    key1: 2,58    key2: 2,59    key3: 3,60  };61  const dc = collect(3)62    .distinct()63    .done((err, result) => {64      test.error(err);65      test.strictSame(result, expectedResult);66      test.end();67    });68  dc.pick('key1', 1);69  dc.pick('key1', 2);70  dc.pick('key2', 2);71  dc.pick('key3', 3);72});73metatests.test('distinct key collector', test => {74  const expectedResult = {75    key1: 2,76    key2: 2,77    key3: 3,78  };79  const kc = collect(['key1', 'key2', 'key3'])80    .distinct()81    .done((err, result) => {82      test.error(err);83      test.strictSame(result, expectedResult);84      test.end();85    });86  kc.pick('key1', 1);87  kc.pick('key1', 2);88  kc.pick('key2', 2);89  kc.pick('key3', 3);90});91metatests.test('data collector with repeated keys', test => {92  const dc = collect(3)93    .timeout(100)94    .done(err => {95      test.assert(err);96      test.end();97    });98  dc.collect('key1', null, 1);99  dc.collect('key1', null, 2);100  dc.collect('key2', null, 2);101});102metatests.test('key collector with repeated keys', test => {103  const kc = collect(['key1', 'key2', 'key3'])104    .timeout(100)105    .done(err => {106      test.assert(err);107      test.end();108    });109  kc.collect('key1', null, 1);110  kc.collect('key1', null, 2);111  kc.collect('key2', null, 2);112});113metatests.test('collect with error', test => {114  const testErr = new Error('Test error');115  const col = collect(1);116  col.done((err, res) => {117    test.strictSame(err, testErr);118    test.strictSame(res, {});119    test.end();120  });121  col.fail('someKey', testErr);122});123metatests.test('collect method calling after it is done', test => {124  const col = collect(1);125  col.done((err, res) => {126    test.error(err);127    test.strictSame(res, { someKey: 'someVal' });128    test.end();129  });130  col.pick('someKey', 'someVal');131  col.pick('someKey2', 'someVal2');132});133metatests.test('keys collector receives wrong key', test => {134  const col = collect(['rightKey']);135  col.done((err, res) => {136    test.error(err);137    test.strictSame(res, { wrongKey: 'someVal', rightKey: 'someVal' });138    test.end();139  });140  col.pick('wrongKey', 'someVal');141  col.pick('rightKey', 'someVal');142});143metatests.test('distinct keys collector receives wrong key', test => {144  const col = collect(['rightKey']).distinct();145  col.done(err => {146    test.assert(err);147    test.end();148  });149  col.pick('wrongKey', 'someVal');150  col.pick('rightKey', 'someVal');151});152metatests.test('collect with take', test => {153  const col = collect(1);154  col.done((err, res) => {155    test.error(err);156    test.strictSame(res, { someKey: 'someVal' });157    test.end();158  });159  const af = (x, callback) => callback(null, x);160  col.take('someKey', af, 'someVal');161});162metatests.test('collect generate callback', test => {163  const col = collect(1);164  col.done((err, res) => {165    test.error(err);166    test.strictSame(res, { someKey: 'someVal' });167    test.end();168  });169  const af = (x, callback) => callback(null, x);170  af('someVal', col.callback('someKey'));171});172metatests.test('collect generate callback shorthand', test => {173  const col = collect(1);174  col.done((err, res) => {175    test.error(err);176    test.strictSame(res, { someKey: 'someVal' });177    test.end();178  });179  const af = (x, callback) => callback(null, x);180  af('someVal', col('someKey'));181});182metatests.test('collect with timeout error', test => {183  const timeoutErr = new Error('Collector timeout');184  const col = collect(1)185    .done((err, res) => {186      test.strictSame(err, timeoutErr);187      test.strictSame(res, {});188      test.end();189    })190    .timeout(1);191  const af = (x, callback) => setTimeout(() => callback(null, x), 2);192  col.take('someKey', af, 'someVal');193});194metatests.test('collect with take calls bigger than expected', test => {195  const col = collect(1).done((err, res) => {196    test.error(err);197    test.strictSame(Object.keys(res).length, 1);198    test.end();199  });200  const af = (x, callback) => setTimeout(() => callback(null, x), 1);201  col.take('someKey', af, 'someVal');202  col.take('someKey2', af, 'someVal2');203});204metatests.test('cancel data collector', test => {205  const dc = collect(3).done(err => {206    test.assert(err);207    test.end();208  });209  dc.pick('key', 'value');210  dc.cancel();211});212metatests.test('cancel key collector', test => {213  const dc = collect(['uno', 'due']).done(err => {214    test.assert(err);215    test.end();216  });217  dc.pick('key', 'value');218  dc.cancel();219});220metatests.test('collect then success', test => {221  const col = collect(1).then(222    result => {223      test.assert(result);224      test.end();225    },226    err => {227      test.error(err);228      test.end();229    }230  );231  col.pick('Key', 'value');232});233metatests.test('collect then fail', test => {234  collect(5)235    .timeout(10)236    .then(237      result => {238        test.error(result);239        test.end();240      },241      err => {242        test.assert(err);243        test.end();244      }245    );...video.js
Source:video.js  
...25            var collectData = {};26            collectData.id = $('#video_id').val().trim();27            collectData.action = 'play';28            collectData.time = player.getCurrentTime();29            collect(collectData);30        }31    });32    player.on("pause", function () {33        console.log('pause');34        var currentTime = player.getCurrentTime();35        // Collect pause action36        var collectData = {};37        collectData.id = $('#video_id').val().trim();38        collectData.action = 'pause';39        collectData.time = currentTime;40        collect(collectData);41    });42    player.on('ended', function () {43        question_dialog();44        var testBtn = $('#test_btn');45        var disableBtn = $(testBtn).find('.disable');46        $(disableBtn).hide();47        var enableBtn = $(testBtn).find('.enable');48        $(enableBtn).show();49        $(enableBtn).bind('click', question_dialog);50        // Collect ended action51        var collectData = {};52        collectData.id = $('#video_id').val().trim();53        collectData.action = 'end';54        collectData.time = player.getCurrentTime();55        collect(collectData);56    });57    // Collect open action58    var collectData = {};59    collectData.id = $('#video_id').val().trim();60    collectData.action = 'open';61    collect(collectData);62}63function question_dialog() {64    $('#question-confirm').dialog({65        resizable: false,66        height: "auto",67        width: "9.0625rem",68        modal: true,69        buttons: [{70            text: "马ä¸å¼å§",71            class: 'open',72            click: function () {73                var video_id = $('#video_id').val();74                console.log(video_id);75                window.location = '/video-cms/index.php?g=Video&m=Index&a=question&id=' + video_id;76                $(this).dialog("close");77            }78        }, {79            text: "ç¨åå说",80            class: 'close',81            click: function () {82                $(this).dialog("close");83            }84        }]85    });86}87// Just for test88//$('#test_btn').click(question_dialog);89// ### Control title slide down90$('#title_btn').on('click', function () {91    if($(this).hasClass('up')){92        $(this).removeClass('up');93        $(this).addClass('down');94        $('#title_desc').show('slow');95    } else if ($(this).hasClass('down')) {96        $(this).removeClass('down');97        $(this).addClass('up');98        $('#title_desc').hide('slow');99    }100});101//complete_info();102// ### Complete user info103//if($('#cu').val() === '1'){104function complete_info() {105    $('#complete_info').dialog({106        resizable: false,107        height: "auto",108        width: "9.0625rem",109        modal: true,110        buttons: [{111            text: "ç¡®å®",112            class: 'ok',113            click: function () {114                if(!$('#agreement').is(':checked')){115                    alert('请å
é
è¯»å¹¶åææä»¬çæå¡åè®®');116                    return false;117                }118                var real_name = $('#real_name').val();119                var sex = $('#sex').val();120                var age = $('#age').val();121                var phone = $('#phone').val();122                if(real_name === ''){123                    alert('请è¾å
¥çå®å§å');124                    return false;125                }126                if(sex === ''){127                    alert('请è¾å
¥æ§å«');128                    return false;129                }130                if(age === ''){131                    alert('请è¾å
¥å¹´é¾');132                    return false;133                }134                if(phone === ''){135                    alert('请è¾å
¥ææºå·ç ');136                    return false;137                }138                if(!(/^1[3|4|5|8][0-9]{9}$/.test(phone))){139                    alert('请è¾å
¥æ£ç¡®ææºå·ç ');140                    return false;141                }142                $.getJSON('/video-cms/index.php?g=Video&m=Index&a=complete_info&' + $('#complete-form').serialize(),function (data, status) {143                    if(data !== undefined && data.code === 0){144                        $('#cu').val('');145                    }146                });147                $(this).dialog("close");148            }149        }]150    });151}152function collect(data){153    $.get('/video-cms/index.php?g=Video&m=Collect&a=video&' + $.param(data), function (data) {154        console.log(data);155    })...router.js
Source:router.js  
1var app = angular.module('courseCollect', []);2app.config(function($provide, $stateProvider){3    $stateProvider.state("root.subjectSummary.courseCollect", {4        url : "/courseCollect",5        views : {6            "content@root.subjectSummary" : {7                templateUrl : "root/subjectSummary/courseCollect/_res/html/index.html",8                controller:"courseCollectCtrl"9            },"menu@root.subjectSummary" : {10                templateUrl : "root/subjectSummary/courseCollect/_res/html/menu.html",11                controller:"courseCollectMenuCtrl"12            }13        }14    }).state("root.subjectSummary.courseCollect.list[12]",{15        url:"/list[12]?id=&name=&page=",16        views:{17            "content@root.subjectSummary.courseCollect":{18                templateUrl : "root/subjectSummary/courseCollect/list/_res/html/index.html",19                controller:'courseCollectListCtrl'20            }21        }22    }).state("root.subjectSummary.courseCollect.add[12]",{23        url:"/add[12]",24        views:{25            "content@root.subjectSummary.courseCollect":{26                templateUrl : "root/subjectSummary/courseCollect/add/_res/html/index.html",27                controller:'courseCollectAddCtrl'28            }29        }30    }).state("root.subjectSummary.courseCollect.edit[12]",{31        url:"/edit[12]?id=&page=",32        views:{33            "content@root.subjectSummary.courseCollect":{34                templateUrl : "root/subjectSummary/courseCollect/edit/_res/html/index.html",35                controller:'courseCollectEditCtrl'36            }37        }38    }).state("root.subjectSummary.courseCollect.export[12]",{39        url:"/export[12]",40        views:{41            "content@root.subjectSummary.courseCollect":{42                templateUrl : "root/subjectSummary/courseCollect/export/_res/html/index.html",43                controller:'courseCollectExportCtrl'44            }45        }46    }).state("root.subjectSummary.courseCollect.subjectsSummary[12]",{47        url:"/subjectsSummary[12]",48        views:{49            "content@root.subjectSummary.courseCollect":{50                templateUrl : "root/subjectSummary/courseCollect/subjectsSummary/_res/html/index.html",51                controller:'subjectsSummaryCtrl'52            }53        }54    }).state("root.subjectSummary.courseCollect.areasSummary[12]",{55        url:"/areasSummary[12]",56        views:{57            "content@root.subjectSummary.courseCollect":{58                templateUrl : "root/subjectSummary/courseCollect/areasSummary/_res/html/index.html",59                controller:'areasSummaryCtrl'60            }61        }62    }).state("root.subjectSummary.courseCollect.teamSummary[12]",{63        url:"/teamSummary[12]",64        views:{65            "content@root.subjectSummary.courseCollect":{66                templateUrl : "root/subjectSummary/courseCollect/teamSummary/_res/html/index.html",67                controller:'teamSummaryCtrl'68            }69        }70    }).state("root.subjectSummary.courseCollect.projectSummary[12]",{71        url:"/projectSummary[12]",72        views:{73            "content@root.subjectSummary.courseCollect":{74                templateUrl : "root/subjectSummary/courseCollect/projectSummary/_res/html/index.html",75                controller:'projectNameSummaryCtrl'76            }77        }78    }).state("root.subjectSummary.courseCollect.contrast[12]",{79        url:"/contrast[12]",80        views:{81            "content@root.subjectSummary.courseCollect":{82                templateUrl : "root/subjectSummary/courseCollect/contrast/_res/html/index.html",83                controller:'courseCollectContrastCtrl'84            }85        }86    })...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!!
