-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathexample4.html
35 lines (33 loc) · 1.07 KB
/
example4.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<html>
<head>
<title>Example 4</title>
<script src="./node_modules/rxjs/bundles/rxjs.umd.js"></script>
<script src="./node_modules/@angular/compiler/bundles/compiler.umd.js"></script>
<script src="./node_modules/@angular/core/bundles/core.umd.js"></script>
<script src="./node_modules/@angular/common/bundles/common.umd.js"></script>
</head>
<my-app></my-app>
<script>
const MyApp = ng.core.Component({
selector: `my-app`,
template: `
<span style="color: green"
[style.background-color]=" 'lightgray' "
[style.color]=" 'blue' "
[style]="{'font-weight':weight}"
>Hello {{name}}!</span>
<ul>
<li *ngFor="let i of list">{{i}}</li>
</ul>`
})(class MyApp {
name = "World";
weight = "bold";
list = 'abcdefghijklmnopqrstuvwxys'.split('');
});
const MyAppModule = ng.core.NgModule({
declarations: [MyApp],
imports: [ng.common.CommonModule]
})(class MyAppModule {});
ng.core.ɵrenderComponent(MyApp);
</script>
</html>