Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 24c42ca

Browse files
committedMay 31, 2020
Running web components
1 parent 0a3cae1 commit 24c42ca

16 files changed

+37
-418
lines changed
 

‎docs/3rdpartylicenses.txt

Lines changed: 0 additions & 391 deletions
This file was deleted.

‎docs/favicon.ico

-948 Bytes
Binary file not shown.

‎docs/index.html

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8">
5-
<title>MicroAngular</title>
6-
<base href="micro-angular"> <meta name="viewport" content="width=device-width, initial-scale=1">
7-
<link rel="icon" type="image/x-icon" href="favicon.ico">
8-
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&display=swap" rel="stylesheet">
9-
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
10-
<link rel="stylesheet" href="styles.7621142d306f9fa2e150.css"></head>
11-
<body class="mat-typography mat-app-background">
12-
<app-root></app-root>
13-
<script src="runtime-es2015.1eba213af0b233498d9d.js" type="module"></script><script src="runtime-es5.1eba213af0b233498d9d.js" nomodule defer></script><script src="polyfills-es5.9e286f6d9247438cbb02.js" nomodule defer></script><script src="polyfills-es2015.690002c25ea8557bb4b0.js" type="module"></script><script src="main-es2015.d8a5f0a700509f71fc96.js" type="module"></script><script src="main-es5.d8a5f0a700509f71fc96.js" nomodule defer></script></body>
4+
<meta charset="UTF-8">
5+
<title>Testing Calling Micro Angular</title>
6+
<base href="/">
7+
</head>
8+
<body>
9+
<micro-angular></micro-angular>
10+
<micro-angular></micro-angular>
11+
<script src="micro-angular.js"></script>
12+
</body>
1413
</html>

‎docs/main-es2015.d8a5f0a700509f71fc96.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎docs/main-es5.d8a5f0a700509f71fc96.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎docs/micro-angular.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/polyfills-es2015.690002c25ea8557bb4b0.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎docs/polyfills-es5.9e286f6d9247438cbb02.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎docs/runtime-es2015.1eba213af0b233498d9d.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎docs/runtime-es5.1eba213af0b233498d9d.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎docs/styles.7621142d306f9fa2e150.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@angular/common": "~9.1.9",
1717
"@angular/compiler": "~9.1.9",
1818
"@angular/core": "~9.1.9",
19+
"@angular/elements": "^9.1.9",
1920
"@angular/forms": "~9.1.9",
2021
"@angular/material": "^9.2.4",
2122
"@angular/platform-browser": "~9.1.9",

‎src/app/app.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Component } from '@angular/core';
1+
import {Component} from '@angular/core';
22

33
@Component({
4-
selector: 'app-root',
4+
selector: 'micro-angular',
55
templateUrl: './app.component.html',
66
styleUrls: ['./app.component.scss']
77
})
@@ -19,5 +19,6 @@ export class AppComponent {
1919

2020
externalIncrement() {
2121
window.dispatchEvent(new CustomEvent('increment', {detail: 'angular'}));
22+
window.postMessage('increment', '*');
2223
}
2324
}

‎src/app/app.module.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { BrowserModule } from '@angular/platform-browser';
2-
import { NgModule } from '@angular/core';
1+
import {BrowserModule} from '@angular/platform-browser';
2+
import {Injector, NgModule} from '@angular/core';
33

4-
import { AppRoutingModule } from './app-routing.module';
5-
import { AppComponent } from './app.component';
6-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
4+
import {AppRoutingModule} from './app-routing.module';
5+
import {AppComponent} from './app.component';
6+
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
77
import {MatButtonModule} from "@angular/material/button";
88
import {MatIconModule} from "@angular/material/icon";
9+
import {createCustomElement} from "@angular/elements";
910

1011
@NgModule({
1112
declarations: [
@@ -21,4 +22,10 @@ import {MatIconModule} from "@angular/material/icon";
2122
providers: [],
2223
bootstrap: [AppComponent]
2324
})
24-
export class AppModule { }
25+
26+
export class AppModule {
27+
constructor(private injector: Injector) {
28+
const elem = createCustomElement(AppComponent, {injector});
29+
customElements.define('micro-angular', elem);
30+
}
31+
}

‎src/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
1111
</head>
1212
<body class="mat-typography mat-app-background">
13-
<app-root></app-root>
13+
<micro-angular></micro-angular>
14+
1415
</body>
1516
</html>

0 commit comments

Comments
 (0)
Please sign in to comment.