Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Using Controllers
- * Use `Controllers`, which are function declarations that contain public and private methods
- * For example:
- ```javascript
- var budgetController = function() {
- // declare private functions here
- var functionOne = function() {
- }
- // declare other variables and data structures
- // in order to return public functions, you must return them in an object!
- // CLOSURES!
- return {
- pubFunctionOne: function() {
- },
- pubFunctionTwo: function() {
- }
- }
- }
- ```
- ---
- ### HTML DOM Element Creation
- * You can create DOM elements in a string
- * For content that needs interpolation or a real value, insert a placeholder: `%example%`
- * To insert a value into this location: `htmlString.replace("%example%", actualValue)`
- * Then re-insert this newly editted string to the DOM element!
- ---
- ### JS DOM Element Querying
- * Save all queried strings into an object (in case the element needs to be re-queried)
- * `var DOMElements = { btn: ".btn"}`
Add Comment
Please, Sign In to add comment