Skip to content

Instantly share code, notes, and snippets.

{
"key": "shopping-cart",
"load": {
"remote": {
"key": "shopping_cart",
"entry": "assets/apps/shopping-cart/shopping-cart/remoteEntry.js",
"exposedModule": "./app",
"development": {
"entry": "http://localhost:4203/remoteEntry.js",
"active": false
<mat-toolbar color="primary">
<button
mat-icon-button
class="example-icon"
aria-label="Example icon-button with menu icon"
>
<mat-icon>menu</mat-icon>
</button>
<span>Micro Frontends Sample</span>
<span class="example-spacer"></span>
{
"apps": [
{
"key": "shopping-cart-button",
"load": {
"remote": {
"key": "shopping_cart_button",
"entry": "assets/apps/shopping-cart/shopping-cart-button/remoteEntry.js",
"exposedModule": "./app",
"development": {
@abadakhshan
abadakhshan / apps.json
Last active September 10, 2021 14:17
shell app component
[
{
"key": "shell",
"isDefault": true,
"load": {
"remote": {
"entry": "assets/apps/shell/remoteEntry.js",
"exposedModule": "./app",
"development": {
"entry": "http://localhost:4201/remoteEntry.js",
class LayoutResolver {
Resolve(key) {
switch (key) {
case "NarikListUi":
return {
layout: "",
layoutUrl: "./src/app/layouts/list-layout.html",
};
case "NarikEditUi":
return {
<!-- #layout:'widget2' -->
<ng-template #widgetContent>
Hi! I'm Widget of type 1!
<div>counter: {{ counter }}</div>
<div class="mb-2">
<narik-button label="add to Content" (click)="counter=counter+1">
</narik-button>
</div>
</ng-template>
import { Component } from "@angular/core";
@Component({
selector: "widget",
templateUrl: "widget.component.html"
})
export class WidgetType {
@Input()
<div class="card m-2">
<div class="card-body">
<div narik-section="widgetTitle">
<h5 class="card-title">{{ title }}</h5>
</div>
<div narik-section="widgetContent"></div>
<div class="card-footer">
<div narik-section="widgetFooter">
const path = require("path");
const AngularCompilerPlugin = require("@ngtools/webpack/src");
const LayoutResolver = require("./layout-resolver");
module.exports = (config) => {
const index = config.plugins.findIndex((p) => {
return p instanceof AngularCompilerPlugin.AngularCompilerPlugin;
});
const oldOptions = config.plugins[index]._options;
oldOptions.directTemplateLoading = false;
{
"key": "classValidation",
"fields": [
{
"name": "email"
},
{
"name": "hello"
}
],