Last active
August 29, 2015 14:04
-
-
Save elisechant/1bce0a8fd39bbf087600 to your computer and use it in GitHub Desktop.
JavaScript Factory Object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var Namespace = window.Namespace || {}; | |
/** | |
* Factory for Modal Instances | |
* @param data {Object} - instance configurable props | |
* @constructor | |
*/ | |
(function() { | |
Namespace.Modal = function(data) { | |
var _data = data || {}; | |
// instance properties | |
this.width = _data.width || 600; | |
this.height = _data.height || 800; | |
}; | |
Namespace.Modal.prototype = { | |
constructor: Namespace.Modal, | |
methodA: function() { | |
return [this.width, this.height].join(' '); | |
} | |
}; | |
}()); | |
// Constructor instances | |
var HomepageModal = new Namespace.Modal(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment