Last active
August 29, 2015 14:21
-
-
Save jonstorer/537558d2c1a156a3468d to your computer and use it in GitHub Desktop.
wtf angular
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
<a ng-click="saveSignatures">Save Signatures</a> | |
<div> | |
Have Signatures Been Saved?: {{ status }} | |
</div> |
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
{ | |
"id": "54b491e85d531802009bfd8f", | |
"title": "General Freelance Agreement (Assignment)", | |
"status": "accepted", | |
"text": "<p><span contenteditable=\"false\"><input type=\"text\" name=\"names[client]\" placeholder=\"Client Name\" data-question=\"What are the client's and freelancer's full names? (e.g., 'John Smith' or 'Acme, Inc.')\" data-help=\"If the signer is an individual, enter their full name. If a person is signing on behalf of a company, enter the company's full legal name.\" value=\"\"></span> (\"Client\") is hiring <span contenteditable=\"false\"><input type=\"text\" name=\"names[freelancer]\" placeholder=\"Freelancer Name\" value=\"\"></span> (\"Freelancer\") to do certain work. The following sets forth the agreement between these two parties and binds them both.</p>\n<p class=\"heading-content-bold\">Scope of Work </p>\n<p>Freelancer will do the following for Client (the \"Scope of Work\"):</p>\n\n<textarea name=\"scope_of_work\" data-question=\"Describe what the freelancer will do. Include any milestones.\" data-help=\"Be as detailed as possible about exactly what work is to be done, any milestones or intermediate deadlines, and what is required for the work to be considered complete.\" placeholder=\"Work details\"></textarea>\n\n<p>Freelancer may decline, or charge additionally for, work that Freelancer reasonably deems to be beyond this scope.</p>\n<p>The final deadline for completing the above work is: <span contenteditable=\"false\"><input type=\"text\" name=\"deadline\" data-question=\"What's the final deadline for completing the specified work?\" data-help=\"What's the date by which all work must be completed?\" placeholder=\"mm/dd/yyyy\" value=\"\"></span></p>\n<p class=\"heading-content-bold\">Ownership of the Work </p>\n<p>Freelancer hereby assigns to Client all right, title and interest in the work produced or developed under this agreement, including all patent, trade secret trademark rights, and copyrights. This assignment is conditioned on Freelancer being paid the full amount owed under this agreement.</p>\n<p class=\"heading-content-bold\">Payment</p>\n<p>Client will pay Freelancer: (the checked term applies)</p>\n<ul class=\"no-bullets\">\n\t<li>\n\t\t<label><span contenteditable=\"false\"><input type=\"radio\" name=\"payment[radio]\" data-question=\"The client will pay the freelancer:\" data-help=\"Check the option that applies and you will be prompted to enter the appropriate details.\" value=\"Flat fee\"></span> a flat fee of <span contenteditable=\"false\"><input type=\"text\" name=\"payment[fixed_rate]\" class=\"dependency-1\" placeholder=\"e.g., '$100'\" value=\"\"></span></label>\n\t</li>\n\t<li>\n\t\t<label><span contenteditable=\"false\"><input type=\"radio\" name=\"payment[radio]\" value=\"Based on time\"></span> a fee of <span contenteditable=\"false\"><input type=\"text\" name=\"payment[flat_fee]\" class=\"dependency-2\" placeholder=\"e.g., '$30 per hour'\" value=\"\"></span></label>\n\t</li>\n</ul>\n<p>Of Freelancer's fee, <span contenteditable=\"false\"><input type=\"text\" name=\"signing_fee\" data-question=\"How much is due at signing?\" placeholder=\"e.g., '$50'\" data-shake-scope=\"This is the amount that's due upfront on signing of agreement\" value=\"\"></span> is due at the signing of this agreement.</p>\n<p>The checked term applies:</p>\n<ul class=\"no-bullets\">\n\t<li>\n\t\t<label><span contenteditable=\"false\"><input type=\"radio\" name=\"expense\" data-question=\"Will the freelancer be reimbursed for any expenses?\" data-help=\"Select 'Yes' if the client will pay for any of freelancer's expenses, otherwise select 'No.'\" value=\"Yes\"></span>\n\t\tClient will reimburse Freelancer's reasonable expenses with prior approval.</label>\n\t</li>\n\t<li>\n\t\t<label><span contenteditable=\"false\"><input type=\"radio\" name=\"expense\" value=\"No\"></span>\n\t\tFreelancer will be solely responsible for Freelancer's expenses in connection with this agreement.</label>\n\t</li>\n</ul>\n<p>Upon completion of the work, Freelancer will invoice Client for any amount due. Payment is due <select name=\"invoice_deadline\" data-question=\"When is payment due?\" data-help=\"Specify how long the client has between the invoice date and the payment due date.\" placeholder=\"Select One\">\n <option value=\"Select One\" selected=\"selected\">Select One</option>\n <option value=\"on the invoice date.\">on the invoice date</option>\n <option value=\"within 10 days of the invoice date\">within 10 days of the invoice date</option>\n <option value=\"within 15 days of the invoice date\">within 15 days of the invoice date</option>\n <option value=\"within 30 days of the invoice date\">within 30 days of the invoice date</option>\n <option value=\"within 45 days of the invoice date\">within 45 days of the invoice date</option>\n</select>, or as specified in the invoice.</p>\n<p>Any amount not received by its due date will collect interest at <span contenteditable=\"false\"><input type=\"text\" name=\"monthly_interest\" data-question=\"What is the monthly interest on late payment?\" data-help=\"This is the amount of interest that will accrue on any overdue payment amount. 1.5% per month is common\" placeholder=\"e.g., '1.5%'\" value=\"\"></span> per month, or the legally allowable maximum if this amount exceeds it.</p>\n<p class=\"heading-content-bold\">Confidential Information </p>\n<p>Any information supplied by one party to the other marked as \"Confidential\" must be used only for the purposes of this agreement and must not be disclosed to other parties without the discloser's written consent. This does not apply to information that is publicly available or that the recipient already properly knew, developed or received independently. When the agreement terminates, Freelancer must return to Client any materials containing confidential information. Confidentiality obligations survive termination of this agreement.</p>\n<p class=\"heading-content-bold\">Independent Contractor Relationship</p>\n<p>Freelancer is an independent contractor, not an employee of Client. Freelancer is solely responsible for all taxes, withholdings, insurance, and any other obligations that may apply to an independent contractor.</p>\n<p class=\"heading-content-bold\">LIMITED WARRANTY</p>\n<p>FREELANCER WARRANTS THAT NO OBLIGATION TO A THIRD PARTY PROHIBITS FREELANCER FROM ENTERING INTO THIS AGREEMENT, AND THAT TO FREELANCER'S KNOWLEDGE, WORK PRODUCED UNDER THIS AGREEMENT WILL NOT VIOLATE THE INTELLECTUAL PROPERTY RIGHTS OF ANY THIRD PARTY.</p>\n<p class=\"heading-content-bold\">LIMITATION OF LIABILITY</p>\n<p>UNLESS A RESULT OF GROSS NEGLIGENCE OR WILLFUL MISCONDUCT, THE LIABILITY OF EITHER PARTY TO THE OTHER FOR ANY TYPE OF DAMAGES SHALL BE LIMITED TO THE AMOUNT OF FREELANCER'S TOTAL FEES UNDER THIS AGREEMENT.</p>\n<p class=\"heading-content-bold\">Termination</p>\n<p>If either party materially breaches this agreement, the non-breaching party may terminate the agreement only by providing written notice of the breach to the breaching party. The breaching party shall have 5 days to cure the breach after receiving such notice. If the breaching party fails to cure the breach in that time, the agreement shall terminate except with respect to those obligations that are noted herein as surviving termination.</p>\n<p>If the agreement terminates for any reason other than a material uncured breach by Freelancer, then Freelancer is immediately entitled (the checked term applies):</p>\n<ul class=\"no-bullets\">\n\t<li>\n\t\t<label><span contenteditable=\"false\"><input type=\"radio\" name=\"termination[radio]\" data-question=\"If the client cancels the agreement before completion, how will the freelancer be compensated?\" data-help=\"If it would be difficult to quantify the prorated amount due in the event of a mid-project cancellation, you can specify a preset fee by selecting the second option.\" value=\"Prorated fees for work completed\"></span> any unpaid fees prorated for the portion of the work completed at the time of termination</label>\n\t</li>\n\t<li>\n\t\t<label><span contenteditable=\"false\"><input type=\"radio\" name=\"termination[radio]\" value=\"Fixed fee\"></span> liquidated damages in the amount of <span contenteditable=\"false\"><input type=\"text\" name=\"termination[damages_amount]\" class=\"dependency-2\" placeholder=\"e.g., '$100'\" value=\"\"></span>, which the parties agree represents fair compensation for the harm Freelancer would suffer from termination</label>\n\t</li>\n</ul>\n<p>The above payment obligation, and any payment obligations pending at termination, shall survive termination.</p>\n<p class=\"heading-content-bold\">Miscellaneous</p>\n<p>This agreement is between Client and Freelancer and neither is allowed to delegate, transfer or assign it to a third party without the written consent of the other.</p>\n<p>This is the parties' entire agreement on this matter, superseding all previous negotiations or agreements. It can only be changed by mutual written consent.</p>\n<p>The laws of the state of <span contenteditable=\"false\"><input type=\"text\" name=\"state\" data-question=\"Where are you based? (e.g., Virginia, Delaware)\" data-help=\"This response will determine which jurisdiction's law governs the contract.\" value=\"Gfhggh\"></span> govern this agreement and any disputes arising from it must be handled exclusively in courts in that state. The prevailing party in any dispute will be entitled to recover reasonable costs and attorneys' fees.\n</p>\n<p>Signing a copy of this agreement, physical or electronic, will have the same effect as signing an original. </p><p><br></p><p>Much</p><p><br></p><p><br></p><p>Ghh</p><p><br></p><p><br></p>", | |
"created_at": "2015-01-13T03:32:56.372Z", | |
"updated_at": "2015-04-29T15:47:28.045Z", | |
"drafted_at": "2015-01-13T03:32:56.372Z", | |
"offered_at": "2015-01-13T03:34:13.713Z", | |
"accepted_at": "2015-01-13T03:34:13.713Z", | |
"logo_image_url": null, | |
"icon_image_url": "https://d3u8y6v8shm6g7.cloudfront.net/attachments/agreements/icon_image/54b491e85d531802009bfd8f-original.png", | |
"primary_color": "F9AF39", | |
"secondary_color": "333333", | |
"type": "Agreement", | |
"pdf_url": "https://api.shakelaw.com/web/agreements/54b491e85d531802009bfd8f.pdf", | |
"signature_blocks": [ | |
{ | |
"id": "54b491e85d531802009bfd91", | |
"created_at": "2015-01-13T03:32:56.372Z", | |
"updated_at": "2015-01-13T03:34:13.713Z", | |
"signed_at": "2015-01-13T03:34:13.093Z", | |
"photo_required": false, | |
"signature_image_url": "https://d3u8y6v8shm6g7.cloudfront.net/attachments/signature_blocks/signature_image/54b491e85d531802009bfd91-1421120053603-original.png", | |
"photo_image_url": null, | |
"first_name": "Jon", | |
"last_name": "Storer", | |
"full_name": "Jon Storer", | |
"company": "Shake", | |
"title": "VP of Engineering", | |
"status": "complete", | |
"email": "[email protected]", | |
}, | |
{ | |
"id": "54b491e85d531802009bfd90", | |
"created_at": "2015-01-13T03:32:56.372Z", | |
"updated_at": "2015-01-13T03:34:13.593Z", | |
"signed_at": "2015-01-13T03:34:13.269Z", | |
"photo_required": false, | |
"signature_image_url": "https://d3u8y6v8shm6g7.cloudfront.net/attachments/signature_blocks/signature_image/54b491e85d531802009bfd90-1421120053482-original.png", | |
"photo_image_url": null, | |
"first_name": "Jon", | |
"last_name": "Ghj", | |
"full_name": "Jon Ghj", | |
"status": "complete", | |
"email": "[email protected]", | |
} | |
] | |
} |
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
ShakeWeb.controller('AgreementController', | |
[ '$scope', '$stateParams', 'Agreement', '$q', function( | |
$scope, $stateParams, Agreement, $q ) { | |
$scope.status = 'No'; | |
Agreement.find($stateParams.id).then(function (agreement) { | |
$scope.agreement = agreement; | |
}); | |
$scope.saveSignature = function() { | |
var promises = $scope.agreement.signature_blocks.map(function(signature_block){ | |
return signature_block.save(); | |
}); | |
$q(promises).then(function(){ | |
$scope.status = 'Yes'; | |
}) | |
}; | |
}]); |
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
ShakeWeb.factory('Agreement', [ '$resource', function ( $resource, ) { | |
var Agreement = $resource( | |
'/a/v3/agreements/:id', | |
{ id: '@id' }, | |
{ | |
patch: { | |
method: 'PATCH', | |
transformRequest: function(data) { return angular.toJson({ agreement: data }) } | |
} | |
} | |
); | |
Agreement.find = function(id) { | |
return this.$get({ id: id }); | |
} | |
Agreement.prototype.save = function(){ | |
return this.patch(); | |
} | |
return Agreement; | |
} ]); |
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
ShakeWeb.factory('SignatureBlock', [ '$resource', function ( $resource ) { | |
var SignatureBlock = $resource( | |
'/a/v3/agreements/:agreement_id/signature_blocks/:id', | |
{ id: '@id' }, | |
{ | |
patch: { | |
method: 'PATCH', | |
transformRequest: function(data) { return angular.toJson({ signature_block: data }) } | |
} | |
} | |
); | |
SignatureBlock.prototype.save = function() { | |
return this.$patch(); | |
} | |
return SignatureBlock; | |
} ]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment