Skip to content

Commit

Permalink
WIP: Microfrontend sample
Browse files Browse the repository at this point in the history
  • Loading branch information
samie committed Jul 14, 2023
1 parent 10f96a1 commit b8ab885
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
11 changes: 11 additions & 0 deletions demo/frontend/embed-example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>NPS Feedback Embedding Test Page</title>
<script type='module' src="http://localhost:8080/web-component/nps-feedback.js"></script>
</head>
<body>
<h1>NPS Feedback</h1>
<nps-feedback product="My Product"></nps-feedback>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.example.application;

import com.example.application.views.feedback.FeedbackView;
import com.vaadin.flow.component.WebComponentExporter;
import com.vaadin.flow.component.webcomponent.WebComponent;

public class MicroFrontendExporter extends WebComponentExporter<FeedbackView> {

protected MicroFrontendExporter() {
super("nps-feedback");
addProperty("product", "")
.onChange(FeedbackView::setProductName);
}

@Override
protected void configureInstance(WebComponent<FeedbackView> webComponent, FeedbackView component) {
// Nothing to configure here
}

}

0 comments on commit b8ab885

Please sign in to comment.