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

Commit b88e140

Browse files
committed
Add angular material
1 parent 3ae6002 commit b88e140

File tree

7 files changed

+21
-1
lines changed

7 files changed

+21
-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/129694bb7305218ff8dc62827a14059fab4ff0ba.zip",
42+
strip_prefix = "material2-129694bb7305218ff8dc62827a14059fab4ff0ba",
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/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ ts_devserver(
4141
entry_module = "angular_bazel_example/src/main.dev",
4242
scripts = [
4343
":require.config.js",
44+
":module-id.js",
4445
],
4546
# This is the URL we'll point our <script> tag at
4647
serving_path = "/bundle.min.js",

src/hello-world/BUILD.bazel

Lines changed: 2 additions & 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
)
@@ -51,6 +52,7 @@ ts_web_test_suite(
5152
bootstrap = [
5253
"@npm//node_modules/zone.js:dist/zone-testing-bundle.js",
5354
"@npm//node_modules/reflect-metadata:Reflect.js",
55+
"//src:module-id.js",
5456
],
5557
browsers = [
5658
"@io_bazel_rules_webtesting//browsers:chromium-local",

src/hello-world/hello-world.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ <h1>Home</h1>
33
<div>Hello {{ name }}</div>
44

55
<input type="text" [(ngModel)]="name"/>
6+
7+
<div><mat-icon>mood</mat-icon></div>

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. -->

src/module-id.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
var module = {id: ''};

0 commit comments

Comments
 (0)