backbonejs와requirejs의 실례

2635 단어 requirejs
define(['login', 'ApplyFlapper'],  // ApplyFlapper ApplyFlapper.js 

    function (loginView,  applyFlapperView) {   //applyFlapperView view

        var Router = Backbone.Router.extend({

            routes: {

                '': 'showHome',

               

                'applyFlapper': 'showApplyFlapper',   // applyFlapper.html,showApplyFlapper() 

            },

            data: {

                module_login: null,

              

                module_ApplyFlapper: null,

            },

            showHome: function () {

                if (!this.data.module_auctionList) {

                    this.data.module_auctionList = new auctionListView();

                }

                this.data.module_auctionList.render();

            },

               showApplyFlapper: function () {

                console.log("go to ApplyFlapper");

                if (!this.data.module_ApplyFlapper) {

                    this.data.module_ApplyFlapper = new applyFlapperView();

                }

                this.data.module_ApplyFlapper.render();

            },

            init: true

            }

           });

좋은 웹페이지 즐겨찾기