Skip to content

Instantly share code, notes, and snippets.

@popcorn245
Created September 25, 2017 18:39
Show Gist options
  • Save popcorn245/99d0a5d7b0513baec763752596482ee7 to your computer and use it in GitHub Desktop.
Save popcorn245/99d0a5d7b0513baec763752596482ee7 to your computer and use it in GitHub Desktop.
Stencil with Import
import { Component, Prop } from '@stencil/core';
import Ajax from 'ajax-promise-es6';
@Component({
tag: 'ft-irma',
styleUrl: 'ft-irma.scss'
})
export class FtIrma {
render() {
return [
<ft-nav></ft-nav>,
<ft-banner src="./assets/img/banner.jpg" title="Disaster Response" sub="For Hurricane Irma"></ft-banner>,
<mission-statement></mission-statement>,
<ft-services title="Water Damage Services" sub="Commercial & Residential"></ft-services>,
<ft-difference sub="The Flood Team Difference!"></ft-difference>, <ft-rental></ft-rental>, <contact-form onSubmit={this.addTicket} title="Contact Us" sub="If you need help fast, The Flood Team Restoration services: Miami-Dade, Broward, Palm Beach and Monroe County. We focus on Water Damage, Mold Damage, and Contents Cleaning Services. Contact us we are happy to help anyway we can. Call or Email us, we are here for you 24/7!"></contact-form>
];
}
addTicket(event: UIEvent, customer:any = {}) {
event.preventDefault();
Ajax.post(
'https://api.website.com/v1/customer',
{
...customer
}
).then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment