com.vaadin.flow.component.dependency.
Annotation Type HtmlImport
-
Deprecated.
Bower WebJars will be deprecated soon, so this functionality will also be deprecated and eventually removed from Vaadin. Developers should discontinue using compatibility mode and HtmlImports/WebJars in favor of JsModules. More info about deprecation here.
@Retention(value=RUNTIME) @Target(value=TYPE) @Documented @Repeatable(value=HtmlImport.Container.class) @Deprecated public @interface HtmlImport
Defines HTML dependencies on a
Component
class. For adding multiple HTML files for a single component, you can use this annotation multiple times.It is guaranteed that dependencies will be loaded only once.
NOTE: while this annotation is not inherited using the
@Inherited
annotation, the annotations of the possible parent components or implemented interfaces are read when sending the dependencies to the browser.NOTE: this annotation is only useful in compatibility mode and it is ignored in normal mode. In order to use a Polymer template inside a component in Vaadin 14+,
JsModule
annotation should be used. And to use a css file,CssImport
should be used. If you want to be able to use your component in both compatibility mode and normal mode of Vaadin 14+ you need to have @HtmlImport along with @JsModule and/or @CssImport annotations. See Vaadin 14 Migration Guide for more information on how to migrate templates from Polymer 2 to Polymer 3.Since:
1.0
Author:
Vaadin Ltd
-
-
Element Detail
-
value
public abstract String value
Deprecated.
HTML file URL to load before using the annotated
Component
in the browser.When using compiled web components, you can use a relative URL or prefix the URL with
frontend://
to serve different files to different browsers, based on their ES6 support. For example, when using"MyComponent.html"
, the evaluated URL will be:context://frontend/MyComponent.html
during development;context://frontend-es6/MyComponent.html
for ES6 capable browsers;context://frontend-es5/MyComponent.html
for other browsers.
Relative URLs are interpreted as relative to the configured
frontend
directory location. You can prefix the URL withcontext://
to make it relative to the context path or use an absolute URL to refer to files outside the frontend directory.Returns:
a html file URL
-
-