Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Product(toConvert) {
- this.description = '';
- this.name = '';
- this.attribute = [];
- this.children = [];
- this.parents = [];
- this.rules = makeRules();
- angular.extend(this, toConvert);
- }
- angular.extend(Product, {
- });
- function makeRules(){
- return {
- onChange: function() {
- console.log("Applying global change rules: ", this);
- },
- onInstantiation: function() {
- console.log("Applying instantiation rules: ", this);
- },
- onContextApplication: function(room) {
- this.context = room;
- console.log("Applying context rules: ", this, room);
- },
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement