Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit 8a6d4a0

Browse files
committed
Add angular material
1 parent 3ae6002 commit 8a6d4a0

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

WORKSPACE

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ http_archive(
3535
sha256 = "72b0b4e517f43358f554c125e40e39f67688cd2738a8998b4a266981ed32f403",
3636
)
3737

38+
# Angular material
39+
http_archive(
40+
name = "angular_material",
41+
url = "https://github.com/gregmagolan/material2/archive/5e6a2279a17f822d443785246777467b259869b5.zip",
42+
strip_prefix = "material2-5e6a2279a17f822d443785246777467b259869b5",
43+
)
44+
3845
# Rules for compiling sass
3946
http_archive(
4047
name = "io_bazel_rules_sass",
@@ -97,3 +104,7 @@ sass_repositories()
97104
load("@angular//:index.bzl", "ng_setup_workspace")
98105

99106
ng_setup_workspace()
107+
108+
load("@angular_material//:index.bzl", "mat_setup_workspace")
109+
110+
mat_setup_workspace()

src/hello-world/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ ng_module(
2525
"@angular//packages/core",
2626
"@angular//packages/forms",
2727
"@angular//packages/router",
28+
"@angular_material//src/lib:material",
2829
"@npm//@types",
2930
],
3031
)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<h1>Home</h1>
22

3+
<div><mat-icon>mood</mat-icon></div>
4+
35
<div>Hello {{ name }}</div>
46

57
<input type="text" [(ngModel)]="name"/>

src/hello-world/hello-world.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import {NgModule} from '@angular/core';
22
import {FormsModule} from '@angular/forms';
3+
import {MatIconModule} from '@angular/material';
34
import {RouterModule} from '@angular/router';
45

56
import {HelloWorldComponent} from './hello-world.component';
67

78
@NgModule({
89
declarations: [HelloWorldComponent],
910
imports: [
10-
FormsModule, RouterModule, RouterModule.forChild([{path: '', component: HelloWorldComponent}])
11+
MatIconModule, FormsModule, RouterModule,
12+
RouterModule.forChild([{path: '', component: HelloWorldComponent}])
1113
],
1214
exports: [HelloWorldComponent],
1315
})

src/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<head>
55
<title>Angular Bazel Example</title>
66
<base href="/">
7+
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
78
</head>
89
<body>
910
<!-- The Angular application will be bootstrapped into this element. -->

0 commit comments

Comments
 (0)