Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function MVC(){
- var controllers = {};
- this.controller = function (cName, ctrl) {
- controllers[cName] = ctrl;
- };
- this.getController = function (cName){
- console.log(controllers);
- return controllers[cName];
- };
- };
- var mvc = new MVC();
- mvc.controller("SideBarCtrl", function(){
- this.load = function (tmplt_path) {
- $.get(tmplt_path, "menu_html")
- .done(function(menu_html){
- $(".sidebar").html(menu_html);
- }).fail(function(){
- console.log("fai");
- });
- };
- });
- sbc = mvc.getController('SideBarCtrl');
- sbc.load("side_menu/html/patt_menu.html");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement