# Class: HtmlInclude

## HtmlInclude()

#### new HtmlInclude()

NB: Attributes not available here - use connectedCallback to reference

Source:
  - html-include.js, line 148

### Members

#### componentVersion

Component version

Source:
  - html-include.js, line 110

#### componentVersion

Component version

Source:
  - html-include.js, line 110

#### contentType :"text"|"html"|"json"|"form"

Content type of the imported resource

##### Type:

- "text" | "html" | "json" | "form"

Source:
  - html-include.js, line 127

#### contentType :"text"|"html"|"json"|"form"

Content type of the imported resource

##### Type:

- "text" | "html" | "json" | "form"

Source:
  - html-include.js, line 127

#### src

The URL to fetch an HTML document from. Allows change via instance prop as well as attribute change. Setting this property causes a fetch the HTML from the URL. We are reflecting the src attrib and the src prop.

Source:
  - html-include.js, line 136

#### src

Reflect src property to the src attribute

Source:
  - html-include.js, line 143

#### src

The URL to fetch an HTML document from. Allows change via instance prop as well as attribute change. Setting this property causes a fetch the HTML from the URL. We are reflecting the src attrib and the src prop.

Source:
  - html-include.js, line 136

#### src

Reflect src property to the src attribute

Source:
  - html-include.js, line 143

#### (static) observedAttributes

Makes HTML attribute change watched

Source:
  - html-include.js, line 115

#### (static) observedAttributes

Makes HTML attribute change watched

Source:
  - html-include.js, line 115

### Methods

#### attributeChangedCallback(attrib, oldVal, newVal)

Runs when an observed attribute changes - Note: values are always strings

##### Parameters:

Name | Type | Description
--- | --- | ---
`attrib` | string | Name of watched attribute that has changed
`oldVal` | string | The previous attribute value
`newVal` | string | The new attribute value

Source:
  - html-include.js, line 171

#### attributeChangedCallback(attrib, oldVal, newVal)

Runs when an observed attribute changes - Note: values are always strings

##### Parameters:

Name | Type | Description
--- | --- | ---
`attrib` | string | Name of watched attribute that has changed
`oldVal` | string | The previous attribute value
`newVal` | string | The new attribute value

Source:
  - html-include.js, line 171

#### connectedCallback()

Runs when an instance is added to the DOM

Source:
  - html-include.js, line 155

#### connectedCallback()

Runs when an instance is added to the DOM

Source:
  - html-include.js, line 155

#### disconnectedCallback()

Runs when an instance is removed from the DOM

Source:
  - html-include.js, line 162

#### disconnectedCallback()

Runs when an instance is removed from the DOM

Source:
  - html-include.js, line 162

#### (async) doInclude(url)

Replaces the shadow dom content with the imported HTML.

##### Parameters:

Name | Type | Description
--- | --- | ---
`url` | URL | string | URL of the resource to import

Source:
  - html-include.js, line 201

#### (async) doInclude(url)

Replaces the shadow dom content with the imported HTML.

##### Parameters:

Name | Type | Description
--- | --- | ---
`url` | URL | string | URL of the resource to import

Source:
  - html-include.js, line 201

#### (static) highlight(json) → {HTMLElement}

Return a formatted HTML version of JSON object

##### Parameters:

Name | Type | Description
--- | --- | ---
`json` | object | JSON | JSON object to convert

Source:
  - html-include.js, line 275

##### Returns:

Highlighted JSON wrapped in a `

    ` tag

Type
  HTMLElement

#### (static) highlight(json) → {HTMLElement}

Return a formatted HTML version of JSON object

##### Parameters:

Name | Type | Description
--- | --- | ---
`json` | object | JSON | JSON object to convert

Source:
  - html-include.js, line 275

##### Returns:

Highlighted JSON wrapped in a `

    ` tag

Type
  HTMLElement

## HtmlInclude()

#### new HtmlInclude()

NB: Attributes not available here - use connectedCallback to reference

Source:
  - html-include.js, line 148

### Members

#### componentVersion

Component version

Source:
  - html-include.js, line 110

#### componentVersion

Component version

Source:
  - html-include.js, line 110

#### contentType :"text"|"html"|"json"|"form"

Content type of the imported resource

##### Type:

- "text" | "html" | "json" | "form"

Source:
  - html-include.js, line 127

#### contentType :"text"|"html"|"json"|"form"

Content type of the imported resource

##### Type:

- "text" | "html" | "json" | "form"

Source:
  - html-include.js, line 127

#### src

The URL to fetch an HTML document from. Allows change via instance prop as well as attribute change. Setting this property causes a fetch the HTML from the URL. We are reflecting the src attrib and the src prop.

Source:
  - html-include.js, line 136

#### src

Reflect src property to the src attribute

Source:
  - html-include.js, line 143

#### src

The URL to fetch an HTML document from. Allows change via instance prop as well as attribute change. Setting this property causes a fetch the HTML from the URL. We are reflecting the src attrib and the src prop.

Source:
  - html-include.js, line 136

#### src

Reflect src property to the src attribute

Source:
  - html-include.js, line 143

#### (static) observedAttributes

Makes HTML attribute change watched

Source:
  - html-include.js, line 115

#### (static) observedAttributes

Makes HTML attribute change watched

Source:
  - html-include.js, line 115

### Methods

#### attributeChangedCallback(attrib, oldVal, newVal)

Runs when an observed attribute changes - Note: values are always strings

##### Parameters:

Name | Type | Description
--- | --- | ---
`attrib` | string | Name of watched attribute that has changed
`oldVal` | string | The previous attribute value
`newVal` | string | The new attribute value

Source:
  - html-include.js, line 171

#### attributeChangedCallback(attrib, oldVal, newVal)

Runs when an observed attribute changes - Note: values are always strings

##### Parameters:

Name | Type | Description
--- | --- | ---
`attrib` | string | Name of watched attribute that has changed
`oldVal` | string | The previous attribute value
`newVal` | string | The new attribute value

Source:
  - html-include.js, line 171

#### connectedCallback()

Runs when an instance is added to the DOM

Source:
  - html-include.js, line 155

#### connectedCallback()

Runs when an instance is added to the DOM

Source:
  - html-include.js, line 155

#### disconnectedCallback()

Runs when an instance is removed from the DOM

Source:
  - html-include.js, line 162

#### disconnectedCallback()

Runs when an instance is removed from the DOM

Source:
  - html-include.js, line 162

#### (async) doInclude(url)

Replaces the shadow dom content with the imported HTML.

##### Parameters:

Name | Type | Description
--- | --- | ---
`url` | URL | string | URL of the resource to import

Source:
  - html-include.js, line 201

#### (async) doInclude(url)

Replaces the shadow dom content with the imported HTML.

##### Parameters:

Name | Type | Description
--- | --- | ---
`url` | URL | string | URL of the resource to import

Source:
  - html-include.js, line 201

#### (static) highlight(json) → {HTMLElement}

Return a formatted HTML version of JSON object

##### Parameters:

Name | Type | Description
--- | --- | ---
`json` | object | JSON | JSON object to convert

Source:
  - html-include.js, line 275

##### Returns:

Highlighted JSON wrapped in a `

    ` tag

Type
  HTMLElement

#### (static) highlight(json) → {HTMLElement}

Return a formatted HTML version of JSON object

##### Parameters:

Name | Type | Description
--- | --- | ---
`json` | object | JSON | JSON object to convert

Source:
  - html-include.js, line 275

##### Returns:

Highlighted JSON wrapped in a `

    ` tag

Type
  HTMLElement