Commit 6de9e4b7 authored by Oscar Godson's avatar Oscar Godson

Ticket #510 - Put all the codez in a global namespace

parent f7e1b55e
......@@ -39,6 +39,10 @@
</footer>
<script src="components/todomvc-common/base.js"></script>
<script src="components/director/build/director.js"></script>
<script>
// Bootstrap app data
window.app = {};
</script>
<script src="js/helpers.js"></script>
<script src="js/store.js"></script>
<script src="js/model.js"></script>
......
......@@ -8,10 +8,10 @@
* @param {string} name The name of your new to do list.
*/
function Todo(name) {
this.storage = new Store(name);
this.model = new Model(this.storage);
this.view = new View();
this.controller = new Controller(this.model, this.view);
this.storage = new app.Store(name);
this.model = new app.Model(this.storage);
this.view = new app.View();
this.controller = new app.Controller(this.model, this.view);
}
var todo = new Todo('todos-vanillajs');
......
......@@ -338,5 +338,5 @@
};
// Export to window
window.Controller = Controller;
window.app.Controller = Controller;
})(window);
......@@ -115,5 +115,5 @@
};
// Export to window
window.Model = Model;
window.app.Model = Model;
})(window);
......@@ -138,5 +138,5 @@
};
// Export to window
window.Store = Store;
window.app.Store = Store;
})(window);
......@@ -87,5 +87,5 @@
};
// Export to window
window.View = View;
window.app.View = View;
})(window);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment