Created
March 21, 2017 14:57
-
-
Save k1r0s/f62411cd56476db9307c022743f7cff3 to your computer and use it in GitHub Desktop.
This is an example of what we normaly do in OOP
This file contains 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
class Invoice { | |
... | |
doCheckout(shippingDetails){ | |
if(this.validate(shippingDetails)){ | |
this.shippingDetails = shippingDetails | |
var serializedInstance = JSON.stringify(this) | |
$OurAjaxService.post({ | |
url: this.url, | |
data: serializedInstance | |
}).then((response) => { | |
//...notify the user or something, trigger the state | |
}) | |
} | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment